aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/scripting-engines/trace-event-python.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-07-12 10:05:26 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-07-12 14:20:39 -0400
commit39f54862a935e14a448cbd68d6a6bef68d026dbe (patch)
tree8fb19441e4c234e9b1f526e4a913c38c8b102d84 /tools/perf/util/scripting-engines/trace-event-python.c
parentcc31078cf13f67c489ad6a5c48dea657f5f88d11 (diff)
perf script python: Silence -Werror=maybe-uninitialized on gcc 5.3.0
Sounds like a compiler bug, but to silence it, initialize those variables to NULL. Noticed on: Target: x86_64-alpine-linux-musl Configured with: /home/buildozer/aports/main/gcc/src/gcc-5.3.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 5.3.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-esp --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib Thread model: posix gcc version 5.3.0 (Alpine 5.3.0) Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-zyvsjvbl45o7hzcuz78wu2xi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index ff134700bf30..6ac6b7a33f42 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -273,7 +273,7 @@ static PyObject *get_field_numeric_entry(struct event_format *event,
273 struct format_field *field, void *data) 273 struct format_field *field, void *data)
274{ 274{
275 bool is_array = field->flags & FIELD_IS_ARRAY; 275 bool is_array = field->flags & FIELD_IS_ARRAY;
276 PyObject *obj, *list = NULL; 276 PyObject *obj = NULL, *list = NULL;
277 unsigned long long val; 277 unsigned long long val;
278 unsigned int item_size, n_items, i; 278 unsigned int item_size, n_items, i;
279 279
@@ -392,7 +392,7 @@ static void python_process_tracepoint(struct perf_sample *sample,
392 struct addr_location *al) 392 struct addr_location *al)
393{ 393{
394 struct event_format *event = evsel->tp_format; 394 struct event_format *event = evsel->tp_format;
395 PyObject *handler, *context, *t, *obj, *callchain; 395 PyObject *handler, *context, *t, *obj = NULL, *callchain;
396 PyObject *dict = NULL; 396 PyObject *dict = NULL;
397 static char handler_name[256]; 397 static char handler_name[256];
398 struct format_field *field; 398 struct format_field *field;