lkml.org 
[lkml]   [2019]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: Kernel access to Ftrace instances
Hi,

On Wed, 15 May 2019 18:51:23 -0700
Divya Indi <divya.indi@oracle.com> wrote:

> Hi Masami,
>
> Thanks for pointing it out.
>
> Yes, it should not be static.
>
> On 5/15/19 5:09 PM, Masami Hiramatsu wrote:
> > HI Divya,
> >
> > On Wed, 20 Mar 2019 11:28:51 -0700
> > Divya Indi <divya.indi@oracle.com> wrote:
> >
> >> Ftrace provides the feature “instances” that provides the capability to
> >> create multiple Ftrace ring buffers. However, currently these buffers
> >> are created/accessed via userspace only. The kernel APIs providing these
> >> features are not exported, hence cannot be used by other kernel
> >> components.
> >>
> >> This patch aims to extend this infrastructure to provide the
> >> flexibility to create/log/remove/ enable-disable existing trace events
> >> to these buffers from within the kernel.
> >>
> >> Signed-off-by: Divya Indi <divya.indi@oracle.com>
> >> Reviewed-by: Joe Jin <joe.jin@oracle.com>
> > Would you tested these APIs with your module? Since,
> > [...]
> >> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> >> index 5b3b0c3..81c038e 100644
> >> --- a/kernel/trace/trace_events.c
> >> +++ b/kernel/trace/trace_events.c
> >> @@ -832,6 +832,7 @@ static int ftrace_set_clr_event(struct trace_array *tr, char *buf, int set)
> >>
> >> return ret;
> >> }
> >> +EXPORT_SYMBOL_GPL(ftrace_set_clr_event);
> > I found this exports a static function to module. Did it work?
>
> I had tested the changes with my module. This change to static was added
> in the test patch, but somehow missed it in the final patch that was
> sent out.

If you can send some example module patch under samples/, that is more
helpful for us to check it. And it is possible to use in kselftest too.

>
> Will send a new patch along with a few additional ones to add some NULL
> checks to ensure safe usage by modules and add the APIs to a header file
> that can be used by the modules.

It seems your's already in Steve's ftrace/core branch, so I think you can make
additional patch to fix it. Steve, is that OK?

Thank you,

>
> Thanks,
>
> Divya
>
> >
> > Thank you,
> >


--
Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2019-05-16 05:06    [W:0.067 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site