From: Jiri Olsa <jolsa@redhat.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Namhyung Kim <namhyung@kernel.org>,
David Ahern <dsahern@gmail.com>,
Thomas Richter <tmricht@linux.vnet.ibm.com>
Subject: [PATCHv2 01/15] perf tools: Fix -n option
Date: Mon, 3 Jul 2017 17:16:54 +0200 [thread overview]
Message-ID: <20170703151654.GA16010@krava> (raw)
In-Reply-To: <20170703145739.GA16278@kernel.org>
On Mon, Jul 03, 2017 at 11:57:39AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jul 03, 2017 at 04:50:16PM +0200, Jiri Olsa escreveu:
> > The kernel fails to add a non sampling event event
> > with having precise_ip set.
> >
> > Make sure the precise_ip is 0 when using -n option
> > to create non sampling event in record.
>
> Ok, but how could that happen? What was the scenario? Which command? Can
> you provide a command line that causes the problem?
[jolsa@krava perf]$ ./perf record -e cycles:ppp -n ls
Lowering default frequency rate to 3000.
Please consider tweaking /proc/sys/kernel/perf_event_max_sample_rate.
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:pppu).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
v2 attached, thanks
jirka
---
The kernel fails to add a non sampling event event
with having precise_ip set, like:
$ perf record -e cycles:ppp -n ls
Error:
The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (cycles:pppu).
/bin/dmesg may provide additional information.
No CONFIG_PERF_EVENTS=y kernel support configured?
Make sure the precise_ip is 0 when using -n option
to create non sampling event in record.
Link: http://lkml.kernel.org/n/tip-l513fzc1houvu7tl1bo5y65y@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/util/evsel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 6f4882f8d61f..915fe3cd6544 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -890,8 +890,10 @@ void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts,
attr->sample_period = 0;
}
- if (opts->no_samples)
+ if (opts->no_samples) {
attr->sample_freq = 0;
+ attr->precise_ip = 0;
+ }
if (opts->inherit_stat)
attr->inherit_stat = 1;
--
2.9.4
next prev parent reply other threads:[~2017-07-03 15:17 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 14:50 [PATCH 00/15] perf tools: Fix attr tests Jiri Olsa
2017-07-03 14:50 ` [PATCH 01/15] perf tools: Fix -n option Jiri Olsa
2017-07-03 14:57 ` Arnaldo Carvalho de Melo
2017-07-03 15:16 ` Jiri Olsa [this message]
2017-07-03 16:10 ` [PATCHv2 " Arnaldo Carvalho de Melo
2017-07-03 16:22 ` Jiri Olsa
2017-07-03 16:40 ` Arnaldo Carvalho de Melo
2017-07-03 16:58 ` Jiri Olsa
2017-07-03 17:44 ` Arnaldo Carvalho de Melo
2017-07-03 14:50 ` [PATCH 02/15] perf tests attr: Do not store failed events Jiri Olsa
2017-07-20 8:51 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 03/15] perf tests attr: Add test_attr__ready function Jiri Olsa
2017-07-20 8:51 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 04/15] perf tests attr: Make compare_data global Jiri Olsa
2017-07-20 8:51 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 05/15] perf tests attr: Rename compare_data to data_equal Jiri Olsa
2017-07-20 8:52 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 06/15] perf tests attr: Add 1s for exclude_kernel and task base bits Jiri Olsa
2017-07-20 8:52 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 07/15] perf tests attr: Fix record dwarf test Jiri Olsa
2017-07-20 8:52 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 08/15] perf tests attr: Fix no-delay test Jiri Olsa
2017-07-20 8:53 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 09/15] perf tests attr: Add proper return values Jiri Olsa
2017-07-20 8:53 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 10/15] perf tests attr: Fix cpu test disabled term setup Jiri Olsa
2017-07-20 8:53 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 11/15] perf tests attr: Fix sample_period setup Jiri Olsa
2017-07-20 8:54 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 12/15] perf tests attr: Fix precise_ip setup Jiri Olsa
2017-07-20 8:54 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 13/15] perf tests attr: Fix stat sample_type setup Jiri Olsa
2017-07-20 8:54 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 14/15] perf tests attr: Add optional term Jiri Olsa
2017-07-20 8:55 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-03 14:50 ` [PATCH 15/15] perf tests attr: Fix task term values Jiri Olsa
2017-08-09 15:00 ` Jiri Olsa
2017-08-10 7:07 ` Thomas Richter
2017-10-03 16:43 ` [tip:perf/core] " tip-bot for Jiri Olsa
2017-07-17 12:18 ` [PATCH 00/15] perf tools: Fix attr tests Jiri Olsa
2017-07-17 12:51 ` 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=20170703151654.GA16010@krava \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=tmricht@linux.vnet.ibm.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