Linux-Trace-Users Archive on lore.kernel.org
 help / color / Atom feed
* How to recheck 'maxactive' ?
@ 2020-03-22 14:06 Taeung Song
  2020-03-23  6:47 ` Masami Hiramatsu
  0 siblings, 1 reply; 5+ messages in thread
From: Taeung Song @ 2020-03-22 14:06 UTC (permalink / raw)
  To: linux-trace-users; +Cc: Masami Hiramatsu, David S. Miller

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

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

* Re: How to recheck 'maxactive' ?
  2020-03-22 14:06 How to recheck 'maxactive' ? Taeung Song
@ 2020-03-23  6:47 ` Masami Hiramatsu
  2020-03-23 12:54   ` Taeung Song
  2020-03-23 13:04   ` Steven Rostedt
  0 siblings, 2 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2020-03-23  6:47 UTC (permalink / raw)
  To: Taeung Song; +Cc: linux-trace-users, Masami Hiramatsu, David S. Miller

Hi Taeung,

On Sun, 22 Mar 2020 23:06:20 +0900
Taeung Song <treeze.taeung@gmail.com> 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_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

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 <mhiramat@kernel.org>
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.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 kernel/trace/trace_kprobe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 362cca52f5de..d0568af4a0ef 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -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));
 
-- 
2.20.1


Thank you,


-- 
Masami Hiramatsu <mhiramat@kernel.org>

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

* Re: How to recheck 'maxactive' ?
  2020-03-23  6:47 ` Masami Hiramatsu
@ 2020-03-23 12:54   ` Taeung Song
  2020-03-23 13:04   ` Steven Rostedt
  1 sibling, 0 replies; 5+ messages in thread
From: Taeung Song @ 2020-03-23 12:54 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: linux-trace-users, David S. Miller

Hi Masami,

Thank you for the reply!
And your patch looks great.

Thanks,
Taeung

On 3/23/20 3:47 PM, Masami Hiramatsu wrote:
> Hi Taeung,
> 
> On Sun, 22 Mar 2020 23:06:20 +0900
> Taeung Song <treeze.taeung@gmail.com> 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_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
> 
> 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 <mhiramat@kernel.org>
> 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.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>   kernel/trace/trace_kprobe.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index 362cca52f5de..d0568af4a0ef 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -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));
>   
> 

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

* Re: How to recheck 'maxactive' ?
  2020-03-23  6:47 ` Masami Hiramatsu
  2020-03-23 12:54   ` Taeung Song
@ 2020-03-23 13:04   ` Steven Rostedt
  2020-03-24  6:40     ` Masami Hiramatsu
  1 sibling, 1 reply; 5+ messages in thread
From: Steven Rostedt @ 2020-03-23 13:04 UTC (permalink / raw)
  To: Masami Hiramatsu; +Cc: Taeung Song, linux-trace-users, David S. Miller

On Mon, 23 Mar 2020 15:47:41 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Hi Taeung,
> 
> On Sun, 22 Mar 2020 23:06:20 +0900
> Taeung Song <treeze.taeung@gmail.com> 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_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  
> 
> 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 <mhiramat@kernel.org>
> 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.
> 

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


> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
>  kernel/trace/trace_kprobe.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index 362cca52f5de..d0568af4a0ef 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -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));
>  


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

* Re: How to recheck 'maxactive' ?
  2020-03-23 13:04   ` Steven Rostedt
@ 2020-03-24  6:40     ` Masami Hiramatsu
  0 siblings, 0 replies; 5+ messages in thread
From: Masami Hiramatsu @ 2020-03-24  6:40 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Taeung Song, linux-trace-users, David S. Miller

On Mon, 23 Mar 2020 09:04:01 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Mon, 23 Mar 2020 15:47:41 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > Hi Taeung,
> > 
> > On Sun, 22 Mar 2020 23:06:20 +0900
> > Taeung Song <treeze.taeung@gmail.com> 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_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  
> > 
> > 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 <mhiramat@kernel.org>
> > 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.
> > 
> 
> 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!

> 
> Thanks!
> 
> -- Steve
> 
> 
> > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> > ---
> >  kernel/trace/trace_kprobe.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> > index 362cca52f5de..d0568af4a0ef 100644
> > --- a/kernel/trace/trace_kprobe.c
> > +++ b/kernel/trace/trace_kprobe.c
> > @@ -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 <mhiramat@kernel.org>

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 14:06 How to recheck 'maxactive' ? Taeung Song
2020-03-23  6:47 ` Masami Hiramatsu
2020-03-23 12:54   ` Taeung Song
2020-03-23 13:04   ` Steven Rostedt
2020-03-24  6:40     ` Masami Hiramatsu

Linux-Trace-Users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-users/0 linux-trace-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-users linux-trace-users/ https://lore.kernel.org/linux-trace-users \
		linux-trace-users@vger.kernel.org
	public-inbox-index linux-trace-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git