Created attachment 305690 [details] trace.dat recorded with the record command given as example trace-cmd can record events in multiple instances: $ trace-cmd record -e sched_wakeup -B test_instance -e sched_switch When trying to split a trace.dat file recorded with the above command, only the events located in the main buffer seems to be split. The events recorded in the test_instance buffer seem to be discarded: $ trace-cmd split -i trace.dat -o trace_2.dat 284443 284444 $ trace-cmd report trace_2.dat cpus=8 <...>-525991 [004] 284443.173879: sched_wakeup: wdavdaemon:525987 [120] CPU:007 <...>-525991 [004] 284443.173879: sched_wakeup: wdavdaemon:525987 [120] CPU:007 <...>-525990 [007] 284443.173885: sched_wakeup: wdavdaemon:525986 [120] CPU:007 <...>-525990 [007] 284443.173885: sched_wakeup: wdavdaemon:525986 [120] CPU:007 (no sign of sched_switch events) As a side issue, it also seems that some timestamps make the trace-cmd split command fail: $ trace-cmd split -i trace.dat -o trace_2.dat 284443.2003 284444 Segmentation fault
I forgot to mention, trace-cmd is built from the latest: 08435acd37326c7030747dc5c3a10daca185e6fe (HEAD, origin/master, origin/HEAD) trace-cmd stat: Use tracefs_instance_file_read()
Moving to Tools: trace-cmd/KernelShark As "Tracing/Profiling" is for the kernel component not the tooling.
I have started to work on it, just to avoid a duplicated effort.
Created attachment 305691 [details] Handle leaf node case in rbtree deletion Can you see if this patch fixes it for you. The rbtree did't handle a deletion of a leaf node. I have no idea how this didn't trigger in my tests.
Yes it solves the Segmentation fault issue, Thanks
Unfortunately that patch is incorrect. Although it fixes the segfault, it corrupts the rbtree. I have the real fix here: https://lore.kernel.org/all/20240110103941.2e26da60@gandalf.local.home/
Fixed by: https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/commit/?id=7d8b3c02c6583bdf8d39e5f32ada33edbd437669