From: Alexey Budankov <alexey.budankov@linux.intel.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@linux.intel.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] perf record: collect user registers set jointly with dwarf stacks
Date: Tue, 4 Jun 2019 17:56:30 +0300 [thread overview]
Message-ID: <ecf1d25f-8c28-934d-f426-26c9d0a68304@linux.intel.com> (raw)
In-Reply-To: <20190604141220.GG24504@kernel.org>
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@quaco ~]$ 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@quaco ~]$
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@quaco ~]$ 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@quaco ~]$ 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
>
>
next prev parent reply other threads:[~2019-06-04 14:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-30 19:03 Alexey Budankov
2019-05-30 19:41 ` Arnaldo Carvalho de Melo
2019-05-31 6:27 ` Alexey Budankov
2019-06-04 14:12 ` Arnaldo Carvalho de Melo
2019-06-04 14:56 ` Alexey Budankov [this message]
2019-06-04 15:42 ` Arnaldo Carvalho de Melo
2019-06-17 18:58 ` [tip:perf/core] perf record: Allow mixing --user-regs with --call-graph=dwarf tip-bot for Alexey Budankov
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=ecf1d25f-8c28-934d-f426-26c9d0a68304@linux.intel.com \
--to=alexey.budankov@linux.intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=arnaldo.melo@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®