linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Clark Williams <williams@redhat.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Andi Kleen <ak@linux.intel.com>, David Ahern <dsahern@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jiri Olsa <jolsa@redhat.com>, Leo Yan <leo.yan@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Wang Nan <wangnan0@huawei.com>,
	stable@vger.kernel.org
Subject: [PATCH 05/22] perf env: Also consider env->arch == NULL as local operation
Date: Fri, 30 Nov 2018 15:26:35 -0300	[thread overview]
Message-ID: <20181130182652.23620-6-acme@kernel.org> (raw)
In-Reply-To: <20181130182652.23620-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

We'll set a new machine field based on env->arch, which for live mode,
like with 'perf top' means we need to use uname() to figure the name of
the arch, fix perf_env__arch() to consider both (env == NULL) and
(env->arch == NULL) as local operation.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/n/tip-vcz4ufzdon7cwy8dm2ua53xk@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.19.1

  parent reply	other threads:[~2018-11-30 18:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 18:26 [GIT PULL 00/22] perf/core improvements and fixes Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 01/22] perf build: Give better hint about devel package for libssl Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 02/22] perf stat: Fix shadow stats for clock events Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 03/22] perf stat: Fix CSV mode column output for non-cgroup events Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 04/22] perf map: Remove extra indirection from map__find() Arnaldo Carvalho de Melo
2018-11-30 18:26 ` Arnaldo Carvalho de Melo [this message]
2018-11-30 18:26 ` [PATCH 06/22] perf machine: Record if a arch has a single user/kernel address space Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 07/22] perf thread: Add fallback functions for cases where cpumode is insufficient Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 08/22] perf tools: Use fallback for sample_addr_correlates_sym() cases Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 09/22] perf script: Use fallbacks for branch stacks Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 10/22] tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 11/22] perf tests record: Allow for 'sleep' being 'coreutils' Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 12/22] perf test: Fix perf_event_attr test failure Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 13/22] tools include: Adopt ERR_CAST() from the kernel err.h header Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 14/22] perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 15/22] perf top: Allow passing a kallsyms file Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 16/22] perf intel-pt: Fix error with config term "pt=0" Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 17/22] tools build feature: Check if libaio is available Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 18/22] perf mmap: Map data buffer for preserving collected data Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 19/22] perf record: Enable asynchronous trace writing Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 20/22] perf record: Extend trace writing to multi AIO Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 21/22] perf beauty mmap_flags: Check if the arch has a mmap.h file Arnaldo Carvalho de Melo
2018-11-30 18:26 ` [PATCH 22/22] tools lib traceevent: Add sanity check to is_timestamp_in_us() 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=20181130182652.23620-6-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wangnan0@huawei.com \
    --cc=williams@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).