Bug 207069 - "trace-cmd report -f" functionality different than expected
Summary: "trace-cmd report -f" functionality different than expected
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: Trace-cmd/Kernelshark (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Steven Rostedt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-02 19:35 UTC by Sudip
Modified: 2020-07-09 19:42 UTC (History)
1 user (show)

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


Attachments

Description Sudip 2020-04-02 19:35:01 UTC
The man page of trace-cmd-report says:
-f: This outputs the list of functions that have been recorded in the file.

For testing, generate a trace file using the command:
sudo trace-cmd record -p function_graph -l unlock_page  -F sleep 1

Use kernelshark to verify that the generated trace.dat file only has the function unlock_page().

Now "trace-cmd report -f trace.dat" will give a list of functions which ftrace supports, but according to the man page this command should have only shown "unlock_page".

Reported at: https://bugs.launchpad.net/bugs/1868900
Comment 1 Steven Rostedt 2020-04-02 20:12:16 UTC
Hi Sudip,

The documentation may be a bit confusing. I guess it should be changed.

Perhaps the documentation should say:

 "This outputs the list of functions and their addresses that have been saved in the file"

That is, the trace-cmd record reads /proc/kallsyms and this basically displays that from the file. I don't want to change the code to reflect the document, but change the document (man page) to reflect the code.

Thoughts?
Comment 2 Sudip 2020-04-02 20:36:55 UTC
Hi Steven,

Agreed. Changing the documentation is the best way instead of changing how the software behaves.

Maybe something like:
"This outputs the list of functions and their addresses that have been saved in the file as read from /proc/kallsyms".
Comment 3 Steven Rostedt 2020-04-02 22:52:53 UTC
I'd rather not mention kallsyms, as that's more of an implementation detail than what its used for. Just a list of all the functions that are mapped to an address is what I want to express.
Comment 4 Sudip 2020-04-05 13:16:04 UTC
I guess thats ok. After a re-read of your original suggestion, that also looks ok. :)
Comment 5 Steven Rostedt 2020-07-09 19:42:28 UTC
Fixed by commit: 142a41e3df8e ("trace-cmd: Explicitly state what trace-cmd report -f does")

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