On Fri, 25 Mar 2022 16:13:33 -0400 Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > I'll fix it in v2. BTW, I plan on rewriting a lot of this to move it into libtracecmd. That way other tools can easily extract data from it. For example, instead of hard coding "page faults" and "wake ups" I plan on adding a way to register events to trigger on. Something like: tracecmd_analyze_register_event_timing(handle, name, start_event, start_field, start_record, end_event, end_field, end_record); Where "start_record" and "end_record" is if the field is a task to record. enum { TRACECMD_ANALYZE_FL_NONE, TRACECMD_ANALYZE_FL_PID, TRACECMD_ANALYZE_FL_PID_CPU, }; Thus, we could have: tracecmd_analyze_register_event_timing(handle, "Wakeup", sched_waking, pid_field, TRACECMD_ANALYZE_FL_PID, sched_switch, next_pid, TRACECMD_ANALYZE_FL_PID_CPU); Or something like the above, that will end up turning into the process_wakeup() function (and properly record the waking pid globally). One tool I want to use this with, is my ktrace shell (development has stalled, but I do plan on starting it again). https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/ktrace.git/ And then I could have commands like: ktrace> open trace.dat ktrace> analyze register timing sched.sched_switch pid global \ sched.sched_switch next_pid cpu ktrace> analyze ktrace> analyze show cpu 1 And it only shows cpu 1 data. ktrace> analyze show pid 512 to see just pid 512 etc. -- Steve