All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	David Ahern <david.ahern@oracle.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 16/24] perf probe: Fix compiles due to declarations using perf_probe_point
Date: Thu, 12 Mar 2015 18:27:56 -0300	[thread overview]
Message-ID: <1426195684-20046-17-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1426195684-20046-1-git-send-email-acme@kernel.org>

From: David Ahern <david.ahern@oracle.com>

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 e2bf620f98cb..f272a711ad15 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,
-- 
1.9.3


  parent reply	other threads:[~2015-03-12 21:29 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 21:27 [GIT PULL 00/24] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 01/24] perf ordered_events: Untangle from perf_session Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 02/24] perf ordered_events: Shorten function signatures Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 03/24] perf ordered_events: Allow tools to specify a deliver method Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 04/24] perf tools: tool->finished_round() doesn't need perf_session Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 05/24] perf tools: Remove superfluous thread->comm_set setting Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 06/24] perf ordered_events: Adopt queue() method Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 07/24] perf probe: Fix to handle aliased symbols in glibc Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 08/24] perf probe: Fix --line " Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 09/24] Revert "perf probe: Fix to fall back to find probe point in symbols" Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 10/24] perf symbols: Allow symbol alias when loading map for symbol name Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 11/24] perf probe: Allow weak symbols to be probed Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 12/24] perf build: Fix libbabeltrace detection Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 13/24] perf tools: Output feature detection's gcc output to a file Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 14/24] perf probe: Fix possible double free on error Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 15/24] perf hists browser: Fix UI bug after zoom into thread/dso/symbol Arnaldo Carvalho de Melo
2015-03-12 21:27 ` Arnaldo Carvalho de Melo [this message]
2015-03-12 21:27 ` [PATCH 17/24] perf hists browser: Fix UI bug after fold/unfold Arnaldo Carvalho de Melo
2015-03-12 21:27 ` [PATCH 18/24] perf stat: Output running time and run/enabled ratio in CSV mode Arnaldo Carvalho de Melo
2015-03-13  7:34   ` Ingo Molnar
2015-03-13 10:53     ` Arnaldo Carvalho de Melo
2015-03-13 12:31       ` Ingo Molnar
2015-03-12 21:27 ` [PATCH 19/24] perf stat: Fix IPC and other formulas with -A Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 20/24] perf stat: Always correctly indent ratio column Arnaldo Carvalho de Melo
2015-03-13  7:36   ` Ingo Molnar
2015-03-12 21:28 ` [PATCH 21/24] perf kmem: Fix segfault when invalid sort key is given Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 22/24] perf kmem: Allow -v option Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 23/24] perf kmem: Fix alignment of slab result table Arnaldo Carvalho de Melo
2015-03-12 21:28 ` [PATCH 24/24] perf data: Add tracepoint events fields CTF conversion support Arnaldo Carvalho de Melo
2015-03-13 12:34 ` [GIT PULL 00/24] perf/core improvements and fixes Ingo Molnar
2015-03-13 12:45   ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426195684-20046-17-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=david.ahern@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.