[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ecf1d25f-8c28-934d-f426-26c9d0a68304@linux.intel.com>
Date: Tue, 4 Jun 2019 17:56:30 +0300
From: Alexey Budankov <alexey.budankov@...ux.intel.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>, Namhyung Kim <namhyung@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v5] perf record: collect user registers set jointly with
dwarf stacks
On 04.06.2019 17:12, Arnaldo Carvalho de Melo wrote:
> Em Fri, May 31, 2019 at 09:27:38AM +0300, Alexey Budankov escreveu:
<SNIP>
>
> Now cross building to a few arches is failing, so far:
>
> [perfbuilder@...co ~]$ cat /tmp/dm.log/summary
> alpine:3.4: Ok
> alpine:3.5: Ok
> alpine:3.6: Ok
> alpine:3.7: Ok
> alpine:3.8: Ok
> alpine:3.9: Ok
> alpine:edge: Ok
> amazonlinux:1: Ok
> amazonlinux:2: Ok
> android-ndk:r12b-arm: Ok
> android-ndk:r15c-arm: Ok
> centos:5: Ok
> centos:6: Ok
> centos:7: Ok
> clearlinux:latest: Ok
> debian:8: Ok
> debian:9: Ok
> debian:experimental: Ok
> debian:experimental-x-arm64: Ok
> debian:experimental-x-mips: FAIL
> debian:experimental-x-mips64: FAIL
> debian:experimental-x-mipsel: FAIL
> fedora:20: Ok
> fedora:22: Ok
> fedora:23: Ok
> fedora:24: Ok
> fedora:24-x-ARC-uClibc: FAIL
> fedora:25: Ok
> fedora:26: Ok
> fedora:27: Ok
> [perfbuilder@...co ~]$
That below can fix it. Unfortunately can't test in advance on that architectures.
Thanks,
Alexey
---
tools/perf/util/evsel.c | 4 +---
tools/perf/util/perf_regs.h | 4 ++++
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 375ab4eb7560..cc6e7a0dda92 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -669,8 +669,6 @@ int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size)
return ret;
}
-#define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
-
static void __perf_evsel__config_callchain(struct perf_evsel *evsel,
struct record_opts *opts,
struct callchain_param *param)
@@ -704,7 +702,7 @@ static void __perf_evsel__config_callchain(struct perf_evsel *evsel,
if (!function) {
perf_evsel__set_sample_bit(evsel, REGS_USER);
perf_evsel__set_sample_bit(evsel, STACK_USER);
- if (opts->sample_user_regs) {
+ if (opts->sample_user_regs && DWARF_MINIMAL_REGS != PERF_REGS_MASK) {
attr->sample_regs_user |= DWARF_MINIMAL_REGS;
pr_warning("WARNING: The use of --call-graph=dwarf may require all the user registers, "
"specifying a subset with --user-regs may render DWARF unwinding unreliable, "
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h
index cb9c246c8962..47fe34e5f7d5 100644
--- a/tools/perf/util/perf_regs.h
+++ b/tools/perf/util/perf_regs.h
@@ -29,12 +29,16 @@ uint64_t arch__user_reg_mask(void);
#ifdef HAVE_PERF_REGS_SUPPORT
#include <perf_regs.h>
+#define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
+
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
#else
#define PERF_REGS_MASK 0
#define PERF_REGS_MAX 0
+#define DWARF_MINIMAL_REGS PERF_REGS_MASK
+
static inline const char *perf_reg_name(int id __maybe_unused)
{
return NULL;
---
>
> For instance:
>
> [perfbuilder@...co ~]$ cat /tmp/dm.log/debian\:experimental-x-mips64
> <SNIP>
> CC /tmp/build/perf/tests/pmu.o
> util/evsel.c: In function '__perf_evsel__config_callchain':
> util/evsel.c:672:38: error: 'PERF_REG_IP' undeclared (first use in this function); did you mean 'PERF_REGS_MAX'?
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^~~~~~~~~~~
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> util/evsel.c:672:38: note: each undeclared identifier is reported only once for each function it appears in
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^~~~~~~~~~~
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> util/evsel.c:672:62: error: 'PERF_REG_SP' undeclared (first use in this function); did you mean 'PERF_MEM_S'?
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^~~~~~~~~~~
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> LD /tmp/build/perf/bench/perf-in.o
> CC /tmp/build/perf/tests/hists_common.o
> mv: cannot stat '/tmp/build/perf/util/.evsel.o.tmp': No such file or directory
> make[4]: *** [/git/linux/tools/build/Makefile.build:97: /tmp/build/perf/util/evsel.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> <SNIP>
>
>
>
> [perfbuilder@...co ~]$ cat /tmp/dm.log/fedora\:24-x-ARC-uClibc
>
> <SNIP>
> CC /tmp/build/perf/tests/mmap-basic.o
> CC /tmp/build/perf/ui/hist.o
> util/evsel.c: In function '__perf_evsel__config_callchain':
> util/evsel.c:672:38: error: 'PERF_REG_IP' undeclared (first use in this function); did you mean 'PERF_MEM_S'?
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> util/evsel.c:672:38: note: each undeclared identifier is reported only once for each function it appears in
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> util/evsel.c:672:62: error: 'PERF_REG_SP' undeclared (first use in this function); did you mean 'PERF_REG_IP'?
> #define DWARF_MINIMAL_REGS ((1ULL << PERF_REG_IP) | (1ULL << PERF_REG_SP))
> ^
> util/evsel.c:708:31: note: in expansion of macro 'DWARF_MINIMAL_REGS'
> attr->sample_regs_user |= DWARF_MINIMAL_REGS;
> ^~~~~~~~~~~~~~~~~~
> MKDIR /tmp/build/perf/ui/stdio/
> mv: cannot stat '/tmp/build/perf/util/.evsel.o.tmp': No such file or directory
> /git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/util/evsel.o' failed
> make[4]: *** [/tmp/build/perf/util/evsel.o] Error 1
>
>
Powered by blists - more mailing lists