Bug 204287 - Better handling of importing kshark-record settings
Summary: Better handling of importing kshark-record settings
Status: NEW
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Default virtual assignee for Trace-cmd and kernelshark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-23 18:07 UTC by Steven Rostedt
Modified: 2019-07-24 18:41 UTC (History)
1 user (show)

See Also:
Kernel Version: KernelShark 0.99
Subsystem:
Regression: No
Bisected commit-id:


Attachments
patch set (27.82 KB, application/mbox)
2019-07-24 15:45 UTC, Yordan Karadzhov
Details

Description Steven Rostedt 2019-07-23 18:07:08 UTC
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.
Comment 1 Yordan Karadzhov 2019-07-24 15:45:51 UTC
Created attachment 283935 [details]
patch set
Comment 2 Yordan Karadzhov 2019-07-24 15:47:38 UTC
Hi Steven,

The attached patch set tries to address the reported issues.

Thanks!
Yordan
Comment 3 Steven Rostedt 2019-07-24 18:41:28 UTC
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

Note You need to log in before you can comment on or make changes to this bug.