Konstantin V(deleted)
|
Kernel trace : setup static filters to trace only specific processes
|
Konstantin V(deleted)
02/24/2012 5:23 AM
post91763
|
Kernel trace : setup static filters to trace only specific processes
Hello QNX Developers,
I need to setup kernel trace filters so only communication messages emitted by specific processes are recorded. I
followed QNX documentation and wrote little helper util, but eventually tracing is performed only for the last process
specified.
The core functionality of this util is based on following TraceEvent() call :
TraceEvent(_NTO_TRACE_SETCLASSPID, int class, pid_t pid)
Usecase
1) Execute tracelogger : tracelogger -d1 -s 10 -f trace_mcd_`date -t`.kev
2) In another console, get required process ids : pidin -f "aA" | grep -i -E "eide|mcd|any_other"
3) Start tracing : ./mcd_event_filter 1 2 3
Note that in case of tracelogger is not running, setting filters will (legally) fail : ./mcd_event_filter: line:109
function call TraceEvent() failed, errno(47): Operation canceled
Expected results :
- kernel trace for communication messages (and other trace classes) caused by all these processes is enabled
Current behavior :
- kernel trace only for the last (!) PID specified is available
Could you please point me what`s wrong with this idea/util ?
Is it possible to implement such filter without resorting to dynamic filtering ?
See attached source for the mentioned code.
Thank you!
|
|
|