Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp612538pxb; Wed, 20 Jan 2021 16:02:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhVFHWYtKn7XfaXztWVEFxT1zU48ZQjZn+mjP4PAxVXNruXw2GrOXWd2UhdKhXxFb4WIzJ X-Received: by 2002:a17:906:b106:: with SMTP id u6mr7310852ejy.313.1611187366025; Wed, 20 Jan 2021 16:02:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611187366; cv=none; d=google.com; s=arc-20160816; b=R4yioxnKJuuDe/QShrAPR/MpECaU7HTpHQ426HRTM1zUzCxMziZsjdr5v8Znhyw444 a/sWvNXbPpeSdbj2WgE+WlzhUNHQIrwtzE3tq8T4r4lt2KXWvueBhzUfZk4DIIi1Y94v pXnyjFlLLTBNgihq7cBkdYTPXNcS178bmorQHMz5MgzrNSezukzcVnlZpT1vY7RS8B3N ew6tcWyHUB9uppOIvPz/ydegVsDrdMUOLgr/EUZAeTRul6/wF0uoX7W3KCXTPrjLKnjA /pXaED4QVCsaU8Mn3tXC3qL4tN5qcjFq5vw2QoOicWfM/yqJrhS4uiy/UIS27Kzfy1tD 4h8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=A6+8Tuy0shZJE4X0cyaUDSZDq1oqmw9x/zn4yiM/SAc=; b=ZmcJtIz4Ka4lWIjoegPvTfdDfQcL7+CsNEs60Z7KE7B+cer7kvAJjmpusenSUHNDpo Xh0jQSYsXj2CMLeWZ/R9OSU9JnXjwDRB+QLEsun+7d6wEXrXMOu1cTPIFXUG2VbHRnlq ttifIgcHlgoY/7B8H13oYRREF4qPgNEC+eJeZbxba81qFXEg9yM+jYohP/bC/vROsZLN y66rYahJE+1/Gwc6WjOMkJHDUswgkchsjQ5FRO8AcbXZVBURpt7ra5u+Wj/LulUUDu35 yos/iBfs5HeslgF9scEKPI/q4ayJHhCNArE0C2FL5KfpNqrNjd3cnq1g4T0074D+OG/X eUaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fnH5kUzU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k24si1388454edq.376.2021.01.20.16.01.43; Wed, 20 Jan 2021 16:02:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fnH5kUzU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389570AbhATOWU (ORCPT + 99 others); Wed, 20 Jan 2021 09:22:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46783 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733032AbhATM57 (ORCPT ); Wed, 20 Jan 2021 07:57:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611147393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=A6+8Tuy0shZJE4X0cyaUDSZDq1oqmw9x/zn4yiM/SAc=; b=fnH5kUzUgfVke5KL65qflmbF+vCB8d9YMvvSpA8lqzobCkJ18ARTix2ejfggNX7S9IBnHk z4aHVxGnp9UAQWpQ2GV7DztfS3GpUIY9ZYtzceTc1BNEp1Di8YQ4nwWIAb1+fhv4eVxqox Zvms7LCjvRHpq1xlwKNcKFTOUWU+klY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-475-vSNXAU4BOtWTd9Z0a0rfIg-1; Wed, 20 Jan 2021 07:56:29 -0500 X-MC-Unique: vSNXAU4BOtWTd9Z0a0rfIg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2C2BC192D785; Wed, 20 Jan 2021 12:56:27 +0000 (UTC) Received: from krava (unknown [10.40.194.35]) by smtp.corp.redhat.com (Postfix) with SMTP id 3FA135D9C2; Wed, 20 Jan 2021 12:56:23 +0000 (UTC) Date: Wed, 20 Jan 2021 13:56:22 +0100 From: Jiri Olsa To: John Garry Cc: Joakim Zhang , "peterz@infradead.org" , "mingo@redhat.com" , "acme@kernel.org" , "mark.rutland@arm.com" , "alexander.shishkin@linux.intel.com" , "namhyung@kernel.org" , "irogers@google.com" , "kjain@linux.ibm.com" , "linux-kernel@vger.kernel.org" , "linuxarm@openeuler.org" Subject: Re: [PATCH] perf metricgroup: Fix system PMU metrics Message-ID: <20210120125622.GE1760208@krava> References: <1611050655-44020-1-git-send-email-john.garry@huawei.com> <4a876638-3c92-4a49-1925-0ff20c5d42b7@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a876638-3c92-4a49-1925-0ff20c5d42b7@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 05:33:13PM +0000, John Garry wrote: SNIP > Please try this: > > From 2380f1ef0250e6818b3dbc7bff4a868810875e2a Mon Sep 17 00:00:00 2001 > From: John Garry > Date: Tue, 19 Jan 2021 17:29:54 +0000 > Subject: [PATCH] perf metricgroup: Fix metric support for duration_time > > For a metric using duration_time, the strcmp() check when finding identical > events in metric_events[] is broken, as it does not consider that the > event pmu_name is NULL - it would be for duration_time. > > As such, add a NULL check here for event pmu_name. > > Signed-off-by: John Garry > > diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c > index ee94d3e8dd65..277adff8017f 100644 > --- a/tools/perf/util/metricgroup.c > +++ b/tools/perf/util/metricgroup.c > @@ -280,6 +280,8 @@ static struct evsel *find_evsel_group(struct evlist > *perf_evlist, > */ > if (!has_constraint && > ev->leader != metric_events[i]->leader && > + ev->leader->pmu_name && > + metric_events[i]->leader->pmu_name && > !strcmp(ev->leader->pmu_name, > metric_events[i]->leader->pmu_name)) > break; > -- > 2.26.2 > > > that's fixing the issue for me, this was crashing: # perf stat -a -I 1000 -M L1D_Cache_Fill_BW,L2_Cache_Fill_BW could you please send it formaly, so it can be merged? I can't reproduce the original patch issue and I need to check the code in more depth thanks, jirka