Re: [PATCH] building libtraceevent with clang

From: Steven Rostedt
Date: Thu Feb 16 2017 - 21:00:37 EST


On Mon, 13 Feb 2017 14:20:20 -0300
Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:

> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: David Ahern <dsahern@xxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Wang Nan <wangnan0@xxxxxxxxxx>
> Link: http://lkml.kernel.org/n/tip-b5wyjocel55gorl2jq2cbxrr@xxxxxxxxxxxxxx
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> diff --git a/tools/lib/traceevent/plugin_function.c b/tools/lib/traceevent/plugin_function.c
> index a00ec190821a..42dbf73758f3 100644
> --- a/tools/lib/traceevent/plugin_function.c
> +++ b/tools/lib/traceevent/plugin_function.c
> @@ -130,7 +130,7 @@ static int function_handler(struct trace_seq *s, struct pevent_record *record,
> unsigned long long pfunction;
> const char *func;
> const char *parent;
> - int index;
> + int index = 0;

I went to apply this to trace-cmd's version, and it failed to apply.
Then I realized that I had this fixed back in 2015, but missed sending
it. That's because I don't strictly follow the 80 column limit for some
of the if statements (I find the break up ugly), and when doing diffs,
this got lost in the diffs of the 80 column limits ones done with the
port to the kernel tree. :-/

-- Steve


>
> if (pevent_get_field_val(s, event, "ip", record, &function, 1))
> return trace_seq_putc(s, '!');
>