Skip to contentSkip to conversation

perf tools: Initialize perf_data_file fd field

PATCH In review Jérémie Galarneau 4 participants 5 messages Aug 29, 2018 – Sep 25, 2018 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: Initialize perf_data_file fd field

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 4b838b0d and the ensuing discussion on the mailing list, it appears that this affects other distributions and gcc versions.

Cc Jiri Olsa <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Alexander Shishkin <[email protected]>
---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -1
index abd38abf1d91..f75d4aa612c5 100644
@@ -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,
 	};
Signature · 1 line
2.18.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jérémie Galarneau

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 4b838b0d and the ensuing discussion on the mailing list, it appears that this affects other distributions and gcc versions.

thanks,
jirka

Quoted 25 lines
Cc Jiri Olsa <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Alexander Shishkin <[email protected]>
---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -1
index abd38abf1d91..f75d4aa612c5 100644
@@ -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,
 	};
Signature · 1 line
2.18.0
#2 lore raw

Hi Arnaldo,

Anything I can do to help you with this patch?

Thanks,
Jérémie

Quoted 43 lines · Jiri Olsa
Quoted 11 lines · Jérémie Galarneau

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 4b838b0d and the ensuing discussion on the mailing list, it appears that this affects other distributions and gcc versions.

thanks,
jirka

Quoted 25 lines
Cc Jiri Olsa <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Alexander Shishkin <[email protected]>
---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -2
index abd38abf1d91..f75d4aa612c5 100644
@@ -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,
      };
--

2.18.0

Signature · 3 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
#3 lore raw

Em Tue, Sep 18, 2018 at 02:07:41PM -0400, Jérémie Galarneau escreveu:

Quoted 3 lines

Hi Arnaldo,

Anything I can do to help you with this patch?

Thanks for the reminder, will apply.

- Arnaldo

Quoted 54 lines

Thanks,
Jérémie

Quoted 43 lines · Jiri Olsa
Quoted 11 lines · Jérémie Galarneau

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 4b838b0d and the ensuing discussion on the mailing list, it appears that this affects other distributions and gcc versions.

thanks,
jirka

Quoted 25 lines
Cc Jiri Olsa <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Alexander Shishkin <[email protected]>
---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -2
index abd38abf1d91..f75d4aa612c5 100644
@@ -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,
      };
--

2.18.0

Signature · 3 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
#4 lore raw
In reply to Jérémie Galarneau
perf tools: Initialize perf_data_file fd field
Commit-ID:  c04c859f439fb4de9039246370d60a07b9b5bcb5
Gitweb:     https://git.kernel.org/tip/c04c859f439fb4de9039246370d60a07b9b5bcb5
Author:     Jérémie Galarneau <[email protected]>
AuthorDate: Wed, 29 Aug 2018 16:16:48 -0400
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 19 Sep 2018 10:25:13 -0300

perf tools: Initialize perf_data_file fd field

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.

---
 tools/perf/util/data-convert-bt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/data-convert-bt.c +1 -1
index abd38abf1d91..f75d4aa612c5 100644
@@ -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,
 	};