Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1684690
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/3] perf evsel: Fix attr.exclude_kernel setting for default cycles:p |
| Date | 2017-07-11 01:10 +0200 |
| Message-ID | <u1PYu-2TA-29@gated-at.bofh.it> (permalink) |
| References | <u1PYt-2TA-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To allow probing the max attr.precise_ip setting for non-root users
we unconditionally set attr.exclude_kernel, which makes the detection
work but should be done only for !root, fix it.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 97365e81366f ("perf evsel: Set attr.exclude_kernel when probing max attr.precise_ip")
Link: http://lkml.kernel.org/n/tip-bl6bbxzxloonzvm4nvt7oqgj@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/evsel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 87b431886670..f2a1876d268e 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -273,7 +273,7 @@ struct perf_evsel *perf_evsel__new_cycles(void)
struct perf_event_attr attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES,
- .exclude_kernel = 1,
+ .exclude_kernel = geteuid() != 0,
};
struct perf_evsel *evsel;
--
2.9.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-11 01:10 +0200 [PATCH 1/3] perf evsel: Fix attr.exclude_kernel setting for default cycles:p Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-07-11 01:10 +0200 Re: [GIT PULL 0/3] perf/urgent fixes Ingo Molnar <mingo@kernel.org> - 2017-07-11 10:20 +0200
csiph-web