<div dir="ltr"><div><div><div>Hi,<br><br></div>I need information on how to extract system call ids from a kernel level trace by using TMF.<br></div><div>For example, a sample code to iterate through a kernel trace in CTF format is given below. <br>
<br>In this code, I am able to extract the system call name and its return value. However, from the <b>event.getContent()</b> function, I could not get the system call id for the corresponding system call name.<br><br></div>
<div>Kindly let me know, how to extract the system call id? By system call id I mean the actual system call id assigned by Linux to a system call as shown on this site: <a href="http://syscalls.kernelgrok.com/">http://syscalls.kernelgrok.com/</a><br>
</div><div><br><font style="color:rgb(0,0,255)">///////////////////////////////////////////////Code //////////////////////////////////////</font><br style="color:rgb(255,153,0)"><font style="color:rgb(0,0,255)">public void readTrace(){<br>
        <br>        CtfIterator  traceIterator=trace.createIterator();<br>         <br>        while (traceIterator.advance()){<br>
            <br>            CtfTmfEvent event = traceIterator.getCurrentEvent();<br>            ITmfEventField content = event.getContent();<br>            String eventName=event.getEventName();<br>        <br>            ITmfEventField sys_exit=content.getField("ret");<br>

            <br>            if (sys_exit != null)<br>                System.out.println("Ret: "+sys_exit.getValue()); <br>             <br>            if (eventName.startsWith(LttngStrings.SYSCALL_PREFIX)<br>                || eventName.startsWith(LttngStrings.COMPAT_SYSCALL_PREFIX)) {<br>

                        <br>                        System.out.println(eventName); <br>             }<br>        }<br>   <br>    }<br></font></div><font style="color:rgb(0,0,255)">///////////////////////////////////////////////Code //////////////////////////////////////<br>
<br style="color:rgb(0,0,0)"></font></div><font style="color:rgb(0,0,255)"><span style="color:rgb(0,0,0)">Regards,</span><br style="color:rgb(0,0,0)"><span style="color:rgb(0,0,0)">Shariyar</span><br></font></div>