Bug 213045 - trace-cmd profile is not working
Summary: trace-cmd profile is not working
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: 2021-05-12 14:07 UTC by Jerome Marchand
Modified: 2021-05-14 14:23 UTC (History)
3 users (show)

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


Attachments

Description Jerome Marchand 2021-05-12 14:07:13 UTC
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  ooking 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().

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