Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684885 > unrolled thread

[tip:perf/urgent] perf evsel: Fix attr.exclude_kernel setting for default cycles:p

Started bytip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
First post2017-07-11 11:00 +0200
Last post2017-07-11 11:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [tip:perf/urgent] perf evsel: Fix attr.exclude_kernel setting for  default cycles:p tip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com> - 2017-07-11 11:00 +0200

#1684885 — [tip:perf/urgent] perf evsel: Fix attr.exclude_kernel setting for default cycles:p

Fromtip-bot for Arnaldo Carvalho de Melo <tipbot@zytor.com>
Date2017-07-11 11:00 +0200
Subject[tip:perf/urgent] perf evsel: Fix attr.exclude_kernel setting for default cycles:p
Message-ID<u1Zbs-8vM-11@gated-at.bofh.it>
Commit-ID:  d37a369790774af66a4aee61a188384d21b17a43
Gitweb:     http://git.kernel.org/tip/d37a369790774af66a4aee61a188384d21b17a43
Author:     Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Mon, 10 Jul 2017 16:08:07 -0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 10 Jul 2017 16:14:48 -0300

perf evsel: Fix attr.exclude_kernel setting for default cycles:p

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 87b4318..f2a1876 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;
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web