[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191015130536.3b1f5bf6@gandalf.local.home>
Date: Tue, 15 Oct 2019 13:05:36 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Divya Indi <divya.indi@...cle.com>
Cc: linux-kernel@...r.kernel.org, Joe Jin <joe.jin@...cle.com>,
Srinivas Eeda <srinivas.eeda@...cle.com>,
Aruna Ramakrishna <aruna.ramakrishna@...cle.com>,
Manjunath Patil <manjunath.b.patil@...cle.com>
Subject: Re: [PATCH] tracing: Sample module to demonstrate kernel access to
Ftrace instances.
On Fri, 20 Sep 2019 16:59:26 -0700
Divya Indi <divya.indi@...cle.com> wrote:
> This is a sample module to demostrate the use of the newly introduced and
> exported APIs to access Ftrace instances from within the kernel.
>
> Newly introduced APIs used here -
>
> 1. Create a new trace array if it does not exist.
> struct trace_array *trace_array_create(const char *name)
>
> 2. Destroy/Remove a trace array.
> int trace_array_destroy(struct trace_array *tr)
>
> 3. Lookup a trace array, given its name.
> struct trace_array *trace_array_lookup(const char *name)
>
> 4. Enable/Disable trace events:
> int trace_array_set_clr_event(struct trace_array *tr, const char *system,
> const char *event, int set);
>
> Exported APIs -
> 1. trace_printk equivalent for instances.
> int trace_array_printk(struct trace_array *tr,
> unsigned long ip, const char *fmt, ...);
>
> 2. Helper function.
> void trace_printk_init_buffers(void);
>
> 3. To decrement the reference counter.
> void trace_array_put(struct trace_array *tr)
>
> Signed-off-by: Divya Indi <divya.indi@...cle.com>
> Reviewed-by: Manjunath Patil <manjunath.b.patil@...cle.com>
> Reviewed-by: Joe Jin <joe.jin@...cle.com>
> ---
> samples/Kconfig | 7 ++
> samples/Makefile | 1 +
> samples/ftrace_instance/Makefile | 6 ++
> samples/ftrace_instance/sample-trace-array.c | 134 +++++++++++++++++++++++++++
> samples/ftrace_instance/sample-trace-array.h | 84 +++++++++++++++++
> 5 files changed, 232 insertions(+)
> create mode 100644 samples/ftrace_instance/Makefile
> create mode 100644 samples/ftrace_instance/sample-trace-array.c
> create mode 100644 samples/ftrace_instance/sample-trace-array.h
>
I applied this patch but get this:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘mytimer_handler’:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:35:2: error: implicit declaration of function ‘trace_array_set_clr_event’; did you mean ‘trace_set_clr_event’? [-Werror=implicit-function-declaration]
trace_array_set_clr_event(tr, "sample-subsystem", "sample_event", 0);
^~~~~~~~~~~~~~~~~~~~~~~~~
trace_set_clr_event
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘simple_thread_func’:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:47:2: error: implicit declaration of function ‘trace_array_printk’; did you mean ‘trace_seq_printf’? [-Werror=implicit-function-declaration]
trace_array_printk(tr, _THIS_IP_, "trace_array_printk: count=%d\n",
^~~~~~~~~~~~~~~~~~
trace_seq_printf
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘simple_thread’:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:85:2: error: implicit declaration of function ‘trace_array_put’; did you mean ‘trace_seq_putc’? [-Werror=implicit-function-declaration]
trace_array_put(tr);
^~~~~~~~~~~~~~~
trace_seq_putc
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘sample_trace_array_init’:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:100:7: error: implicit declaration of function ‘trace_array_lookup’; did you mean ‘radix_tree_lookup’? [-Werror=implicit-function-declaration]
tr = trace_array_lookup("sample-instance");
^~~~~~~~~~~~~~~~~~
radix_tree_lookup
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:100:5: warning: assignment to ‘struct trace_array *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
tr = trace_array_lookup("sample-instance");
^
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:102:8: error: implicit declaration of function ‘trace_array_create’; did you mean ‘ftrace_force_update’? [-Werror=implicit-function-declaration]
tr = trace_array_create("sample-instance");
^~~~~~~~~~~~~~~~~~
ftrace_force_update
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:102:6: warning: assignment to ‘struct trace_array *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
tr = trace_array_create("sample-instance");
^
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:110:2: error: implicit declaration of function ‘trace_printk_init_buffers’; did you mean ‘trace_event_get_offsets’? [-Werror=implicit-function-declaration]
trace_printk_init_buffers();
^~~~~~~~~~~~~~~~~~~~~~~~~
trace_event_get_offsets
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c: In function ‘sample_trace_array_exit’:
/work/git/linux-trace.git/samples/ftrace_instance/sample-trace-array.c:126:2: error: implicit declaration of function ‘trace_array_destroy’; did you mean ‘assoc_array_destroy’? [-Werror=implicit-function-declaration]
trace_array_destroy(tr);
^~~~~~~~~~~~~~~~~~~
assoc_array_destroy
cc1: some warnings being treated as errors
make[3]: *** [/work/git/linux-trace.git/scripts/Makefile.build:266: samples/ftrace_instance/sample-trace-array.o] Error 1
make[2]: *** [/work/git/linux-trace.git/scripts/Makefile.build:509: samples/ftrace_instance] Error 2
make[1]: *** [/work/git/linux-trace.git/Makefile:1650: samples] Error 2
make[1]: *** Waiting for unfinished jobs....
-- Steve
Powered by blists - more mailing lists