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


Groups > linux.kernel > #1684690

[PATCH 1/3] perf evsel: Fix attr.exclude_kernel setting for default cycles:p

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
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 Tue, 11 Jul 2017 01:10:02 +0200
Message-ID <u1PYu-2TA-29@gated-at.bofh.it> (permalink)
References <u1PYt-2TA-5@gated-at.bofh.it>
Dmarc-Filter OpenDMARC Filter v1.3.2 mail.kernel.org 3465D22C96
Authentication-Results mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org
Authentication-Results mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org
X-Mailer git-send-email 2.9.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>, Adrian Hunter <adrian.hunter@intel.com>, Andy Lutomirski <luto@kernel.org>, David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Wang Nan <wangnan0@huawei.com>
X-Original-Date Mon, 10 Jul 2017 20:01:39 -0300
X-Original-Message-ID <20170710230141.9013-2-acme@kernel.org>
X-Original-References <20170710230141.9013-1-acme@kernel.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1684690

Show key headers only | View raw


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 | NextPrevious in thread | Next in thread | Find similar | Unroll thread


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