]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf tools: Initialize perf_data_file fd field
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Aug 2018 20:16:48 +0000 (16:16 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Sep 2018 13:25:13 +0000 (10:25 -0300)
Building the perf CTF converter fails with gcc 4.8.4 on Ubuntu 14.04
with the following error:

  error: missing initializer for field ‘fd’ of ‘struct perf_data_file’
  [-Werror=missing-field-initializers]

Per 4b838b0db4e9 ("perf tools: Add compression id into 'struct
kmod_path'") and the ensuing discussion on the mailing list, it appears
that this affects other distributions and gcc versions.

Signed-off-by: Jeremie Galarneau <jeremie.galarneau@efficios.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180829201648.19588-1-jeremie.galarneau@efficios.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data-convert-bt.c

index abd38abf1d918ab81b360ed9691831eaac162161..f75d4aa612c5384d27993fe9e054766ba630aa96 100644 (file)
@@ -1578,7 +1578,7 @@ int bt_convert__perf2ctf(const char *input, const char *path,
 {
        struct perf_session *session;
        struct perf_data data = {
-               .file.path = input,
+               .file      = { .path = input, .fd = -1 },
                .mode      = PERF_DATA_MODE_READ,
                .force     = opts->force,
        };