Bug 217459

Summary: kernelshark: Failure to Capture if directory contains space
Product: Tools Reporter: Vitaly Chikunov (vt)
Component: Trace-cmd/KernelsharkAssignee: Default virtual assignee for Trace-cmd and kernelshark (tools_tracecmd_kernelshark)
Status: NEW ---    
Severity: normal CC: y.karadz
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

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.