4.19-stable review patch.  If anyone has any objections, please let me know.

------------------

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

commit 804234f27180dcf9a25cb98a88d5212f65b7f3fd upstream.

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.hun...@intel.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: David Ahern <dsah...@gmail.com>
Cc: David S. Miller <da...@davemloft.net>
Cc: Jiri Olsa <jo...@redhat.com>
Cc: Leo Yan <leo....@linaro.org>
Cc: Mathieu Poirier <mathieu.poir...@linaro.org>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Wang Nan <wangn...@huawei.com>
Cc: sta...@vger.kernel.org # 4.19
Link: https://lkml.kernel.org/n/tip-vcz4ufzdon7cwy8dm2ua5...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>

---
 tools/perf/util/env.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -166,7 +166,7 @@ const char *perf_env__arch(struct perf_e
        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 via email to