[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180208101818.GA26290@sejong>
Date: Thu, 8 Feb 2018 19:18:18 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Tom Zanussi <tom.zanussi@...ux.intel.com>,
linux-rt-users@...r.kernel.org, linux-trace-users@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Clark Williams <williams@...hat.com>,
Jiri Olsa <jolsa@...hat.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Jonathan Corbet <corbet@....net>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Alexei Starovoitov <alexei.starovoitov@...il.com>,
kernel-team@....com
Subject: Re: [PATCH 03/18] tracing: Add simple arguments to function based
events
On Fri, Feb 02, 2018 at 06:05:01PM -0500, Steven Rostedt wrote:
> From: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
>
> The function based events can now have arguments passed in. A weak function
> arch_get_func_args() is created so that archs can fill in the arguments
> based on pt_regs. Currently no arch implements this function, so no
> arguments are returned. Passing NULL for pt_regs into this function returns
> the number of supported args that can be processed, and the format will
> only allow the user to add valid args. Which currently are all arguments
> until an arch implements the arg_get_func_args() function.
>
> [ missing 'static' found by Fengguang Wu's kbuild test robot ]
> Signed-off-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
> ---
[SNIP]
> @@ -129,9 +284,14 @@ static void func_event_trace(struct trace_event_file *trace_file,
> struct trace_event_call *call = &func_event->call;
> struct ring_buffer_event *event;
> struct ring_buffer *buffer;
> + struct func_arg *arg;
> + long args[func_event->arg_cnt];
> + long long val = 1;
> unsigned long irq_flags;
> + int nr_args;
> int size;
> int pc;
> + int i = 0;
>
> if (trace_trigger_soft_disabled(trace_file))
> return;
> @@ -139,7 +299,7 @@ static void func_event_trace(struct trace_event_file *trace_file,
> local_save_flags(irq_flags);
> pc = preempt_count();
>
> - size = sizeof(*entry);
> + size = func_event->arg_offset + sizeof(*entry);
>
> event = trace_event_buffer_lock_reserve(&buffer, trace_file,
> call->event.type,
> @@ -150,6 +310,15 @@ static void func_event_trace(struct trace_event_file *trace_file,
> entry = ring_buffer_event_data(event);
> entry->ip = ip;
> entry->parent_ip = parent_ip;
> + nr_args = arch_get_func_args(pt_regs, 0, func_event->arg_cnt, args);
> +
> + list_for_each_entry(arg, &func_event->args, list) {
> + if (i < nr_args)
> + val = args[i];
> + else
> + val = 0;
> + memcpy(&entry->data[arg->offset], &val, arg->size);
> + }
Where is the 'i' increased?
Thanks,
Namhyung
Powered by blists - more mailing lists