trace-cmd profile is not working
Hi,
Streams, and thus trace-cmd profile, are not working. A simple
"trace-cmd profile ls" command exit with the following message
"Creating stream for 0". I've been looking at it and the issue is that tracecmd_read_headers() tries to read the cmdlines, cpus and options sections that have not been written to the temporary file when called from trace_stream_init().
AFAICT, it is caused by the two following patches:
commit 1eea02a4 ("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.") which moved the writing of cmdlines from create_file_fd() to tracecmd_create_file_latency() and tracecmd_append_cpu_data()
commit 5d4d7ec3 ("trace-cmd: Move reading of trace.dat options to tracecmd_read_headers()") which moved the reading of options and cpu datas to tracecmd_read_headers().
Thanks,
Jerome
Quoted 11 lines · On Wed, 12 May 2021 15:51:52 +0200 Jerome Marchand <[email protected]> wrote:
Hi,
Streams, and thus trace-cmd profile, are not working. A simple "trace-cmd profile ls" command exit with the following message "Creating stream for 0". I've been looking at it and the issue is that
tracecmd_read_headers()tries to read the cmdlines, cpus and options sections that have not been written to the temporary file when called fromtrace_stream_init().AFAICT, it is caused by the two following patches:
Quoted 9 lines
commit
1eea02a4("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.") which moved the writing of cmdlines fromcreate_file_fd()totracecmd_create_file_latency()andtracecmd_append_cpu_data()commit
5d4d7ec3("trace-cmd: Move reading of trace.dat options totracecmd_read_headers()") which moved the reading of options and cpu datas totracecmd_read_headers().
Thanks for the report. I'm not surprised, profiling and streams have not been given the love they deserve (been focusing on host/guest tracing recently).
Can you fill out a bug report on bugzilla?
Thanks!
-- Steve
Quoted 24 lines · Steven Rostedt
Quoted 11 lines · On Wed, 12 May 2021 15:51:52 +0200 Jerome Marchand <[email protected]> wrote:
Hi,
Streams, and thus trace-cmd profile, are not working. A simple "trace-cmd profile ls" command exit with the following message "Creating stream for 0". I've been looking at it and the issue is that
tracecmd_read_headers()tries to read the cmdlines, cpus and options sections that have not been written to the temporary file when called fromtrace_stream_init().AFAICT, it is caused by the two following patches:
Quoted 9 lines
commit
1eea02a4("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.") which moved the writing of cmdlines fromcreate_file_fd()totracecmd_create_file_latency()andtracecmd_append_cpu_data()commit
5d4d7ec3("trace-cmd: Move reading of trace.dat options totracecmd_read_headers()") which moved the reading of options and cpu datas totracecmd_read_headers().
Quoted 5 lines
Thanks for the report. I'm not surprised, profiling and streams have not been given the love they deserve (been focusing on host/guest tracing recently).
Can you fill out a bug report on bugzilla?
Sure thing:
https://bugzilla.kernel.org/show_bug.cgi?id=213045
Jerome
Quoted 7 lines
Thanks!
-- Steve
Quoted 2 lines · On Wed, 12 May 2021 16:09:01 +0200 Jerome Marchand <[email protected]> wrote:
Sure thing:
https://bugzilla.kernel.org/show_bug.cgi?id=213045
Thanks,
We are working on some other aspects now, but will try to have this fixed before we do another release.
-- Steve
Hi Jerome,
Quoted 30 lines · Jerome Marchand
Quoted 28 lines · Steven Rostedt
Quoted 11 lines · On Wed, 12 May 2021 15:51:52 +0200 Jerome Marchand <[email protected]> wrote:
Hi,
Streams, and thus trace-cmd profile, are not working. A simple "trace-cmd profile ls" command exit with the following message "Creating stream for 0". I've been looking at it and the issue is that
tracecmd_read_headers()tries to read the cmdlines, cpus and options sections that have not been written to the temporary file when called fromtrace_stream_init().AFAICT, it is caused by the two following patches:
Quoted 9 lines
commit
1eea02a4("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.") which moved the writing of cmdlines fromcreate_file_fd()totracecmd_create_file_latency()andtracecmd_append_cpu_data()commit
5d4d7ec3("trace-cmd: Move reading of trace.dat options totracecmd_read_headers()") which moved the reading of options and cpu datas totracecmd_read_headers().Thanks for the report. I'm not surprised, profiling and streams have not been given the love they deserve (been focusing on host/guest tracing recently).
Quoted 12 lines
Quoted 1 line
Can you fill out a bug report on bugzilla?
Sure thing:
https://bugzilla.kernel.org/show_bug.cgi?id=213045Jerome
I've submitted a fix for this, please can you verify if it fixes the problem. Thanks for testing this code and reporting bugs!
Quoted 3 lines
Quoted 2 lines
-- Steve
Signature · 2 lines
Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center
Quoted 41 lines · Tzvetomir Stoyanov
Hi Jerome,
Quoted 38 lines · Jerome Marchand
Quoted 24 lines · Steven Rostedt
Quoted 11 lines · On Wed, 12 May 2021 15:51:52 +0200 Jerome Marchand <[email protected]> wrote:
Hi,
Streams, and thus trace-cmd profile, are not working. A simple "trace-cmd profile ls" command exit with the following message "Creating stream for 0". I've been looking at it and the issue is that
tracecmd_read_headers()tries to read the cmdlines, cpus and options sections that have not been written to the temporary file when called fromtrace_stream_init().AFAICT, it is caused by the two following patches:
Quoted 9 lines
commit
1eea02a4("trace-cmd: Write saved cmdlines in the trace file at the end of the trace.") which moved the writing of cmdlines fromcreate_file_fd()totracecmd_create_file_latency()andtracecmd_append_cpu_data()commit
5d4d7ec3("trace-cmd: Move reading of trace.dat options totracecmd_read_headers()") which moved the reading of options and cpu datas totracecmd_read_headers().Quoted 5 lines
Thanks for the report. I'm not surprised, profiling and streams have not been given the love they deserve (been focusing on host/guest tracing recently).
Can you fill out a bug report on bugzilla?
Sure thing:
https://bugzilla.kernel.org/show_bug.cgi?id=213045Jerome
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
I've submitted a fix for this, please can you verify if it fixes the problem. Thanks for testing this code and reporting bugs!
Yes, it does fixes the issue have been seeing.
Thanks,
Jerome
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
-- Steve