Message ID | 20231204182330.654255-1-irogers@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2950264vqy; Mon, 4 Dec 2023 10:23:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBDJQ6gA8mlUtIosA1+yLtxt2aG9n7SYM/fb4aXPdXJRGASJwe9jEQAA9QELgfd/4+BB3G X-Received: by 2002:a17:903:264f:b0:1cc:5a74:b1df with SMTP id je15-20020a170903264f00b001cc5a74b1dfmr3881143plb.2.1701714223816; Mon, 04 Dec 2023 10:23:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701714223; cv=none; d=google.com; s=arc-20160816; b=xDewC7kgSRp7F0fHSJzdlnUkVIQsviF80cyI3N9uawOhZ948ADfTS8itRE0Muo1Q7N m0sWiaf+nDCdgz1Poun0UmndgJLOTO/VWBzNvAE0sBS+/c+YhsQbMbZAcSWgVUdSSOdy /tmhxDu2XrqqoqNj+47y+4MHJQjpj83W8xgDhLo/ZirdbE3plyISBgBOVJDwwOn+dG/T 1hk/vQEIT1bCgxHzfm8mWiBfl1gQUahWU8UkHXium/4nMAIh3iejAOq2MQqJe4khdiKP jnhv2dOdqm0N3xlcEsF7pJ1sVga8NpjSg3Yd6LX8zH+0NffdHGRGgfE1NiSUpXoiwU91 co0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:mime-version:message-id:date :dkim-signature; bh=SZ0pxQHPPtXifBYnQK2oqRhP2CZVwJXTHj6rC9GaE3c=; fh=GdNrbVz4+rD5GDxx28FfX7pstWQA2odnFE24GYz37s4=; b=NH+zmuozxgxp0ha5YjRh8ye2B3n2hPaeaSnSPwSYGtwIh8ybmPHe+y6h8QXg9RPi+g d7ebtXAsOY0XFWwqGSUWrmynKXf1X/23zkhyaWo4l77CAANIj1O24AHCORwiMjotLr+n /UAz/0mMNUGxOdPpA+svxzAN7hBto8jj29EnZl+GphPsgAfgG1wFWjPy4fonOWTMqqMk ydJSTwQ1q7YckRuYtFh5lij3oeRPqGeUhi5TW+/abfOc9A7/khQUJWSAS2/Bm0ICxEhJ L3BsUvwiR2JwMi5V4srbhsbLm55pgZFurzZmkKcXnfv8zSB81cwVTRRd7N3fU1irwLKp zd3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=P9S4QcPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id v16-20020a63f850000000b005be1ee5be76si8352200pgj.373.2023.12.04.10.23.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 10:23:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=P9S4QcPW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 3CB988047560; Mon, 4 Dec 2023 10:23:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbjLDSXa (ORCPT <rfc822;chrisfriedt@gmail.com> + 99 others); Mon, 4 Dec 2023 13:23:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232775AbjLDSXa (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 4 Dec 2023 13:23:30 -0500 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45414107 for <linux-kernel@vger.kernel.org>; Mon, 4 Dec 2023 10:23:36 -0800 (PST) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-db3ef4c7094so4420408276.1 for <linux-kernel@vger.kernel.org>; Mon, 04 Dec 2023 10:23:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701714215; x=1702319015; darn=vger.kernel.org; h=to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=SZ0pxQHPPtXifBYnQK2oqRhP2CZVwJXTHj6rC9GaE3c=; b=P9S4QcPW5Eh/3vBzx4A6vHvsIbdvrm7Hvr0V0y80HGL8IYg62FJv6KsMWsMFdUaWMO N9qhefubyi1bAbmDVqjYEFrorVqM6RHQCOZNgOG+9i7ZZD4rMWtt+EAikFY7TcK97jNy epM4/byRmFSZyv8abKGyFOSyomlXjYA9AasUlktW06JTychjoMLxbnhTJWLFkxR3HEiI RCxo5XyDefB4n24h4kbjhVVwmuebJhCQl/80WvulztIoHDjVA6P5nvQJLHWzkCJPtHsa tbACaKlXYz6/cCHdQupSqlt0662wrsF7IV0nNneTIdROvdgH2Mf8EglzBeXAAtpiivyO AiWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701714215; x=1702319015; h=to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SZ0pxQHPPtXifBYnQK2oqRhP2CZVwJXTHj6rC9GaE3c=; b=SGm2OLiprvWbTXkT7DOjqlVeMcnLaRsX8q07EuSSGNgXwLtiT89f1sD5etHnXhhP2b tOPJKqOTWiRIFuLvqMnwOykH5RnuIxBiVhbYPt54xhTenwUo96lz2rtI1chAjjVglNJG LtJHBToPYRFlxuSY2sMAM88BpJuMtYrAE4qUg5H/PPfdNyr67a/Ktc9MOqnwkigNDC1H F41Wd5Rub8U3xJBohdt5btW/n1yWfrIGS6AE0QV8RxFQAzWg/0OHxqOaD9DmnsDCt1pr XXvo66EW4q7X8AMDCHuN1F/lQwoMeOb0isC2epTnQGuTiUZO96r0A0af9gZAPKB32Nb7 /yUA== X-Gm-Message-State: AOJu0YwYeKD6icmluLJ2Vb7FHdqRparwX+Q4X56vjhg4tfLyUNgvP9I0 9LR+LG5RbtWYMBZ2mNVjWR6cVUNyAXdj X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:b241:d804:967e:c827]) (user=irogers job=sendgmr) by 2002:a25:cace:0:b0:db5:4692:3aae with SMTP id a197-20020a25cace000000b00db546923aaemr331621ybg.4.1701714215509; Mon, 04 Dec 2023 10:23:35 -0800 (PST) Date: Mon, 4 Dec 2023 10:23:29 -0800 Message-Id: <20231204182330.654255-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Subject: [PATCH v1 1/2] perf metrics: Avoid segv if default metricgroup isn't set From: Ian Rogers <irogers@google.com> To: John Garry <john.g.garry@oracle.com>, Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>, Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Ilkka Koskinen <ilkka@os.amperecomputing.com>, Kan Liang <kan.liang@linux.intel.com>, Kajol Jain <kjain@linux.ibm.com>, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 10:23:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784376693973485762 X-GMAIL-MSGID: 1784376693973485762 |
Series |
[v1,1/2] perf metrics: Avoid segv if default metricgroup isn't set
|
|
Commit Message
Ian Rogers
Dec. 4, 2023, 6:23 p.m. UTC
A metric is default by having "Default" within its groups. The default
metricgroup name needn't be set and this can result in segv in
default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup
that assume it has a value when there is a Default metric group. To
avoid the segv initialize the value to "".
Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup")
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/metricgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, 4 Dec 2023, Ian Rogers wrote: > A metric is default by having "Default" within its groups. The default > metricgroup name needn't be set and this can result in segv in > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > that assume it has a value when there is a Default metric group. To > avoid the segv initialize the value to "". > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > Signed-off-by: Ian Rogers <irogers@google.com> Thanks! I was going to look for the bug but got pulled to other tasks. The patch looks good to me and I tested it successfully on AmpereOne. Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Cheers, Ilkka > --- > tools/perf/util/metricgroup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c > index 0484736d9fe4..ca3e0404f187 100644 > --- a/tools/perf/util/metricgroup.c > +++ b/tools/perf/util/metricgroup.c > @@ -225,7 +225,7 @@ static struct metric *metric__new(const struct pmu_metric *pm, > > m->pmu = pm->pmu ?: "cpu"; > m->metric_name = pm->metric_name; > - m->default_metricgroup_name = pm->default_metricgroup_name; > + m->default_metricgroup_name = pm->default_metricgroup_name ?: ""; > m->modifier = NULL; > if (modifier) { > m->modifier = strdup(modifier); > -- > 2.43.0.rc2.451.g8631bc7472-goog > >
Hello, On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > A metric is default by having "Default" within its groups. The default > > metricgroup name needn't be set and this can result in segv in > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > that assume it has a value when there is a Default metric group. To > > avoid the segv initialize the value to "". > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > Signed-off-by: Ian Rogers <irogers@google.com> > > Thanks! I was going to look for the bug but got pulled to other > tasks. The patch looks good to me and I tested it successfully on > AmpereOne. > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Looks like it needs to go through perf-tools for v6.7. Ian, do you think this one is enough? Thanks, Namhyung
On Mon, Dec 4, 2023 at 7:33 PM Namhyung Kim <namhyung@kernel.org> wrote: > > Hello, > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen > <ilkka@os.amperecomputing.com> wrote: > > > > > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > A metric is default by having "Default" within its groups. The default > > > metricgroup name needn't be set and this can result in segv in > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > that assume it has a value when there is a Default metric group. To > > > avoid the segv initialize the value to "". > > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > Signed-off-by: Ian Rogers <irogers@google.com> > > > > Thanks! I was going to look for the bug but got pulled to other > > tasks. The patch looks good to me and I tested it successfully on > > AmpereOne. > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > > Looks like it needs to go through perf-tools for v6.7. > Ian, do you think this one is enough? From a user's pov the json fix is nicer as otherwise perf stat output for the relevant metrics lacks a heading on the left. This fix is smaller. I'm easy about which to take :-) Thanks, Ian > Thanks, > Namhyung
Em Mon, Dec 04, 2023 at 02:44:54PM -0800, Ilkka Koskinen escreveu: > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > A metric is default by having "Default" within its groups. The default > > metricgroup name needn't be set and this can result in segv in > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > that assume it has a value when there is a Default metric group. To > > avoid the segv initialize the value to "". > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > Signed-off-by: Ian Rogers <irogers@google.com> > > Thanks! I was going to look for the bug but got pulled to other tasks. The > patch looks good to me and I tested it successfully on AmpereOne. > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> Thanks, applied to perf-tools-next. - Arnaldo
Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu: > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > A metric is default by having "Default" within its groups. The default > > > metricgroup name needn't be set and this can result in segv in > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > that assume it has a value when there is a Default metric group. To > > > avoid the segv initialize the value to "". > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > Signed-off-by: Ian Rogers <irogers@google.com> > > Thanks! I was going to look for the bug but got pulled to other > > tasks. The patch looks good to me and I tested it successfully on > > AmpereOne. > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > Looks like it needs to go through perf-tools for v6.7. > Ian, do you think this one is enough? So I had this on my local perf-tools-next, removed now, I also have some other fixes by Ian on the tmp.perf-tools-next, please let me know what you guys decide to have in perf-tools for v6.7 so that I can remove it from there. - Arnaldo
Hi Arnaldo, On Tue, Dec 5, 2023 at 7:51 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu: > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > > A metric is default by having "Default" within its groups. The default > > > > metricgroup name needn't be set and this can result in segv in > > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > > that assume it has a value when there is a Default metric group. To > > > > avoid the segv initialize the value to "". > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > > Signed-off-by: Ian Rogers <irogers@google.com> > > > > Thanks! I was going to look for the bug but got pulled to other > > > tasks. The patch looks good to me and I tested it successfully on > > > AmpereOne. > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > > > Looks like it needs to go through perf-tools for v6.7. > > Ian, do you think this one is enough? > > So I had this on my local perf-tools-next, removed now, I also have some > other fixes by Ian on the tmp.perf-tools-next, please let me know what > you guys decide to have in perf-tools for v6.7 so that I can remove it > from there. I think we need this one and the Ampere default-metric-group fix. https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@os.amperecomputing.com/ Also perf list JSON fix can go to v6.7. https://lore.kernel.org/r/20231129213428.2227448-2-irogers@google.com/ Thanks, Namhyung
Em Tue, Dec 05, 2023 at 09:24:42AM -0800, Namhyung Kim escreveu: > Hi Arnaldo, > > On Tue, Dec 5, 2023 at 7:51 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu: > > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > > > A metric is default by having "Default" within its groups. The default > > > > > metricgroup name needn't be set and this can result in segv in > > > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > > > that assume it has a value when there is a Default metric group. To > > > > > avoid the segv initialize the value to "". > > > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > > > Signed-off-by: Ian Rogers <irogers@google.com> > > > > > > Thanks! I was going to look for the bug but got pulled to other > > > > tasks. The patch looks good to me and I tested it successfully on > > > > AmpereOne. > > > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > > > > > Looks like it needs to go through perf-tools for v6.7. > > > Ian, do you think this one is enough? > > > > So I had this on my local perf-tools-next, removed now, I also have some > > other fixes by Ian on the tmp.perf-tools-next, please let me know what > > you guys decide to have in perf-tools for v6.7 so that I can remove it > > from there. > > I think we need this one and the Ampere default-metric-group fix. > > https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@os.amperecomputing.com/ > > Also perf list JSON fix can go to v6.7. > > https://lore.kernel.org/r/20231129213428.2227448-2-irogers@google.com/ Ok, removed both, please augment the later description to: "perf list: Fix JSON segfault by setting the used skip_fuplicate_pmus callback" The original description was vague, improving it a bit like that helps when just looking at the output of "git log --oneline". Thanks, - Arnaldo
On Tue, Dec 5, 2023 at 10:48 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > Em Tue, Dec 05, 2023 at 09:24:42AM -0800, Namhyung Kim escreveu: > > Hi Arnaldo, > > > > On Tue, Dec 5, 2023 at 7:51 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > > Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu: > > > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > > > > A metric is default by having "Default" within its groups. The default > > > > > > metricgroup name needn't be set and this can result in segv in > > > > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > > > > that assume it has a value when there is a Default metric group. To > > > > > > avoid the segv initialize the value to "". > > > > > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > > > > Signed-off-by: Ian Rogers <irogers@google.com> > > > > > > > > Thanks! I was going to look for the bug but got pulled to other > > > > > tasks. The patch looks good to me and I tested it successfully on > > > > > AmpereOne. > > > > > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > > > > > > > Looks like it needs to go through perf-tools for v6.7. > > > > Ian, do you think this one is enough? > > > > > > So I had this on my local perf-tools-next, removed now, I also have some > > > other fixes by Ian on the tmp.perf-tools-next, please let me know what > > > you guys decide to have in perf-tools for v6.7 so that I can remove it > > > from there. > > > > I think we need this one and the Ampere default-metric-group fix. > > > > https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@os.amperecomputing.com/ > > > > Also perf list JSON fix can go to v6.7. > > > > https://lore.kernel.org/r/20231129213428.2227448-2-irogers@google.com/ > > Ok, removed both, please augment the later description to: > > "perf list: Fix JSON segfault by setting the used skip_fuplicate_pmus callback" > > The original description was vague, improving it a bit like that helps > when just looking at the output of "git log --oneline". Done and pushed to tmp.perf-tools! Thanks, Namhyung
On Tue, Dec 5, 2023 at 11:11 AM Namhyung Kim <namhyung@kernel.org> wrote: > > On Tue, Dec 5, 2023 at 10:48 AM Arnaldo Carvalho de Melo > <acme@kernel.org> wrote: > > > > Em Tue, Dec 05, 2023 at 09:24:42AM -0800, Namhyung Kim escreveu: > > > Hi Arnaldo, > > > > > > On Tue, Dec 5, 2023 at 7:51 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote: > > > > > > > > Em Mon, Dec 04, 2023 at 07:33:18PM -0800, Namhyung Kim escreveu: > > > > > On Mon, Dec 4, 2023 at 2:45 PM Ilkka Koskinen <ilkka@os.amperecomputing.com> wrote: > > > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > > > > > A metric is default by having "Default" within its groups. The default > > > > > > > metricgroup name needn't be set and this can result in segv in > > > > > > > default_metricgroup_cmp and perf_stat__print_shadow_stats_metricgroup > > > > > > > that assume it has a value when there is a Default metric group. To > > > > > > > avoid the segv initialize the value to "". > > > > > > > > > > > Fixes: 1c0e47956a8e ("perf metrics: Sort the Default metricgroup") > > > > > > > Signed-off-by: Ian Rogers <irogers@google.com> > > > > > > > > > > Thanks! I was going to look for the bug but got pulled to other > > > > > > tasks. The patch looks good to me and I tested it successfully on > > > > > > AmpereOne. > > > > > > > > > > Reviewed-and-tested-by: Ilkka Koskinen <ilkka@os.amperecomputing.com> > > > > > > > > > Looks like it needs to go through perf-tools for v6.7. > > > > > Ian, do you think this one is enough? > > > > > > > > So I had this on my local perf-tools-next, removed now, I also have some > > > > other fixes by Ian on the tmp.perf-tools-next, please let me know what > > > > you guys decide to have in perf-tools for v6.7 so that I can remove it > > > > from there. > > > > > > I think we need this one and the Ampere default-metric-group fix. > > > > > > https://lore.kernel.org/r/20231201021550.1109196-2-ilkka@os.amperecomputing.com/ > > > > > > Also perf list JSON fix can go to v6.7. > > > > > > https://lore.kernel.org/r/20231129213428.2227448-2-irogers@google.com/ > > > > Ok, removed both, please augment the later description to: > > > > "perf list: Fix JSON segfault by setting the used skip_fuplicate_pmus callback" > > > > The original description was vague, improving it a bit like that helps > > when just looking at the output of "git log --oneline". > > Done and pushed to tmp.perf-tools! Thanks Namhyung, there was a typo in Arnaldo's commit message "s/fuplicate/duplicate/" could you fix? Ian > Thanks, > Namhyung
On Tue, Dec 5, 2023 at 11:15 AM Ian Rogers <irogers@google.com> wrote: > > On Tue, Dec 5, 2023 at 11:11 AM Namhyung Kim <namhyung@kernel.org> wrote: > > > > On Tue, Dec 5, 2023 at 10:48 AM Arnaldo Carvalho de Melo > > <acme@kernel.org> wrote: > > > "perf list: Fix JSON segfault by setting the used skip_fuplicate_pmus callback" > > > > > > The original description was vague, improving it a bit like that helps > > > when just looking at the output of "git log --oneline". > > > > Done and pushed to tmp.perf-tools! > > Thanks Namhyung, there was a typo in Arnaldo's commit message > "s/fuplicate/duplicate/" could you fix? Oops, fixed now. Thanks for checking. Namhyung
diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 0484736d9fe4..ca3e0404f187 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -225,7 +225,7 @@ static struct metric *metric__new(const struct pmu_metric *pm, m->pmu = pm->pmu ?: "cpu"; m->metric_name = pm->metric_name; - m->default_metricgroup_name = pm->default_metricgroup_name; + m->default_metricgroup_name = pm->default_metricgroup_name ?: ""; m->modifier = NULL; if (modifier) { m->modifier = strdup(modifier);