Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp55114rdb; Mon, 4 Dec 2023 20:25:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZHFMmevg/rxCoh7F9Q3SKomMI2f54GCQfJTly6AlvFPbrjzZaKXiky3DNqo1/OHZeZ6Lo X-Received: by 2002:a05:6a20:2448:b0:18c:fc4:df13 with SMTP id t8-20020a056a20244800b0018c0fc4df13mr1120096pzc.27.1701750342961; Mon, 04 Dec 2023 20:25:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701750342; cv=none; d=google.com; s=arc-20160816; b=HPf73vFietUKFD4QQqJSNm0qXh4Zg9nhY9j8zUNtrWAoF0+9mwwOk4kayV3Fkzd9pU 4wsRNxnYEkdZU8m9sLKNmrWwcUQloayUWBTgAauBXBpIoBD9HvpZIaZS1a+oOk9fN5dZ ti/n458ZKJgjYhD0oeW9x6rdTFVrUz65HwR1dTY6FB887+Tkc5B2KrfQ7kyslHLlKDv9 ggrE0B92yu7Qv+9H62ZaYOVt2Hnfp07qjvf5cg5Y0IPb/K5OxzGDlfyZSA3InFqrMLXG ffEmwNGTrs1TXMNrmD3GhV3UkRXP/5fP4lmd7iC5pijR0GY8A5N/xbUIpJ4k40OY9tw5 kMug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KgAMRXqQYaDBV6wyGUZmXuMtTS9bHHBbShJFrMu8R94=; fh=TeashCZwosxefYa8Mn/LDwwkCrVDaXutzlaXFssdigQ=; b=wBA0y3xd35eVWbS1TK8Vr8KQyaMf8OqhuXVy/q0BBOWVoOGHDK9QjbIIte6QXS30yn YfZStirEMLr6BFsNmw0rZAR7AGo1DwUlD7+s8abh/X3QwXiRhlDX7OOE20NAHHuv8J81 MNrkcRycohqVXCvTgUKwsZUvVgoawc3ESkGB0hIZT4qeHtHPgr0X3IuN6lzfP+cA9/hB HRUpQEo1ix+vDcrQE7JdIH+ZpW1ET+UMLBaA+mG55feJgMBHyaHS0gDIMgJlAQdAI8C/ h6ZF13tmbEy6QZ/aH/GNhlgvZwhq2x+1KLE0gRyIQr2sDr5VyAyIcbS6PNxg/IyYjuw5 QOSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YT2hWwDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id n38-20020a634d66000000b005c6a04f9edesi1348917pgl.800.2023.12.04.20.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 20:25:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=YT2hWwDk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 0D2D6804595F; Mon, 4 Dec 2023 20:25:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231616AbjLEEZa (ORCPT + 99 others); Mon, 4 Dec 2023 23:25:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229611AbjLEEZ2 (ORCPT ); Mon, 4 Dec 2023 23:25:28 -0500 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54E0F83 for ; Mon, 4 Dec 2023 20:25:34 -0800 (PST) Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-548ae9a5eeaso4194a12.1 for ; Mon, 04 Dec 2023 20:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701750333; x=1702355133; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KgAMRXqQYaDBV6wyGUZmXuMtTS9bHHBbShJFrMu8R94=; b=YT2hWwDkCsSBKNE+L3cHL3odpQ/ysz3p1n0KHksRmx0c9wisK0f2kffYTjeEN3GFVx PxEbsOQAZWIVRsnkFU2xu1XfjGTL/6uPsJmrE60HZD8tx0PRA3EZjSgt7oJXLI8XfFId +pa365/hEKGsdndv7dYaU4677e3dK1WEfrMZnKHXlLM+50ssxj7OFKhC47JiWfJijUTe ZYeRFNo4WFUAdjuPgtGWjFCs004vB0zLHi2IZ4uIwsbO5+frcCg+H9V4EeKY+qDOVCcg hXkfpXdqzFUtbL387dvLw68Iv8NLk9AZ94G+7QTob0mnQHWUIkHEZaKtbDpySBB0+sgh H2Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701750333; x=1702355133; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KgAMRXqQYaDBV6wyGUZmXuMtTS9bHHBbShJFrMu8R94=; b=V4DOsyhnJUcTdZtWpK5IHQMcmdr1pPc7MSarRtjJlFg283hdowCkTU/hzb1a0v1Jo+ hSGtysP2NjfCa+CCY/630yWw+Zhym3EvblQJwNYvMM7jp8ruBbG7QHotw2M2rX0H4/0Y fl9ZjBZDK/nfdeazrEWAaRV9+nGcoQmo0eMQAUkxAie6JIb8XDGF2zbs632m3OCG4wCy tAOX2xCPefIc5cvuq3jP5dZNNSo3pUZOBpV1KoMmi6vNYoSt9JTa6ZaoilL+qU2DAu6f KDAfi3mQ4uedWaqnLpU6NMaNl+A67D8HcQ5lYzzZSsYC+JReRm9tFCWrD3+CNHHCleCv q61w== X-Gm-Message-State: AOJu0YxnFA4art2YwAhuPQLPb1U35lWRy0d/IubdEQmQGdhxHvlOh3vO r+BOjTXOqlxzXAexhfGrKNunGIuV0Zfx+yDM0im11Q== X-Received: by 2002:a50:cc82:0:b0:54b:8f42:e3dc with SMTP id q2-20020a50cc82000000b0054b8f42e3dcmr490832edi.2.1701750332278; Mon, 04 Dec 2023 20:25:32 -0800 (PST) MIME-Version: 1.0 References: <20231204182330.654255-1-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Mon, 4 Dec 2023 20:25:20 -0800 Message-ID: Subject: Re: [PATCH v1 1/2] perf metrics: Avoid segv if default metricgroup isn't set To: Namhyung Kim Cc: Ilkka Koskinen , John Garry , Will Deacon , James Clark , Mike Leach , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , Kajol Jain , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 20:25:42 -0800 (PST) On Mon, Dec 4, 2023 at 7:33=E2=80=AFPM Namhyung Kim w= rote: > > Hello, > > On Mon, Dec 4, 2023 at 2:45=E2=80=AFPM Ilkka Koskinen > wrote: > > > > > > > > On Mon, 4 Dec 2023, Ian Rogers wrote: > > > A metric is default by having "Default" within its groups. The defaul= t > > > 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 > > > > 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 > > 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