I have information of kernel function calls with timestamps and the order in which they were called and can generate a call stack from it. But since tracecompass already shows callstack from lttng's trace output, I was wondering if I can give my data to tracecompass in some format that it understands so that it can show the call stack from my data. But couldn't find which format of input it takes for the call stack. I do know that it takes lttng's ctf format output, but that's for whole of tracing data and not the stack traces.
2 Answers
The callstack from lttng's trace is built by the state system. I don't know how they are doing it for the callstack in UST applications. But a similar looking functionnality is present in the control flow view from the kernel. There the call tree is made from the sched_process_fork event.
sched_process_fork: { cpu_id = 1 }, { parent_comm = "bash", parent_tid = 16746, parent_pid = 16746, parent_ns_inum = 4026531836, child_comm = "bash", child_tid = 16970, _vtids_length = 1, vtids = [ [0] = 16970 ], child_pid = 16970, child_ns_inum = 4026531836 }
They are made when a process is forking for a new one. You can use babeltrace to write some event in that format and try to use the control flow view from the kernel tracing perspective in Trace Compass.
But I think you should look at the metadata of a CTF trace with a callstack to see how they are doing it there.
Hoping I could help a little.

- 11
- 2
I would recommend showing what kind of trace format you have. Right now (jan 2023) Trace Compass supports LTTng, FTrace and Perf OS level traces. None of these kernel traces populate any callstack views, however, on the userspace side, LTTng-UST, UFTrace, Trace Event and others do.
If you want to generate a custom gantt chart, one approach would be to make a Data Driven Analysis. Another would be to use EASE to have custom scripts. A third option would be to fake it. I have done it here in C.
What I would really recommend because it's so easy would be to use the in and out analysis here. With this you have a hand GUI that will guide you on how to make your trace.

- 17,741
- 7
- 42
- 75

- 116
- 8