public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf parse-events: Set exclude_guest for user-space counting
@ 2020-08-12  6:59 Jin Yao
  2020-08-12 12:15 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 9+ messages in thread
From: Jin Yao @ 2020-08-12  6:59 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, like.xu, Jin Yao

Currently if we run 'perf record -e cycles:u', exclude_guest is 0.

But it doesn't make sense that we request for user-space counting
but we also get the guest report.

To keep perf semantics consistent and clear, this patch sets
exclude_guest for user-space counting.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
---
 tools/perf/util/parse-events.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 9f7260e69113..4d809f1fe269 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1794,6 +1794,8 @@ static int get_event_modifier(struct event_modifier *mod, char *str,
 		if (*str == 'u') {
 			if (!exclude)
 				exclude = eu = ek = eh = 1;
+			if (!exclude_GH)
+				eG = 1;
 			eu = 0;
 		} else if (*str == 'k') {
 			if (!exclude)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-13  7:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-12  6:59 [PATCH] perf parse-events: Set exclude_guest for user-space counting Jin Yao
2020-08-12 12:15 ` Arnaldo Carvalho de Melo
2020-08-12 12:55   ` Arnaldo Carvalho de Melo
2020-08-13  5:09     ` Jin, Yao
2020-08-12 13:02   ` Like Xu
2020-08-13  3:11     ` Jin, Yao
2020-08-13  6:57       ` Like Xu
2020-08-13  7:08         ` Jin, Yao
2020-08-13  7:21           ` Like Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox