tracing/boot: Add new options for tracing specific period
Subsystems (4)
Masami Hiramatsu
maintainerv3 cover tracing/boot: Add new options for tracing specific period
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) <[email protected]>
Masami Hiramatsu
maintainerPATCH v3 1/8 kprobes: tracing/kprobes: Fix to kill kprobes on initmem after boot
Since kprobe_event= cmdline option allows user to put kprobes on the functions in initmem, kprobe has to make such probes gone after boot. Currently the probes on the init functions in modules will be handled by module callback, but the kernel init text isn't handled. Without this, kprobes may access non-exist text area to disable or remove it.
---
Changes in v2:
- Fix kprobe_free_init_mem() not depending on CONFIG_DEBUG_FS.
--- include/linux/kprobes.h | 5 +++++ init/main.c | 2 ++ kernel/kprobes.c | 22 ++++++++++++++++++++++ 3 files changed, 29 insertions(+)
include/linux/kprobes.h +5 -0
@@ -373,6 +373,8 @@ void unregister_kretprobes(struct kretprobe **rps, int num);void kprobe_flush_task (struct task_struct *tk);void recycle_rp_inst (struct kretprobe_instance *ri,struct hlist_head *head); +void kprobe_free_init_mem (void ); +int disable_kprobe (struct kprobe *kp);int enable_kprobe (struct kprobe *kp);
@@ -435,6 +437,9 @@ static inline void unregister_kretprobes(struct kretprobe **rps, int num)static inline void kprobe_flush_task (struct task_struct *tk) { } +static inline void kprobe_free_init_mem (void ) +{ +}static inline int disable_kprobe (struct kprobe *kp) {return -ENOSYS ;
init/main.c +2 -0
@@ -33,6 +33,7 @@#include <linux/nmi.h> #include <linux/percpu.h> #include <linux/kmod.h> +#include <linux/kprobes.h> #include <linux/vmalloc.h> #include <linux/kernel_stat.h> #include <linux/start_kernel.h>
@@ -1402,6 +1403,7 @@ static int __ref kernel_init(void *unused)kernel_init_freeable ();/* need to finish all async __init code before freeing the memory */ async_synchronize_full (); +kprobe_free_init_mem ();ftrace_free_init_mem ();free_initmem ();mark_readonly ();
kernel/kprobes.c +22 -0
@@ -2452,6 +2452,28 @@ static struct notifier_block kprobe_module_nb = {extern unsigned long __start_kprobe_blacklist[];extern unsigned long __stop_kprobe_blacklist[]; +void kprobe_free_init_mem (void ) +{ +void *start = (void *)(&__init_begin); +void *end = (void *)(&__init_end); +struct hlist_head *head; +struct kprobe *p; +int i; + +mutex_lock (&kprobe_mutex); + +/* Kill all kprobes on initmem */ +for (i =0 ; i <KPROBE_TABLE_SIZE ; i++) { + head = &kprobe_table[i]; +hlist_for_each_entry (p, head, hlist) { +if (start <= (void *)p->addr && (void *)p->addr < end) +kill_kprobe (p); + } + } + +mutex_unlock (&kprobe_mutex); +} +static int __init init_kprobes (void ) {int i, err =0 ;
Masami Hiramatsu
maintainerPATCH v3 3/8 Documentation: tracing: Add tracing_on option to boot-time tracer
In reply to Masami HiramatsuAdd tracing_on option description to the boot-time tracer.
--- Documentation/trace/boottime-trace.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/trace/boottime-trace.rst +4 -0
@@ -61,6 +61,10 @@ These options can be used for each instance including global ftrace node. ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]] Enable given ftrace options. +ftrace.[instance.INSTANCE.]tracing_on = 0|1 + Enable/Disable tracing on this instance when boot. + (you can enable it by the "traceon" event trigger action) + ftrace.[instance.INSTANCE.]trace_clock = CLOCK Set given CLOCK to ftrace's trace_clock.
Masami Hiramatsu
maintainerPATCH v3 4/8 tracing/kprobes: Support perf-style return probe
In reply to Masami HiramatsuSupport perf-style return probe ("SYMBOL%return") for kprobe events. This will allow boot-time tracing user to define a return probe event.
---
Changes in v3:
- Update README so that user can notice the kernel supports this feature.
- Add a new error message.
--- kernel/trace/trace.c | 2 +- kernel/trace/trace_kprobe.c | 18 +++++++++++++++++- kernel/trace/trace_probe.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-)
kernel/trace/trace.c +1 -1
@@ -5122,7 +5122,7 @@ static const char readme_msg[] = "\t -:[<group>/]<event>\n" #ifdef CONFIG_KPROBE_EVENTS "\t place: [<module>:]<symbol>[+<offset>]|<memaddr>\n" - "place (kretprobe): [<module>:]<symbol>[+<offset>]|<memaddr>\n" + "place (kretprobe): [<module>:]<symbol>[+<offset>]%return|<memaddr>\n" #endif#ifdef CONFIG_UPROBE_EVENTS " place (uprobe): <path>:<offset>[(ref_ctr_offset)]\n"
kernel/trace/trace_kprobe.c +17 -1
@@ -717,6 +717,9 @@ static int trace_kprobe_create(int argc, const char *argv[])* p[:[GRP/]EVENT] [MOD:]KSYM[+OFFS]|KADDR [FETCHARGS] * - Add kretprobe: * r[MAXACTIVE][:[GRP/]EVENT] [MOD:]KSYM[+0] [FETCHARGS] +* Or +* p:[GRP/]EVENT] [MOD:]KSYM[+0]%return [FETCHARGS] +* * Fetch args: * $retval : fetch return value * $stack : fetch stack address
@@ -746,7 +749,6 @@ static int trace_kprobe_create(int argc, const char *argv[])switch (argv[0 ][0 ]) {case 'r' : is_return = true; - flags |=TPARG_FL_RETURN ;break ;case 'p' :break ;
@@ -804,12 +806,26 @@ static int trace_kprobe_create(int argc, const char *argv[]) symbol =kstrdup (argv[1 ],GFP_KERNEL );if (!symbol)return -ENOMEM ; + + tmp =strchr (symbol,'%' ); +if (tmp) { +if (!strcmp (tmp,"%return" )) { + *tmp ='\0' ; + is_return = true; + }else { +trace_probe_log_err (tmp - symbol,BAD_ADDR_SUFFIX ); + goto parse_error; + } + } +/* TODO: support .init module functions */ ret =traceprobe_split_symbol_offset (symbol, &offset);if (ret || offset <0 || offset >UINT_MAX ) {trace_probe_log_err (0 ,BAD_PROBE_ADDR ); goto parse_error; } +if (is_return) + flags |=TPARG_FL_RETURN ;if (kprobe_on_func_entry (NULL , symbol, offset)) flags |=TPARG_FL_FENTRY ;if (offset && is_return && !(flags &TPARG_FL_FENTRY )) {
kernel/trace/trace_probe.h +1 -0
@@ -404,6 +404,7 @@ extern int traceprobe_define_arg_fields(struct trace_event_call *event_call,C (MAXACT_TOO_BIG ,"Maxactive is too big" ), \C (BAD_PROBE_ADDR ,"Invalid probed address or symbol" ), \C (BAD_RETPROBE ,"Retprobe address must be an function entry" ), \ +C (BAD_ADDR_SUFFIX ,"Invalid probed address suffix" ), \C (NO_GROUP_NAME ,"Group name is not specified" ), \C (GROUP_TOO_LONG ,"Group name is too long" ), \ C(BAD_GROUP_NAME, "Group name must follow the same rules as C identifiers"), \
Masami Hiramatsu
maintainerPATCH v3 6/8 Documentation: tracing: Add %return suffix description
In reply to Masami HiramatsuAdd a description of the %return suffix option for kprobe event and uprobe event.
---
Changes in v3
- Add description for uprobe events too.
Changes in v2
- Use a tab for indentation as other lines do.
--- Documentation/trace/kprobetrace.rst | 2 ++ Documentation/trace/uprobetracer.rst | 2 ++ 2 files changed, 4 insertions(+)
Documentation/trace/kprobetrace.rst +2 -0
@@ -30,6 +30,7 @@ Synopsis of kprobe_events p[:[GRP/]EVENT] [MOD:]SYM[+offs]|MEMADDR [FETCHARGS] : Set a probe r[MAXACTIVE][:[GRP/]EVENT] [MOD:]SYM[+0] [FETCHARGS] : Set a return probe + p:[GRP/]EVENT] [MOD:]SYM[+0]%return [FETCHARGS] : Set a return probe -:[GRP/]EVENT : Clear a probe GRP : Group name. If omitted, use "kprobes" for it.
@@ -37,6 +38,7 @@ Synopsis of kprobe_events based on SYM+offs or MEMADDR. MOD : Module name which has given SYM. SYM[+offs] : Symbol+offset where the probe is inserted. + SYM%return : Return address of the symbol MEMADDR : Address where the probe is inserted. MAXACTIVE : Maximum number of instances of the specified function that can be probed simultaneously, or 0 for the default value
Documentation/trace/uprobetracer.rst +2 -0
@@ -28,6 +28,7 @@ Synopsis of uprobe_tracer p[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS] : Set a uprobe r[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS] : Set a return uprobe (uretprobe) + p[:[GRP/]EVENT] PATH:OFFSET%return [FETCHARGS] : Set a return uprobe (uretprobe) -:[GRP/]EVENT : Clear uprobe or uretprobe event GRP : Group name. If omitted, "uprobes" is the default value.
@@ -35,6 +36,7 @@ Synopsis of uprobe_tracer on PATH+OFFSET. PATH : Path to an executable or a library. OFFSET : Offset where the probe is inserted. + OFFSET%return : Offset where the return probe is inserted. FETCHARGS : Arguments. Each probe can have up to 128 args. %REG : Fetch register REG
Masami Hiramatsu
maintainerPATCH v3 5/8 tracing/uprobes: Support perf-style return probe
In reply to Masami HiramatsuSupport perf-style return probe ("SYMBOL%return") for uprobe events as same as kprobe events does.
--- kernel/trace/trace.c | 2 +- kernel/trace/trace_uprobe.c | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-)
kernel/trace/trace.c +1 -1
@@ -5125,7 +5125,7 @@ static const char readme_msg[] = "place (kretprobe): [<module>:]<symbol>[+<offset>]%return|<memaddr>\n"#endif #ifdef CONFIG_UPROBE_EVENTS - " place (uprobe): <path>:<offset>[(ref_ctr_offset)]\n" + " place (uprobe): <path>:<offset>[%return][(ref_ctr_offset)]\n"#endif "\t args: <name>=fetcharg[:type]\n" "\t fetcharg: %<register>, @<address>, @<symbol>[+|-<offset>],\n"
kernel/trace/trace_uprobe.c +14 -1
@@ -528,7 +528,7 @@ static int register_trace_uprobe(struct trace_uprobe *tu)/* * Argument syntax: -* - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS] +* - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET[%return][(REF)] [FETCHARGS] */ static int trace_uprobe_create (int argc,const char **argv) {
@@ -617,6 +617,19 @@ static int trace_uprobe_create(int argc, const char **argv) } } +/* Check if there is %return suffix */ + tmp =strchr (arg,'%' ); +if (tmp) { +if (!strcmp (tmp,"%return" )) { + *tmp ='\0' ; + is_return = true; + }else { +trace_probe_log_err (tmp - filename,BAD_ADDR_SUFFIX ); + ret = -EINVAL ; + goto fail_address_parse; + } + } +/* Parse uprobe offset. */ ret =kstrtoul (arg,0 , &offset);if (ret) {
Masami Hiramatsu
maintainerPATCH v3 8/8 selftests/ftrace: Add %return suffix tests
In reply to Masami HiramatsuAdd kprobe %return suffix testcase and syntax error tests for %return suffix.
--- .../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 ++++++ 3 files changed, 33 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_return_suffix.tc
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc +6 -0
@@ -97,4 +97,10 @@ check_error 'p:kprobes/testevent _do_fork ^abcd=\"foo"' # DIFF_ARG_TYPE check_error '^p:kprobes/testevent _do_fork abcd=\1' # SAME_PROBE fi +# %return suffix errors +if grep -q "place (kretprobe): .*%return.*" README; then +check_error 'p vfs_read^%hoge' # BAD_ADDR_SUFFIX +check_error 'p ^vfs_read+10%return' # BAD_RETPROBE +fi + exit 0
tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_return_suffix.tc new file +21 -0
@@ -0,0 +1,21 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Kretprobe %%return suffix test +# requires: kprobe_events '<symbol>[+<offset>]%return':README + +# Test for kretprobe by "r" +echo 'r:myprobeaccept vfs_read' > kprobe_events +RESULT1=`cat kprobe_events` + +# Test for kretprobe by "%return" +echo 'p:myprobeaccept vfs_read%return' > kprobe_events +RESULT2=`cat kprobe_events` + +if [ "$RESULT1" != "$RESULT2" ]; then + echo "Error: %return suffix didn't make a return probe." + echo "r-command: $RESULT1" + echo "%return: $RESULT2" + exit_fail +fi + +echo > kprobe_events
tools/testing/selftests/ftrace/test.d/kprobe/uprobe_syntax_errors.tc +6 -0
@@ -17,4 +17,10 @@ check_error 'p /bin/sh:10(10)^a' # BAD_REFCNT_SUFFIX check_error 'p /bin/sh:10 ^@+ab' # BAD_FILE_OFFS check_error 'p /bin/sh:10 ^@symbol' # SYM_ON_UPROBE +# %return suffix error +if grep -q "place (uprobe): .*%return.*" README; then +check_error 'p /bin/sh:10^%hoge' # BAD_ADDR_SUFFIX +check_error 'p /bin/sh:10(10)^%return' # BAD_REFCNT_SUFFIX +fi + exit 0
Masami Hiramatsu
maintainerPATCH v3 7/8 Documentation: tracing: boot: Add an example of tracing function-calls
In reply to Masami HiramatsuAdd an example of tracing function calls on a specific function.
--- Documentation/trace/boottime-trace.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
Documentation/trace/boottime-trace.rst +20 -0
@@ -168,6 +168,26 @@ is for tracing functions starting with "user\_", and others tracing The instance node also accepts event nodes so that each instance can customize its event tracing. +With the trigger action and kprobes, you can trace function-graph while +a function is called. For example, this will trace all function calls in +the pci_proc_init():: + + ftrace { + tracing_on = 0 + tracer = function_graph + event.kprobes { + start_event { + probes = "pci_proc_init" + actions = "traceon" + } + end_event { + probes = "pci_proc_init%return" + actions = "traceoff" + } + } + } + + This boot-time tracing also supports ftrace kernel parameters via boot config. For example, following kernel parameters::
Masami Hiramatsu
maintainerPATCH v3 2/8 tracing/boot: Add per-instance tracing_on option support
In reply to Masami HiramatsuAdd per-instance tracing_on option, which will be useful with traceon/traceoff event trigger actions. For example, if we disable tracing_on by default and set traceon and traceoff on a pair of events, we can trace functions between the pair of events.
--- kernel/trace/trace_boot.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
kernel/trace/trace_boot.c +10 -0
@@ -40,6 +40,16 @@ trace_boot_set_instance_options(struct trace_array *tr, struct xbc_node *node)pr_err ("Failed to set option: %s\n" , buf); } + p =xbc_node_find_value (node,"tracing_on" ,NULL ); +if (p && *p !='\0' ) { +if (kstrtoul (p,10 , &v)) +pr_err ("Failed to set tracing on: %s\n" , p); +if (v) +tracer_tracing_on (tr); +else +tracer_tracing_off (tr); + } + p =xbc_node_find_value (node,"trace_clock" ,NULL );if (p && *p !='\0' ) {if (tracing_set_clock (tr, p) <0 )
RE: [PATCH v3 3/8] Documentation: tracing: Add tracing_on option to boot-time tracer
In reply to Masami HiramatsuQuoted 17 lines
-----Original Message-----
From: Masami HiramatsuAdd
tracing_onoption description to the boot-time tracer.Signed-off-by Masami Hiramatsu <[email protected]>--- Documentation/trace/boottime-trace.rst | 4 ++++ 1 file changed, 4 insertions(+)Documentation/trace/boottime-trace.rst +0
-0
Documentation/trace/boottime-trace.rst These options can be used for each instance including global ftrace node. · line 65
Quoted 5 lines
Documentation/trace/boottime-trace.rst +2
-0@@ -61,6 +61,10 @@ These options can be used for each instance including global ftrace node. ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]] Enable given ftrace options. +ftrace.[instance.INSTANCE.]tracing_on = 0|1 + Enable/Disable tracing on this instance when boot.
when boot. -> when booting.
(or when boot. -> on boot.)
-- Tim
Quoted 5 lines
Documentation/trace/boottime-trace.rst +2
-0+ (you can enable it by the "traceon" event trigger action) + ftrace.[instance.INSTANCE.]trace_clock = CLOCK Set given CLOCK to ftrace's trace_clock.
Masami Hiramatsu
maintainerRe: [PATCH v3 3/8] Documentation: tracing: Add tracing_on option to boot-time tracer
Hi Tim,
Quoted 20 lines · Tim
Quoted 20 lines
-----Original Message-----
From: Masami HiramatsuAdd
tracing_onoption description to the boot-time tracer.Signed-off-by Masami Hiramatsu <[email protected]>--- Documentation/trace/boottime-trace.rst | 4 ++++ 1 file changed, 4 insertions(+)Documentation/trace/boottime-trace.rst +0
-0@@ -61,6 +61,10 @@ These options can be used for each instance including global ftrace node. ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]] Enable given ftrace options.
Quoted 5 lines
Documentation/trace/boottime-trace.rst These options can be used for each instance including global ftrace node. · line 65
Quoted 2 lines
Documentation/trace/boottime-trace.rst +2
-0+ftrace.[instance.INSTANCE.]tracing_on = 0|1 + Enable/Disable tracing on this instance when boot.when boot. -> when booting.
(or when boot. -> on boot.)
Thanks! "when booting" or maybe "when starting boot-time tracing" will be more accurate, since if user sets the "ftrace=function" in the kernel command line, it will start tracing function calls until the boot-time tracing stops it by this option.
Thank you,
Quoted 8 lines
-- Tim
Quoted 5 lines
Documentation/trace/boottime-trace.rst +2
-0+ (you can enable it by the "traceon" event trigger action) + ftrace.[instance.INSTANCE.]trace_clock = CLOCK Set given CLOCK to ftrace's trace_clock.
Signature · 1 line
Masami Hiramatsu <[email protected]>
Steven Rostedt
maintainerQuoted 32 lines · On Thu, 10 Sep 2020 17:54:54 +0900 Masami Hiramatsu <[email protected]> wrote:
Hi,
Here is the 3rd version of the series to improve the boot-time tracing to support kretprobe and
tracing_onoption. 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 eventdocument([6/8]).The combination of
tracing_onand kretprobe allows us to trace events while a specific function call period. For example, the below bootconfig will make a function callgraph in thepci_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" } } }
Quoted 2 lines
Here is the example output;
[..]
Hi Masami,
This looks really great! I just got back from a 10 day holiday, and I'm drowning in "catch-up". I plan on looking at all this relatively soon (in a week or two?). I just don't want you to think I'm ignoring this.
-- Steve
Masami Hiramatsu
maintainerPATCH v3 3/8 Documentation: tracing: Add tracing_on option to boot-time tracer
In reply to Masami HiramatsuAdd tracing_on option description to the boot-time tracer.
---
Changes in v3.1:
- Fix "on boot" to "on starting boot-time tracing".
--- Documentation/trace/boottime-trace.rst | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/trace/boottime-trace.rst +4 -0
@@ -61,6 +61,10 @@ These options can be used for each instance including global ftrace node. ftrace.[instance.INSTANCE.]options = OPT1[, OPT2[...]] Enable given ftrace options. +ftrace.[instance.INSTANCE.]tracing_on = 0|1 + Enable/Disable tracing on this instance when starting boot-time tracing. + (you can enable it by the "traceon" event trigger action) + ftrace.[instance.INSTANCE.]trace_clock = CLOCK Set given CLOCK to ftrace's trace_clock.
Masami Hiramatsu
maintainerQuoted 38 lines · On Thu, 10 Sep 2020 19:34:33 -0400 Steven Rostedt <[email protected]> wrote:
Quoted 32 lines · On Thu, 10 Sep 2020 17:54:54 +0900 Masami Hiramatsu <[email protected]> wrote:
Hi,
Here is the 3rd version of the series to improve the boot-time tracing to support kretprobe and
tracing_onoption. 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 eventdocument([6/8]).The combination of
tracing_onand kretprobe allows us to trace events while a specific function call period. For example, the below bootconfig will make a function callgraph in thepci_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" } } }Quoted 2 lines
Here is the example output;
Quoted 7 lines
[..]
Hi Masami,
This looks really great! I just got back from a 10 day holiday, and I'm drowning in "catch-up". I plan on looking at all this relatively soon (in a week or two?). I just don't want you to think I'm ignoring this.
Hi Steve,
Thanks, I hope you enjoyed the holiday!
BTW, this series includes some document update and testcases. Since we can not decouple these updates, I think it is better you to pull the series.
Regards,
Signature · 1 line
Masami Hiramatsu <[email protected]>
Quoted 49 lines · Masami Hiramatsu
Quoted 38 lines · On Thu, 10 Sep 2020 19:34:33 -0400 Steven Rostedt <[email protected]> wrote:
Quoted 32 lines · On Thu, 10 Sep 2020 17:54:54 +0900 Masami Hiramatsu <[email protected]> wrote:
Hi,
Here is the 3rd version of the series to improve the boot-time tracing to support kretprobe and
tracing_onoption. 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 eventdocument([6/8]).The combination of
tracing_onand kretprobe allows us to trace events while a specific function call period. For example, the below bootconfig will make a function callgraph in thepci_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" } } }Quoted 2 lines
Here is the example output;
Quoted 7 lines
[..]
Hi Masami,
This looks really great! I just got back from a 10 day holiday, and I'm drowning in "catch-up". I plan on looking at all this relatively soon (in a week or two?). I just don't want you to think I'm ignoring this.
Quoted 7 lines
Hi Steve,
Thanks, I hope you enjoyed the holiday!
BTW, this series includes some document update and testcases. Since we can not decouple these updates, I think it is better you to pull the series.
Hi Steve and Masami,
selftests patch 8/8 in this series looks good to me. My ack for it to go through Steve's ftrace tree
thanks,
-- Shuah