How to recheck 'maxactive' ?
Hi,
After setting 'maxactive' for kretprobe, how can I recheck the value of 'maxactive' ? For example, in order to distinguish the difference between two kretprobe events (kmem_cache_alloc_node and kmem_cache_alloc_node10)
$ cd /sys/kernel/debug/tracing $ echo 'r:kmem_cache_alloc_node kmem_cache_alloc_node' >> kprobe_events $ echo 'r10:kmem_cache_alloc_node10 kmem_cache_alloc_node' >> kprobe_events
$ cat kprobe_events r:kprobes/kmem_cache_alloc_node kmem_cache_alloc_node r:kprobes/kmem_cache_alloc_node10 kmem_cache_alloc_node
Thanks,
Taeung
Masami Hiramatsu
maintainerHi Taeung,
Quoted 8 lines · On Sun, 22 Mar 2020 23:06:20 +0900 Taeung Song <[email protected]> wrote:
Hi,
After setting 'maxactive' for kretprobe, how can I recheck the value of 'maxactive' ? For example, in order to distinguish the difference between two kretprobe events (
kmem_cache_alloc_nodeandkmem_cache_alloc_node10)
Quoted 8 lines
$ cd /sys/kernel/debug/tracing $ echo 'r:kmem_cache_alloc_node kmem_cache_alloc_node' >> kprobe_events $ echo 'r10:kmem_cache_alloc_node10 kmem_cache_alloc_node' >> kprobe_events$ cat kprobe_events r:kprobes/kmem_cache_alloc_node kmem_cache_alloc_node r:kprobes/kmem_cache_alloc_node10 kmem_cache_alloc_node
Oops! good catch. That must be a bug, since the kprobe_events design policy is to support following operation.
$ cat kprobe_events > /etc/event_setting (reboot) $ cat /etc/event_setting > kprobe_events
What about below patch?
From 935ed56819f2bfb7ac977f5c63273c9a6e3dfb42 Mon Sep 17 00:00:00 2001
From: Masami Hiramatsu <[email protected]>
Date: Mon, 23 Mar 2020 10:57:48 +0900
Subject: [PATCH] ftrace/kprobe: Show the maxactive number on kprobe_events
Show maxactive parameter on kprobe_events. This allows user to save the current configuration and restore it without losing maxactive parameter.
--- kernel/trace/trace_kprobe.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/trace_kprobe.c +2 -0
@@ -1078,6 +1078,8 @@ static int trace_kprobe_show(struct seq_file *m, struct dyn_event *ev)int i;seq_putc (m,trace_kprobe_is_return (tk) ?'r' :'p' ); +if (trace_kprobe_is_return (tk) && tk->rp.maxactive) +seq_printf (m,"%d" , tk->rp.maxactive);seq_printf (m,":%s/%s" ,trace_probe_group_name (&tk->tp),trace_probe_name (&tk->tp));
Signature · 8 lines
2.20.1 Thank you, -- Masami Hiramatsu <[email protected]>
Hi Masami,
Thank you for the reply!
And your patch looks great.
Thanks,
Taeung
Quoted 59 lines · Masami Hiramatsu
Hi Taeung,
Quoted 8 lines · On Sun, 22 Mar 2020 23:06:20 +0900 Taeung Song <[email protected]> wrote:
Hi,
After setting 'maxactive' for kretprobe, how can I recheck the value of 'maxactive' ? For example, in order to distinguish the difference between two kretprobe events (
kmem_cache_alloc_nodeandkmem_cache_alloc_node10)Quoted 8 lines
$ cd /sys/kernel/debug/tracing $ echo 'r:kmem_cache_alloc_node kmem_cache_alloc_node' >> kprobe_events $ echo 'r10:kmem_cache_alloc_node10 kmem_cache_alloc_node' >> kprobe_events$ cat kprobe_events r:kprobes/kmem_cache_alloc_node kmem_cache_alloc_node r:kprobes/kmem_cache_alloc_node10 kmem_cache_alloc_nodeOops! good catch. That must be a bug, since the
kprobe_eventsdesign policy is to support following operation.$ cat kprobe_events > /etc/event_setting (reboot) $ cat /etc/event_setting > kprobe_eventsWhat about below patch?
From
935ed56819f2bfb7ac977f5c63273c9a6e3dfb42Mon Sep 17 00:00:00 2001
From: Masami Hiramatsu <[email protected]>
Date: Mon, 23 Mar 2020 10:57:48 +0900
Subject: [PATCH] ftrace/kprobe: Show the maxactive number onkprobe_eventsShow maxactive parameter on
kprobe_events. This allows user to save the current configuration and restore it without losing maxactive parameter.Signed-off-by Masami Hiramatsu <[email protected]>--- kernel/trace/trace_kprobe.c | 2 ++ 1 file changed, 2 insertions(+)kernel/trace/trace_kprobe.c +2
-0@@ -1078,6 +1078,8 @@ static int trace_kprobe_show(struct seq_file *m, struct dyn_event *ev)int i;seq_putc (m,trace_kprobe_is_return (tk) ?'r' :'p' ); +if (trace_kprobe_is_return (tk) && tk->rp.maxactive) +seq_printf (m,"%d" , tk->rp.maxactive);seq_printf (m,":%s/%s" ,trace_probe_group_name (&tk->tp),trace_probe_name (&tk->tp));
Steven Rostedt
maintainerQuoted 31 lines · On Mon, 23 Mar 2020 15:47:41 +0900 Masami Hiramatsu <[email protected]> wrote:
Hi Taeung,
Quoted 8 lines · On Sun, 22 Mar 2020 23:06:20 +0900 Taeung Song <[email protected]> wrote:
Hi,
After setting 'maxactive' for kretprobe, how can I recheck the value of 'maxactive' ? For example, in order to distinguish the difference between two kretprobe events (
kmem_cache_alloc_nodeandkmem_cache_alloc_node10)Quoted 8 lines
$ cd /sys/kernel/debug/tracing $ echo 'r:kmem_cache_alloc_node kmem_cache_alloc_node' >> kprobe_events $ echo 'r10:kmem_cache_alloc_node10 kmem_cache_alloc_node' >> kprobe_events$ cat kprobe_events r:kprobes/kmem_cache_alloc_node kmem_cache_alloc_node r:kprobes/kmem_cache_alloc_node10 kmem_cache_alloc_nodeOops! good catch. That must be a bug, since the
kprobe_eventsdesign policy is to support following operation.$ cat kprobe_events > /etc/event_setting (reboot) $ cat /etc/event_setting > kprobe_eventsWhat about below patch?
Quoted 9 lines
Quoted 1 line
From
935ed56819f2bfb7ac977f5c63273c9a6e3dfb42Mon Sep 17 00:00:00 2001From: Masami Hiramatsu <[email protected]>
Date: Mon, 23 Mar 2020 10:57:48 +0900
Subject: [PATCH] ftrace/kprobe: Show the maxactive number onkprobe_eventsShow maxactive parameter on
kprobe_events. This allows user to save the current configuration and restore it without losing maxactive parameter.
Hi Masami,
Can you resend this patch as a stand alone (so that it shows up as a patch on the mailing lists).
Thanks!
-- Steve
Quoted 18 lines
Signed-off-by Masami Hiramatsu <[email protected]>--- kernel/trace/trace_kprobe.c | 2 ++ 1 file changed, 2 insertions(+)kernel/trace/trace_kprobe.c +2
-0@@ -1078,6 +1078,8 @@ static int trace_kprobe_show(struct seq_file *m, struct dyn_event *ev)int i;seq_putc (m,trace_kprobe_is_return (tk) ?'r' :'p' ); +if (trace_kprobe_is_return (tk) && tk->rp.maxactive) +seq_printf (m,"%d" , tk->rp.maxactive);seq_printf (m,":%s/%s" ,trace_probe_group_name (&tk->tp),trace_probe_name (&tk->tp));
Masami Hiramatsu
maintainerQuoted 44 lines · On Mon, 23 Mar 2020 09:04:01 -0400 Steven Rostedt <[email protected]> wrote:
Quoted 31 lines · On Mon, 23 Mar 2020 15:47:41 +0900 Masami Hiramatsu <[email protected]> wrote:
Hi Taeung,
Quoted 8 lines · On Sun, 22 Mar 2020 23:06:20 +0900 Taeung Song <[email protected]> wrote:
Hi,
After setting 'maxactive' for kretprobe, how can I recheck the value of 'maxactive' ? For example, in order to distinguish the difference between two kretprobe events (
kmem_cache_alloc_nodeandkmem_cache_alloc_node10)Quoted 8 lines
$ cd /sys/kernel/debug/tracing $ echo 'r:kmem_cache_alloc_node kmem_cache_alloc_node' >> kprobe_events $ echo 'r10:kmem_cache_alloc_node10 kmem_cache_alloc_node' >> kprobe_events$ cat kprobe_events r:kprobes/kmem_cache_alloc_node kmem_cache_alloc_node r:kprobes/kmem_cache_alloc_node10 kmem_cache_alloc_nodeOops! good catch. That must be a bug, since the
kprobe_eventsdesign policy is to support following operation.$ cat kprobe_events > /etc/event_setting (reboot) $ cat /etc/event_setting > kprobe_eventsWhat about below patch?
Quoted 9 lines
Quoted 1 line
From
935ed56819f2bfb7ac977f5c63273c9a6e3dfb42Mon Sep 17 00:00:00 2001From: Masami Hiramatsu <[email protected]>
Date: Mon, 23 Mar 2020 10:57:48 +0900
Subject: [PATCH] ftrace/kprobe: Show the maxactive number onkprobe_eventsShow maxactive parameter on
kprobe_events. This allows user to save the current configuration and restore it without losing maxactive parameter.
Quoted 4 lines
Hi Masami,
Can you resend this patch as a stand alone (so that it shows up as a patch on the mailing lists).
Yes I'll do.
Thank you!
Quoted 25 lines
Thanks!
-- Steve
Quoted 18 lines
Signed-off-by Masami Hiramatsu <[email protected]>--- kernel/trace/trace_kprobe.c | 2 ++ 1 file changed, 2 insertions(+)kernel/trace/trace_kprobe.c +2
-0@@ -1078,6 +1078,8 @@ static int trace_kprobe_show(struct seq_file *m, struct dyn_event *ev)int i;seq_putc (m,trace_kprobe_is_return (tk) ?'r' :'p' ); +if (trace_kprobe_is_return (tk) && tk->rp.maxactive) +seq_printf (m,"%d" , tk->rp.maxactive);seq_printf (m,":%s/%s" ,trace_probe_group_name (&tk->tp),trace_probe_name (&tk->tp));
Signature · 1 line
Masami Hiramatsu <[email protected]>