All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] tracing/boot: Add new options for tracing specific period
@ 2020-09-10  8:54 Masami Hiramatsu
  2020-09-10  8:55 ` [PATCH v3 1/8] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Masami Hiramatsu @ 2020-09-10  8:54 UTC (permalink / raw)
  To: Steven Rostedt, Jonathan Corbet, Shuah Khan
  Cc: mhiramat, linux-kernel, linux-doc, Randy Dunlap, Ingo Molnar,
	linux-kselftest

Hi,

Here is the 3rd 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/159894698993.1478826.2813843560314595660.stgit@devnote2

This version adds uprobe %return suffix support ([5/8]) and the testcases
([8/8]), and update kprobe %suffix support([4/8]) and the uprobe event
document([6/8]).


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 (8):
      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
      tracing/uprobes: Support perf-style return probe
      Documentation: tracing: Add %return suffix description
      Documentation: tracing: boot: Add an example of tracing function-calls
      selftests/ftrace: Add %return suffix tests


 Documentation/trace/boottime-trace.rst             |   24 ++++++++++++++++++++
 Documentation/trace/kprobetrace.rst                |    2 ++
 Documentation/trace/uprobetracer.rst               |    2 ++
 include/linux/kprobes.h                            |    5 ++++
 init/main.c                                        |    2 ++
 kernel/kprobes.c                                   |   22 ++++++++++++++++++
 kernel/trace/trace.c                               |    4 ++-
 kernel/trace/trace_boot.c                          |   10 ++++++++
 kernel/trace/trace_kprobe.c                        |   18 ++++++++++++++-
 kernel/trace/trace_probe.h                         |    1 +
 kernel/trace/trace_uprobe.c                        |   15 ++++++++++++-
 .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc   |    6 +++++
 .../test.d/kprobe/kretprobe_return_suffix.tc       |   21 ++++++++++++++++++
 .../ftrace/test.d/kprobe/uprobe_syntax_errors.tc   |    6 +++++
 14 files changed, 134 insertions(+), 4 deletions(-)
 create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_return_suffix.tc

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-11  1:34 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10  8:54 [PATCH v3 0/8] tracing/boot: Add new options for tracing specific period Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 1/8] kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 2/8] tracing/boot: Add per-instance tracing_on option support Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 3/8] Documentation: tracing: Add tracing_on option to boot-time tracer Masami Hiramatsu
2020-09-10 13:26   ` Bird, Tim
2020-09-10 22:41     ` Masami Hiramatsu
2020-09-11  0:47       ` [PATCH v3.1 " Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 4/8] tracing/kprobes: Support perf-style return probe Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 5/8] tracing/uprobes: " Masami Hiramatsu
2020-09-10  8:55 ` [PATCH v3 6/8] Documentation: tracing: Add %return suffix description Masami Hiramatsu
2020-09-10  8:56 ` [PATCH v3 7/8] Documentation: tracing: boot: Add an example of tracing function-calls Masami Hiramatsu
2020-09-10  8:56 ` [PATCH v3 8/8] selftests/ftrace: Add %return suffix tests Masami Hiramatsu
2020-09-10 23:34 ` [PATCH v3 0/8] tracing/boot: Add new options for tracing specific period Steven Rostedt
2020-09-11  1:27   ` Masami Hiramatsu
2020-09-11  1:34     ` Shuah Khan

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.