I think the text you are referring to, is explaining that the kernel inserts some “extraneous” stuff in the trace file, in order to help the analysis tool. I don’t believe it is suggesting that you have control over this (precisely the opposite, I think).
However, you can insert your own events into the trace using the TraceEvent() API. I believe it is exactly what you are looking for. It is actually very well documented.
The IDE will display your user events, although it tries to figure out whether they are text or hex, and sometimes gets it wrong. It’s rule of thumb is that printable data greater than 8 bytes is a string.
You can search for user events so you can use the condition statistics.
Note that user event codes should be between 0 and 0x3ff
Now I am able to detect the user events on the “Condition Statistics” view (defining a condition of the class “User events”, Code “All User Events”.
I also see the event “TraceEvent Enter” and “Event Code 0x00000000” on the “General Statistics View” (“Events” Window). Is it this ??
But I am not able to see them on the “Trace Event Log” view !
Anyway, is there a way from the IDE to only select this events, with the associated time, and save the information in a cvs like file ?? Or should I do a specific programm for this ?
I have generated the user event with this two calls:
And with this I am able to get prefectly the events on the “Trace Event Log” view.
Now I would like to save this log on a .cvs like file, in order to calculate the elpased time from excell. Or even better, calculate this time directy with the IDE.
But I am not able to save this filtered events on a file. Is it possible ?
So a specific self-made utility is needed in order to extract this events directly from the .kev file ??
With the filter on, click the File->Save As and you will be able to save only the filtered events.
Then you will have to use libtraceparser.a to write your own util, or use traceprinter, sed, awk, grep, cut etc to generate a csv
Also, if it’s just a few events then if you select the two events in the tracelog view the timeline view will show the elapsed time between them
Well, using traceprinter seems a bit easier (libtraceparser.a is complicate, I don’t see examples??).
A question: the output of the times gived by traceprinter is give in CPU clock cycles. It also gives a field of the header file, named “TRACE_CYCLES_PER_SEC”.
But I don’t see anywhere that TRACE_CYCLES_PER_SEC is the number of clock cycles per second.