Bug 217459 - kernelshark: Failure to Capture if directory contains space
Summary: kernelshark: Failure to Capture if directory contains space
Status: NEW
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Default virtual assignee for Trace-cmd and kernelshark
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-18 15:11 UTC by Vitaly Chikunov
Modified: 2023-05-21 18:39 UTC (History)
1 user (show)

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


Attachments

Description Vitaly Chikunov 2023-05-18 15:11:23 UTC
To reproduce cd into directory with a space and capture. In different locales `Desktop` directory could be two words separated by a space. For a simple example dir name is "Work place". It then writes into file named "Work" but file is 'broken' anyway- kernelshark then reports that resulting file "contains no data".

Perhaps, filename that is passed into trace-cmd needs shell-escaping.

I understand that Capture is a noob tool, but still it's better to work.
Comment 1 Yordan Karadzhov 2023-05-18 16:20:42 UTC
Hi Vitaly,

I see that the Capture tool is valuable for you. Feel free to investigate the bug and  find a fix. If you send me a patch, I will be more than happy to take it.

cheers,
Y
Comment 2 Vitaly Chikunov 2023-05-18 17:39:33 UTC
It seems that the problem can be fixed with this modification to `bin/kshark-su-record`:
```
-pkexec kshark-record -o ${PWD}/trace.dat
+pkexec kshark-record -o "${PWD}/trace.dat"
```
Comment 3 Yordan Karadzhov 2023-05-21 18:39:58 UTC
Hi Vitaly,

Send your patch to the mailing list:
linux-trace-devel@vger.kernel.org

Note that number of different projects are sending patches to this list so please start the title of your patch with 'kernel-shark: ...'

thanks,
Y.

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