All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf probe: Fix compiles due to declarations using perf_probe_point
@ 2015-03-11 14:36 David Ahern
  2015-03-11 14:40 ` Arnaldo Carvalho de Melo
  2015-03-14  7:05 ` [tip:perf/core] " tip-bot for David Ahern
  0 siblings, 2 replies; 3+ messages in thread
From: David Ahern @ 2015-03-11 14:36 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Masami Hiramatsu

perf fails to build with gcc "(GCC) 4.4.7 20120313 (Red Hat 4.4.7-4.0.9)"
(a.k.a., RHEL6 / CentOS 6 / OL 6):

cc1: warnings being treated as errors
util/probe-event.c: In function ‘get_alternative_line_range’:
util/probe-event.c:359: error: missing initializer
util/probe-event.c:359: error: (near initialization for ‘pp.file’)
util/probe-event.c:359: error: missing initializer
util/probe-event.c:359: error: (near initialization for ‘result.function’)

Fix by bringing in initializers to declaration.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
---
 tools/perf/util/probe-event.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8af8e7f55254..a9c115d102c4 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -356,12 +356,14 @@ static int get_alternative_line_range(struct debuginfo *dinfo,
 				      struct line_range *lr,
 				      const char *target, bool user)
 {
-	struct perf_probe_point pp = { 0 }, result = { 0 };
+	struct perf_probe_point pp = { .function = lr->function,
+				       .file = lr->file,
+				       .line = lr->start };
+	struct perf_probe_point result;
 	int ret, len = 0;
 
-	pp.function = lr->function;
-	pp.file = lr->file;
-	pp.line = lr->start;
+	memset(&result, 0, sizeof(result));
+
 	if (lr->end != INT_MAX)
 		len = lr->end - lr->start;
 	ret = find_alternative_probe_point(dinfo, &pp, &result,
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf probe: Fix compiles due to declarations using perf_probe_point
  2015-03-11 14:36 [PATCH] perf probe: Fix compiles due to declarations using perf_probe_point David Ahern
@ 2015-03-11 14:40 ` Arnaldo Carvalho de Melo
  2015-03-14  7:05 ` [tip:perf/core] " tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-03-11 14:40 UTC (permalink / raw)
  To: David Ahern; +Cc: linux-kernel, Masami Hiramatsu

Em Wed, Mar 11, 2015 at 10:36:20AM -0400, David Ahern escreveu:
> perf fails to build with gcc "(GCC) 4.4.7 20120313 (Red Hat 4.4.7-4.0.9)"
> (a.k.a., RHEL6 / CentOS 6 / OL 6):
> 
> cc1: warnings being treated as errors
> util/probe-event.c: In function ‘get_alternative_line_range’:
> util/probe-event.c:359: error: missing initializer
> util/probe-event.c:359: error: (near initialization for ‘pp.file’)
> util/probe-event.c:359: error: missing initializer
> util/probe-event.c:359: error: (near initialization for ‘result.function’)
> 
> Fix by bringing in initializers to declaration.

Thanks, applied to perf/core.

- Arnaldo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf probe: Fix compiles due to declarations using perf_probe_point
  2015-03-11 14:36 [PATCH] perf probe: Fix compiles due to declarations using perf_probe_point David Ahern
  2015-03-11 14:40 ` Arnaldo Carvalho de Melo
@ 2015-03-14  7:05 ` tip-bot for David Ahern
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for David Ahern @ 2015-03-14  7:05 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: david.ahern, masami.hiramatsu.pt, mingo, hpa, tglx, acme,
	linux-kernel

Commit-ID:  6d4a48968bfb5c67002f253fbaeb5acd41d7897a
Gitweb:     http://git.kernel.org/tip/6d4a48968bfb5c67002f253fbaeb5acd41d7897a
Author:     David Ahern <david.ahern@oracle.com>
AuthorDate: Wed, 11 Mar 2015 10:36:20 -0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 12 Mar 2015 12:40:00 -0300

perf probe: Fix compiles due to declarations using perf_probe_point

perf fails to build with gcc "(GCC) 4.4.7 20120313 (Red Hat
4.4.7-4.0.9)" (a.k.a., RHEL6 / CentOS 6 / OL 6):

  cc1: warnings being treated as errors
  util/probe-event.c: In function ‘get_alternative_line_range’:
  util/probe-event.c:359: error: missing initializer
  util/probe-event.c:359: error: (near initialization for ‘pp.file’)
  util/probe-event.c:359: error: missing initializer
  util/probe-event.c:359: error: (near initialization for ‘result.function’)

Fix by bringing in initializers to declaration.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Link: http://lkml.kernel.org/r/1426084580-60780-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/probe-event.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index e2bf620..f272a71 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -356,12 +356,14 @@ static int get_alternative_line_range(struct debuginfo *dinfo,
 				      struct line_range *lr,
 				      const char *target, bool user)
 {
-	struct perf_probe_point pp = { 0 }, result = { 0 };
+	struct perf_probe_point pp = { .function = lr->function,
+				       .file = lr->file,
+				       .line = lr->start };
+	struct perf_probe_point result;
 	int ret, len = 0;
 
-	pp.function = lr->function;
-	pp.file = lr->file;
-	pp.line = lr->start;
+	memset(&result, 0, sizeof(result));
+
 	if (lr->end != INT_MAX)
 		len = lr->end - lr->start;
 	ret = find_alternative_probe_point(dinfo, &pp, &result,

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-14  7:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-11 14:36 [PATCH] perf probe: Fix compiles due to declarations using perf_probe_point David Ahern
2015-03-11 14:40 ` Arnaldo Carvalho de Melo
2015-03-14  7:05 ` [tip:perf/core] " tip-bot for David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.