From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>, Jonathan Corbet <corbet@lwn.net>
Cc: mhiramat@kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org, Randy Dunlap <rdunlap@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: [PATCH v2 0/6] tracing/boot: Add new options for tracing specific period
Date: Tue, 1 Sep 2020 16:56:30 +0900 [thread overview]
Message-ID: <159894698993.1478826.2813843560314595660.stgit@devnote2> (raw)
Hi,
Here is the 2nd version of the series to improve the boot-time tracing to
support kretprobe and tracing_on option. Previous version is here:
https://lkml.kernel.org/r/159887792384.1330989.5993224243767476896.stgit@devnote2
This version fixes a build error ([1/6]) and fix a space indent issue
([5/6]).
The combination of tracing_on and kretprobe allows us to trace events
while a specific function call period. For example, the below bootconfig
will make a function callgraph in the pci_proc_init() function at boot
time.
ftrace {
tracing_on = 0 # off at start
tracer = function_graph
event.kprobes {
start_event {
probes = "pci_proc_init"
actions = "traceon"
}
end_event {
probes = "pci_proc_init%return"
actions = "traceoff"
}
}
}
Here is the example output;
# tracer: function_graph
#
# CPU DURATION FUNCTION CALLS
# | | | | | | |
0) | pci_proc_init() {
0) | proc_mkdir() {
0) | proc_mkdir_data() {
0) | __proc_create() {
0) | _raw_read_lock() {
0) 0.179 us | preempt_count_add();
0) 0.203 us | do_raw_read_lock();
0) 1.210 us | }
0) | __xlate_proc_name() {
0) 0.449 us | pde_subdir_find();
0) 0.913 us | }
0) | _raw_read_unlock() {
0) 0.169 us | do_raw_read_unlock();
0) 0.175 us | preempt_count_sub();
0) 0.841 us | }
0) | kmem_cache_alloc() {
0) | fs_reclaim_acquire() {
0) 0.154 us | __need_fs_reclaim();
0) 0.240 us | fs_reclaim_acquire.part.0();
0) 0.889 us | }
0) | fs_reclaim_release() {
0) 0.174 us | __need_fs_reclaim();
0) 0.516 us | }
0) 0.157 us | should_failslab();
0) | rcu_read_lock_sched_held() {
0) | rcu_read_lock_held_common() {
0) 0.156 us | rcu_is_watching();
0) 0.158 us | rcu_lockdep_current_cpu_online();
0) 0.735 us | }
0) 1.054 us | }
0) 3.407 us | }
0) 0.168 us | __raw_spin_lock_init();
0) 7.575 us | }
0) | proc_register() {
0) | _raw_spin_lock_irqsave() {
0) 0.187 us | preempt_count_add();
...
Thank you,
---
Masami Hiramatsu (6):
kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
tracing/boot: Add per-instance tracing_on option support
Documentation: tracing: Add tracing_on option to boot-time tracer
tracing/kprobes: Support perf-style return probe
Documentation: tracing: Add %return suffix description
Documentation: tracing: boot: Add an example of tracing function-calls
Documentation/trace/boottime-trace.rst | 24 ++++++++++++++++++++++++
Documentation/trace/kprobetrace.rst | 2 ++
include/linux/kprobes.h | 5 +++++
init/main.c | 2 ++
kernel/kprobes.c | 22 ++++++++++++++++++++++
kernel/trace/trace_boot.c | 10 ++++++++++
kernel/trace/trace_kprobe.c | 21 ++++++++++++++++++++-
7 files changed, 85 insertions(+), 1 deletion(-)
--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>
next reply other threads:[~2020-09-01 7:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-01 7:56 Masami Hiramatsu [this message]
2020-09-01 7:56 ` [PATCH v2 1/6] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
2020-09-01 7:56 ` [PATCH v2 2/6] tracing/boot: Add per-instance tracing_on option support Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 3/6] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 4/6] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
2020-09-10 0:49 ` Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 5/6] Documentation: tracing: Add %return suffix description Masami Hiramatsu
2020-09-01 7:57 ` [PATCH v2 6/6] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu
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=159894698993.1478826.2813843560314595660.stgit@devnote2 \
--to=mhiramat@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rdunlap@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox