Bug 204679 - Shell escaping in kernel shark recorder
Summary: Shell escaping in kernel shark recorder
Status: RESOLVED CODE_FIX
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-08-23 22:59 UTC by Stephen Brennan
Modified: 2019-10-10 08:09 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.2 (n/a)
Subsystem:
Regression: No
Bisected commit-id:


Attachments
quotation parsing patch (2.69 KB, application/mbox)
2019-08-27 13:16 UTC, Yordan Karadzhov
Details

Description Stephen Brennan 2019-08-23 22:59:50 UTC
I tried to use kernel shark to record:

    python -c 'print("hello world")'

But I got the following (in the output textbox):

    trace-cmd record -e all -o /home/stephen/trace.dat python -c 'print("hello world")'
      File "<string>", line 1
        'print("hello
                    ^

Looks like kernel shark doesn't do the shell parsing (or ask sh to do it), and so the command got garbled. It would be nice if it could do this.
Comment 1 Steven Rostedt 2019-08-23 23:01:53 UTC
 I'm currently traveling and may be slow to respond. I'll be back at my normal
 hours on Monday, August 26th.

-- Steve
Comment 2 Stephen Brennan 2019-08-24 03:11:59 UTC
I suppose "shell escaping" was incorrect, and more accurately it would be "shell quoting".
Comment 3 Yordan Karadzhov 2019-08-27 13:16:13 UTC
Created attachment 284633 [details]
quotation parsing patch
Comment 4 Yordan Karadzhov 2019-08-27 13:20:44 UTC
Hi Stephen,

Thanks a lot for your report, and the interesting use-case that you bring!
A patch that implements a parsing (very primitive) of quoting is attached.

Cheers,
Yordan
Comment 5 Yordan Karadzhov 2019-10-10 08:09:20 UTC
Fixed by commit 9669fb0 (kernel-shark: Provide parsing for quotation marks in Record command line)

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