Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2047415rdh; Tue, 26 Sep 2023 10:39:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiHyv+FzGZS+957dh3gTvfuTjQzBD+aVQdqpQAWL6TvcRgoTu/MkAYYTvApseXFpiCUq5J X-Received: by 2002:a17:90a:3de3:b0:26d:61:3aad with SMTP id i90-20020a17090a3de300b0026d00613aadmr7901479pjc.4.1695749968320; Tue, 26 Sep 2023 10:39:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695749968; cv=none; d=google.com; s=arc-20160816; b=KOPHCpZ2a99iNcZgbS3LA5kWE+Q0PQfC9DsFMN82GIdNo6l7wZY44AOM4u+KyLeE6R fFkPi6vLwWb+e6FHwrN2zNF3aX3XyF4b+82MIntb/Y3K81VyL60Igjpr0olts0Lbj0Sl B16wnrz3RrrRDGVvWEn0p4Eby8EYLyWG2mcsJlvmbtyoHzBd5zIqf96NNGbegF0Cr+uC +LyR9rLduVJo1zhqgCzumpcfyVdrRQBLEcTGEcNM+UXWUvPy1oCY1rZnH5UiSwYdGz3Z 4uZPqqiAeIG2uTtHo28gSkIODk92TvQsofT8Smdjirn5ofuDzoOYGM9Uzs9D5iHva+Xq G39w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ClYg/KPkqnKg1rm6fLb8BKahv4EVre0Nw3s72Uupl1A=; fh=R1OkhriIwip1F03SPBPuQjbmUJVFiHc78tVoBI9xOtw=; b=qtpRy4YxH/9JicoJ89JJ0jNr2bQMr5jsMyuvYukQ7g4pzbCNMsc/3FzuYfBI2o6XUo pqvOKSmYVVaRZa+zmZMzXu/0b8ob3k8dBBU4ky2OP5mauAuBBQCq/XMCcPOPVeD74/uM rHnb9PlpJQzt/peQZLFFBdtYoW8iKMZTjIdF5peu7LASxQ0CWA8oOWWX+3fwUsqkiy/1 aiSOC10JtTKP711NxrMwZyvS19Nn0nmMOI9mNMhHXAsJ/BUzq8swh6+4ueJEQSNUZYZB SQ12QYdzM7I8kN38YSwG6TeAbF5GhXc+oMCr02JWSZ3b97VsO961oHbQ8M+aWF7KNOG/ yaEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PVug25ZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u1-20020a17090a518100b00267ba1c43adsi8736857pjh.101.2023.09.26.10.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 10:39:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PVug25ZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 2952F8070674; Tue, 26 Sep 2023 09:36:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233879AbjIZQgv (ORCPT + 99 others); Tue, 26 Sep 2023 12:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235282AbjIZQgs (ORCPT ); Tue, 26 Sep 2023 12:36:48 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2554124; Tue, 26 Sep 2023 09:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695746199; x=1727282199; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=W9JR7UKiiB5qX/Bnbhhy9qpsfgN7ArWX+EkyPOjLqrU=; b=PVug25ZFyqoRbxS2OTEc6WKP+MQj1KgVq9JkX0l1QhazQcIEq2eeZyPO WCCELkgbPkU8MLqFZMM+mzxWwSYs5XKsrMVxd9ffwStO1Q0rDddIVAf90 VQdGkDlzSjVyCLz5tM0hKJtG3j93pyKIeay13uJGirEQVJO2jFR0X7Bao d5rfXxbTb5wdmale1bSqtFlFwwKIwqevv+STXrhB83N2K9hobRGdqu+50 Fihu2AsTvq8wi5MgPTbU9uhm87dyT/FER5E++WlKN4ds2/bB2JQXnx71m jIZUM0VWNcDjBSzhhmc99+hqq0Ksxrp+Ov4Il41ZpC6fLOrejvSU/LtX5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="380480448" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="380480448" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:36:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="1079766210" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="1079766210" Received: from linux.intel.com ([10.54.29.200]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:36:38 -0700 Received: from [10.209.130.196] (kliang2-mobl1.ccr.corp.intel.com [10.209.130.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 120E3580BBE; Tue, 26 Sep 2023 09:36:35 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 12:36:35 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [RFC PATCH 23/25] perf stat: Fix a return error issue in hardware-grouping Content-Language: en-US To: weilin.wang@intel.com, Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers , Mark Rutland References: <20230925061824.3818631-1-weilin.wang@intel.com> <20230925061824.3818631-24-weilin.wang@intel.com> From: "Liang, Kan" In-Reply-To: <20230925061824.3818631-24-weilin.wang@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Tue, 26 Sep 2023 09:36:54 -0700 (PDT) On 2023-09-25 2:18 a.m., weilin.wang@intel.com wrote: > From: Weilin Wang > > Update the hw_aware_parse_ids() goto to improve error handling. > Seems like a bug fix. Please merge it with the patch which introduces the issue. Thanks, Kan > Signed-off-by: Weilin Wang > --- > tools/perf/util/metricgroup.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c > index 07a82fa21..6a4404226 100644 > --- a/tools/perf/util/metricgroup.c > +++ b/tools/perf/util/metricgroup.c > @@ -2196,11 +2196,11 @@ static int hw_aware_parse_ids(struct perf_pmu *fake_pmu, > *out_evlist = NULL; > ret = hw_aware_build_grouping(ids, &grouping); > if (ret) > - goto err_out; > + goto out; > ret = hw_aware_metricgroup__build_event_string(&grouping_str, modifier, > tool_events, &grouping); > if (ret) > - goto err_out; > + goto out; > > parsed_evlist = evlist__new(); > if (!parsed_evlist) { > @@ -2225,10 +2225,11 @@ static int hw_aware_parse_ids(struct perf_pmu *fake_pmu, > *out_evlist = parsed_evlist; > parsed_evlist = NULL; > err_out: > - metricgroup__free_group_list(&grouping); > - metricgroup__free_grouping_strs(&grouping_str); > parse_events_error__exit(&parse_error); > evlist__delete(parsed_evlist); > +out: > + metricgroup__free_group_list(&grouping); > + metricgroup__free_grouping_strs(&grouping_str); > return ret; > } >