From: "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org
Subject: [PATCH 0/4][WiP] trace-cmd: Add "perf" sub command
Date: Fri, 7 Aug 2020 15:06:51 +0300 [thread overview]
Message-ID: <20200807120655.797084-1-tz.stoyanov@gmail.com> (raw)
A new "trace-cmd perf" sub command is implemented, to collect performance
information about a user space program, using perf. The command has one
argumemnt, mandatory, using to specify a PID of running userspace process:
trace-cmd perf --pid <PID>
This is a work in progress, not completed yet.
What is implemented:
- Initial infrastructure for configuring perf, using its kernel interface,
and running per CPU threads for reading collected perf data. Perf is used
to collect periodically CALLCHAINs (values of IP register) of the requested
PID.
- trace-cmd internal APIs, wrapper around libbfd, for parsing an ELF header.
- Resolving collected IP values to function names, using the binary file of
the running application and all libraries that it uses.
- New trace.dat file option for storing address to function name mapping
and a new API for address to name resolving using stored information.
What is not yet implemented:
- There are problems reading the perf mmap pages with collected data,
currently only the first few records from each CPU page are read correctly.
- Assemble the trace.dat file with all mandatory headers. Think about a new
type of trace data in the file and its format. This should be designed
flexible, to be able to store various perf data, not only CALLCHAINs.
- Add support in "trace-dat report" for reporting the new data.
- Add APIs in libtracecmd for reading the new data.
- Enable collecting of kernel functions in the CALLCHAIN and implement
resolving of kernel address to a kernel function name.
- Formatting and beautifying the code.
- A lot of testing and bug fixing.
Tzvetomir Stoyanov (VMware) (4):
trace-cmd: Internal refactoring of pid address map logic
trace-cmd: New internal APIs for reading ELF header
trace-cmd: Add a new option in trace.dat file for the address to
function name mapping
trace-cmd: Add new subcomand "trace-cmd perf"
Makefile | 10 +
include/trace-cmd/trace-cmd.h | 13 +
lib/trace-cmd/trace-input.c | 144 ++++++
tracecmd/Makefile | 2 +
tracecmd/include/trace-local.h | 33 +-
tracecmd/trace-cmd.c | 1 +
tracecmd/trace-dump.c | 3 +
tracecmd/trace-obj-debug.c | 770 +++++++++++++++++++++++++++++++++
tracecmd/trace-perf.c | 540 +++++++++++++++++++++++
tracecmd/trace-record.c | 107 +----
10 files changed, 1510 insertions(+), 113 deletions(-)
create mode 100644 tracecmd/trace-obj-debug.c
create mode 100644 tracecmd/trace-perf.c
--
2.26.2
next reply other threads:[~2020-08-07 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-07 12:06 Tzvetomir Stoyanov (VMware) [this message]
2020-08-07 12:06 ` [PATCH 1/4] trace-cmd: Internal refactoring of pid address map logic Tzvetomir Stoyanov (VMware)
2020-08-07 12:06 ` [PATCH 2/4] trace-cmd: New internal APIs for reading ELF header Tzvetomir Stoyanov (VMware)
2020-08-07 12:06 ` [PATCH 3/4] trace-cmd: Add a new option in trace.dat file for the address to function name mapping Tzvetomir Stoyanov (VMware)
2020-08-07 12:06 ` [PATCH 4/4] trace-cmd: Add new subcomand "trace-cmd perf" Tzvetomir Stoyanov (VMware)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200807120655.797084-1-tz.stoyanov@gmail.com \
--to=tz.stoyanov@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.