lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: Decrement trace_array when bootconfig creates an instance
On Sat, 25 Jan 2020 11:23:00 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> On Fri, 24 Jan 2020 20:59:27 -0500
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> >
> > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> >
> > The trace_array_get_by_name() creates a ftrace instance and
> > trace_array_put() is used to remove the reference. Even though the
> > trace_array_get_by_name() creates the instance, it also adds a reference
> > count to it, that prevents user space from removing it.
> >
> > As the bootconfig just creates the instance on boot up, it should still be
> > used where it can be deleted by user space after boot. A trace_array_put()
> > is required to let that happen. Otherwise, the created instance can not
> > be removed.
> >
> > Also, change the documentation on trace_array_get_by_name() to make this not
> > be so confusing.
>
> Good catch! I misunderstood trace_array_put() would remove the instance.

I figured as much, which is why I included the documentation update.

>
> Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

-- Steve


\
 
 \ /
  Last update: 2020-01-25 03:26    [W:0.441 / U:1.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site