I ran kshark-record on one machine, and set the tracer to "irqsoff" and enabled "sched_switch", "sched_waking" events, then exported the settings. On another machine, without "irqsoff" tracer, I loaded it, and it set the two sched events, but did not set "irqsoff" (as that tracer does not exist). But it did not give any warnings about it. I then went back to the previous machine, added event "cgroup_freeze", saved the settings, and imported that json file on the second machine, which does not have the "cgroup_freeze" event. It does not print any error, and only some (one) events get set (not all that should have been). Note, if I run kshark-record directly (not from kernelshark), I get on the command line: "Failed to load event filter from json_object." But still nothing about the failed loading of the tracer. We should warn about events and tracers not being set, and also set all events that are listed. There may be a case where save a set of events on one machine, and load that onto another machine, where we only care about the events that exist. I'm guessing that once an error is detected, we stop (leaving some events set but not all that could be). It should continue, even on a failed event, and set all events that are possible, and list all the events not found.
Created attachment 283935 [details] patch set
Hi Steven, The attached patch set tries to address the reported issues. Thanks! Yordan
Thanks Yordan, I tested theses patches and they appear to work fine. I would ask for one more enhancement, which is to list the failed events, but that can wait till after KS 1.0 is released. But I'll keep this BZ opened until we have that. -- Steve