Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1243352rdh; Mon, 25 Sep 2023 07:16:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHH16raD4gHvFm5nnAcrttIKaA6L+DLY6O6wwh7WpFJvtNz5ZaUg+bcRWV002oYc82AQChm X-Received: by 2002:a05:6358:3398:b0:143:5383:af8b with SMTP id i24-20020a056358339800b001435383af8bmr7438893rwd.11.1695651369739; Mon, 25 Sep 2023 07:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695651369; cv=none; d=google.com; s=arc-20160816; b=P6F1IQszoz5wPeEcp47Hvv/94AyGNTVa/J+tIZactLhtRVhpv6bj96G12a5BIz3+ky HT6m/PEPk+Hby+EWbdx9TgkPe+3OA1vx9F6sNp1xRNoKLMiTw0zFgJP+uH71RVUOOxZb kMQAoT4T1F6VJQgsZC9jHXalvs1lL6RnCBZIpnV8c0fL4WAWS92VURhB0djfpkTU+9dy /UVcRD78C+M1valoVr/umeQoP8bvznHFMqvkuOgoLAVBkt2NrHuRi9FMZAhRE28RCe/P 5SV4XdgsnMATMSXpzOi7JyrTqkFBnshpLekuVpl7/iVBnBAFqrc3qlB3QhB+NR9cfv/w zeSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n5fRELpjF/M3H2TtLNvTJKrMln6iYPrW69mL3rlkf9o=; fh=aicQXd2sVDKynU70/92qv+8AnsPgYK5pq7fTzS41MP4=; b=vKjGm0s7zwFMCpgyk8furQ2DxlbNtHa0nHSbpKHLZ/mVb8o1tSakKXXNnDmqajYA/p xqyO3pqlp0hFY6M/KTpMhAEeeDIE43i7IwjLm0DpJVTyMc9RW8UYaUd6+kzzjrNvTTp2 vrye5b3v47gTkxQaevso7t6jrmr+3OSZ88fWTu5PQgU0gPTa3kfq37MK6Bs4kNouP75b uCZvkgxZnhl7e8FhgzcUPvUMQf6vXukCpCktQlc8JspnvEi86SYElLtBhFOfR0z3EFae qGm4V+IYyRoKo3Ylc8PrO8qzzS5g7hF/zD2gNMPY7Yn5bH3IApZQlTzinOsZOL3SjAZm BQoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VpRD9ZYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id l11-20020a65560b000000b00565d88203c8si10100725pgs.535.2023.09.25.07.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 07:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VpRD9ZYS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 7EAAC809D3CC; Sun, 24 Sep 2023 23:21:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232297AbjIYGVV (ORCPT + 99 others); Mon, 25 Sep 2023 02:21:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231993AbjIYGUR (ORCPT ); Mon, 25 Sep 2023 02:20:17 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BA513A; Sun, 24 Sep 2023 23:20:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695622809; x=1727158809; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I5V/buEAfvb6fu9N9WAFdvgwgtWYdT9HlyKiL8iOkic=; b=VpRD9ZYSFyZkzkQcpFUBxsTNixSB18VhhyuH/V0tpoL/VXMRwcYJU7Qq NX/UjXDAOySymQs2NaBt/Z9mqfpSDTxMpF/4oEVO3/bmizmS7vNl8oXM5 cPc+04CNNfirckRap8j4iuG0UKsMuCYd1SvNV/5JfVB5DPOd8kJZdMicX YyL54Ky1h/HcmhQNj91pwUkC2Q512uRdysYWw6g6tMwADO+gRKAu/e8wE r2UGz+twgfEIFaEjdRji8cJ7tCYfkHafBo/TDJRFIJeKmWyVa2Hm83/bH eBsh091sIPWqqZEHPcU9OWJRmVGLvjcpFwHpVYsgbEZCgqBbaUcnBULN5 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="445279563" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="445279563" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 23:19:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="818494442" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="818494442" Received: from b49691a75598.jf.intel.com ([10.54.34.22]) by fmsmga004.fm.intel.com with ESMTP; 24 Sep 2023 23:19:24 -0700 From: weilin.wang@intel.com To: weilin.wang@intel.com, Ian Rogers , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Kan Liang Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers , Mark Rutland Subject: [RFC PATCH 23/25] perf stat: Fix a return error issue in hardware-grouping Date: Sun, 24 Sep 2023 23:18:22 -0700 Message-Id: <20230925061824.3818631-24-weilin.wang@intel.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230925061824.3818631-1-weilin.wang@intel.com> References: <20230925061824.3818631-1-weilin.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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]); Sun, 24 Sep 2023 23:21:25 -0700 (PDT) From: Weilin Wang Update the hw_aware_parse_ids() goto to improve error handling. 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; } -- 2.39.3