Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2336334rdh; Tue, 26 Sep 2023 22:22:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHOzSWqnSwboPZCtNjZTNXUvlXqIGN6DS2/j5jhR28jB/YLLiGnV7pBNybltGbIfevyR85Z X-Received: by 2002:a05:622a:149:b0:419:51de:1d90 with SMTP id v9-20020a05622a014900b0041951de1d90mr974275qtw.44.1695792147144; Tue, 26 Sep 2023 22:22:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695792147; cv=none; d=google.com; s=arc-20160816; b=pow5tZbttKt/IlWxjB3wP53zpr6I5rtEIYdsuyRkIOmD9vax9JRCquHLAcqTQtMnGV 7gnKTBWhvG4OTViB8nN+tZuy+rUCXNogeEVj9Ijfj7Xe/kQsvvWCeV7V74kZB73hr/Tv hT1pO+x+oG3MR1yo4clXsxlzF6FtkSxV3a2MKNSlTwNR01s3wtm6xgw7L1TbEeW5d2O8 a184AntMywn5JjjuygWQcVxq+gEnckX/XscL87p8Pumg1wWe5ciMB9kzKJll/qUnn8MT 7S1Oo5aLTKf8pZX0SqkbICMD2T5HAM7T4PLWIQ4mC6ilRCcUHYFXCjkxfu1CW/oSi2HY Oy+w== 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=XcuAqCdxV0FYHbgVkriZ7HzuoGdqc6yk6nXo2RmhkzY=; fh=R1OkhriIwip1F03SPBPuQjbmUJVFiHc78tVoBI9xOtw=; b=oFOtdZ6zZMqwvMy65Vht8eEN6a2ic0TxhXJUfvKvvZYFGumOhXiuaaK6UCcsnpXfKG J2+XjxlcYqP2cVLxTKqnKwutPUaQAyP0xfF8vypDWUHeuzCWLkQOZw7fslIPDnAh9vlb wWRzw7HsDXbddjLIHyilb1xo4+KDouYChuzjAjK/Nvtzu4vY7tklhOLqqr7qvZXPfGlM B2lDHiFFb8dFTwPkRBc1zx3xiIUc8MAIjuqqg9Gu53i9fArPqet7BB6WKgYu/TUI4gNi x6OiuUQZJdINs+rU8MiOY+U900c+34d2fn0/HpmIU57C+CJtQYh4MpxNTJ3XDiIDCTc1 slmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a3ZmMJBJ; 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 k63-20020a638442000000b0057748a05fcfsi14345281pgd.27.2023.09.26.22.22.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 22:22:27 -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=a3ZmMJBJ; 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 2122C827719A; Tue, 26 Sep 2023 09:39:25 -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 S235323AbjIZQjN (ORCPT + 99 others); Tue, 26 Sep 2023 12:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235322AbjIZQjK (ORCPT ); Tue, 26 Sep 2023 12:39:10 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FCB2E5; Tue, 26 Sep 2023 09:39:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695746341; x=1727282341; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MDDhGr3aQovmHXfUFdXU2hLWgnvXegVFBPTQjWjZprQ=; b=a3ZmMJBJ57Swr3AnhBAlSNxRLlA5TqTufeGBWlYHEU3Y4fK4wUe0M24G K9yo15BuMvk4Nr+xRzFJvlAsw+nwxtSSydkj2lsW/9Y0aeeZlJcBoGTgP cF6VaDzfodllDMfFJbgHnbmjcVbRPYrSkNULQb6s9WuGq7dVDW1UbJUwB dFlJllCBeospOUYdQX0TFGmT/2ihu4x2bx1Y3FxMCP4hMBbKanEbQjAcb lqbRqU2/Q01tva7/MdflS7Js8RxkbiYmtUVKnItgg5T0Ud1vplnUmKnZJ magaIHVJ+48+0ESwViNIAlliSOZsnEa7K6Piu8ovX3ohbiW3NHs4iQZGH A==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="378890432" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="378890432" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:39:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="864459689" X-IronPort-AV: E=Sophos;i="6.03,178,1694761200"; d="scan'208";a="864459689" Received: from linux.intel.com ([10.54.29.200]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 09:39:00 -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 6C048580BBE; Tue, 26 Sep 2023 09:38:58 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 12:38:57 -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 24/25] perf stat: Add check to ensure correctness in platform that does not support 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-25-weilin.wang@intel.com> From: "Liang, Kan" In-Reply-To: <20230925061824.3818631-25-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:39:25 -0700 (PDT) On 2023-09-25 2:18 a.m., weilin.wang@intel.com wrote: > From: Weilin Wang > > Add check and return with -EINVAL when event json files do not support > hardware aware grouping so that the program could successfully fall back to > normal grouping without segfault. Seems another bug fix. Please merge it with the patch which introduce the feature/bug. Thanks, Kan > > Signed-off-by: Weilin Wang > --- > tools/perf/util/metricgroup.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c > index 6a4404226..1c89c9371 100644 > --- a/tools/perf/util/metricgroup.c > +++ b/tools/perf/util/metricgroup.c > @@ -1684,6 +1684,8 @@ static int metricgroup__add_metric_event_callback(const struct pmu_event *pe, > struct metricgroup__add_metric_event_data *d = data; > > if (!strcasecmp(pe->name, d->event_name)) { > + if (!pe->counter) > + return -EINVAL; > event = event_info__new(d->event_id, pe->pmu, pe->counter, > pe->taken_alone, /*free_counter=*/false); > if (!event)