public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>, Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org, leo.yan@linaro.org,
	David Miller <davem@davemloft.net>,
	Mathieu Poirier <mathieu.poirier@linaro.org>
Subject: Re: [PATCH V2 1/3] perf tools: Add fallback functions for cases where cpumode is insufficient
Date: Tue, 27 Nov 2018 11:45:44 -0300	[thread overview]
Message-ID: <20181127144544.GG15747@kernel.org> (raw)
In-Reply-To: <20181127141036.GF15747@kernel.org>

Em Tue, Nov 27, 2018 at 11:10:36AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Tue, Nov 06, 2018 at 11:07:10PM +0200, Adrian Hunter escreveu:
> > For branch stacks or branch samples, the sample cpumode might not be
> > correct because it applies only to the sample 'ip' and not necessary to
> > 'addr' or branch stack addresses. Add fallback functions that can be used
> > to deal with those cases
> 
> I've split this into two, and the first is causing this:
> 
> root@quaco ~]# perf top
> perf: Segmentation fault
> -------- backtrace --------
> perf[0x59baca]
> /lib64/libc.so.6(+0x385bf)[0x7fa2775dc5bf]
> perf(perf_env__arch+0x34)[0x4b4514]
> perf(perf_env__single_address_space+0x1b)[0x57944b]
> perf(perf_session__new+0x17c)[0x4fdb3c]
> perf(cmd_top+0x162c)[0x45109c]
> perf[0x4a621e]
> perf(main+0x61c)[0x42cbfc]
> /lib64/libc.so.6(__libc_start_main+0xf2)[0x7fa2775c8412]
> perf(_start+0x2d)[0x42ce2d]
> [root@quaco ~]#
> 
> Its the case where the env info comes from the running machine, via
> uname(), I'm working on a fix.

So I'll graft this just before your patch.

- Arnaldo

diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 59f38c7693f8..4c23779e271a 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -166,7 +166,7 @@ const char *perf_env__arch(struct perf_env *env)
 	struct utsname uts;
 	char *arch_name;
 
-	if (!env) { /* Assume local operation */
+	if (!env || !env->arch) { /* Assume local operation */
 		if (uname(&uts) < 0)
 			return NULL;
 		arch_name = uts.machine;

  reply	other threads:[~2018-11-27 14:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 21:07 [PATCH V2 0/3] perf tools: Fix for cases where cpumode is incorrect or insufficient Adrian Hunter
2018-11-06 21:07 ` [PATCH V2 1/3] perf tools: Add fallback functions for cases where cpumode is insufficient Adrian Hunter
2018-11-06 22:03   ` David Miller
2018-11-27 14:10   ` Arnaldo Carvalho de Melo
2018-11-27 14:45     ` Arnaldo Carvalho de Melo [this message]
2018-12-14 20:21   ` [tip:perf/core] perf machine: Record if a arch has a single user/kernel address space tip-bot for Adrian Hunter
2018-12-14 20:22   ` [tip:perf/core] perf thread: Add fallback functions for cases where cpumode is insufficient tip-bot for Adrian Hunter
2018-12-18 13:48   ` [tip:perf/core] perf machine: Record if a arch has a single user/kernel address space tip-bot for Adrian Hunter
2018-12-18 13:49   ` [tip:perf/core] perf thread: Add fallback functions for cases where cpumode is insufficient tip-bot for Adrian Hunter
2018-11-06 21:07 ` [PATCH V2 2/3] perf tools: Use fallback for sample_addr_correlates_sym() cases Adrian Hunter
2018-12-14 20:22   ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-12-18 13:50   ` tip-bot for Adrian Hunter
2018-11-06 21:07 ` [PATCH V2 3/3] perf tools: Use fallbacks for branch stacks Adrian Hunter
2018-12-14 20:23   ` [tip:perf/core] perf script: " tip-bot for Adrian Hunter
2018-12-18 13:50   ` tip-bot for Adrian Hunter
2018-11-19 13:37 ` [PATCH V2 0/3] perf tools: Fix for cases where cpumode is incorrect or insufficient Adrian Hunter
2018-11-19 15:44   ` Arnaldo Carvalho de Melo

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=20181127144544.GG15747@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox