From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 07 Feb 2019 23:43:33 -0000 Received: from mga06.intel.com ([134.134.136.31]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1grtID-0006Jv-T9 for speck@linutronix.de; Fri, 08 Feb 2019 00:41:18 +0100 From: Andi Kleen Subject: [MODERATED] [PATCH v3 4/6] PERFv3 Date: Thu, 7 Feb 2019 15:41:06 -0800 Message-Id: In-Reply-To: References: In-Reply-To: References: To: speck@linutronix.de Cc: Andi Kleen List-ID: From: Andi Kleen Subject: perf stat: Make all existing groups weak Now that we may only have three counters make the --topdown and the --transaction groups weak, so that they still work. Signed-off-by: Andi Kleen --- tools/perf/builtin-stat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index e587808591e8..c94f5ed135f1 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -101,7 +101,7 @@ static const char *transaction_attrs = { "cpu/tx-start/," "cpu/el-start/," "cpu/cycles-ct/" - "}" + "}:W" }; /* More limited version when the CPU does not have all events. */ @@ -112,7 +112,7 @@ static const char * transaction_limited_attrs = { "cycles," "cpu/cycles-t/," "cpu/tx-start/" - "}" + "}:W" }; static const char * topdown_attrs[] = { @@ -999,7 +999,7 @@ static int topdown_filter_events(const char **attr, char **str, bool use_group) } attr[i - off] = NULL; - *str = malloc(len + 1 + 2); + *str = malloc(len + 1 + 2 + 2); if (!*str) return -1; s = *str; @@ -1016,6 +1016,8 @@ static int topdown_filter_events(const char **attr, char **str, bool use_group) } if (use_group) { s[-1] = '}'; + *s++ = ':'; + *s++ = 'W'; *s = 0; } else s[-1] = 0; -- 2.17.2