Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1853105ybv; Thu, 6 Feb 2020 11:00:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzzTOhCR3Z7Y13BLUNYSwfCYOW97bPqtoRa+hpKx/JhDuCBaS1QEPEu/CdPqmLUG3btvrcz X-Received: by 2002:a05:6830:4a4:: with SMTP id l4mr31930004otd.91.1581015631518; Thu, 06 Feb 2020 11:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581015631; cv=none; d=google.com; s=arc-20160816; b=U7Dmf1r8e0I+2dpcFdauRtUUVfhyP0vWb83ExhKmTYvI2SbWUnGTIga1ZHcZCxmXAJ X5617I/moRQiA5Aakz55H2rP81ns65nsigonWB0MEdpYETgQBmUsIH8DlyFcI6VAt/2Y XLl1JR9zWJ/gWENYd7WX7mLCGFJW1qCwT3bbh/bXmHKU7kIdHHu/3WJq8j2cSvvvwxg/ tkckhfS0FqpCbS07iVdno9VjGUhhJNkP1+8FgSsB8ia7T7F61/kgiBzMkNbFzpvJ59zD rCtpKgyvVtUhD4jvJaBSwdGinVuhJ3IBI7WHy73jSD7lY3z4NbFMi8rAFDaGmIjJJSrL YuSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=zAdKK3HyMN1fo6LRX9H/DMhR0viTJt18yHnJMK2zDEg=; b=Ctuzoj+JfbRteWRm6t2TZfcSb/ZXDu4vK87kCONST3EhfOp2YDanaTnoNPKH067tFi 2JIUa5caEwGK9MZ3Mh8psn5Z0+By2bXDQeqH+B3tVKLx/iHk6Z/eZk1NsEqri8nwrRW4 MggQA9XBZwUZ5wclyOzwbVyhCIKa5bKG+q/DHIWBmmAOJimbBkUAB78KZQYQqM+Mykrx eVTAKwa6Yl/GcD5EiCMs24v+fbqturxiTJRvYmvwbureWv6oeQcOdkHJeuOARB6K6N4w rSGFQUXgT5GVhYrjhiL8IDi4CSz7RpGhvev7WkswgvAZRolGqDKr9sdFZhf6ywoOina+ yBOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l83si2501472oih.58.2020.02.06.11.00.19; Thu, 06 Feb 2020 11:00:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727831AbgBFS72 (ORCPT + 99 others); Thu, 6 Feb 2020 13:59:28 -0500 Received: from smtprelay0102.hostedemail.com ([216.40.44.102]:41289 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726990AbgBFS72 (ORCPT ); Thu, 6 Feb 2020 13:59:28 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 4FBF3180301AE; Thu, 6 Feb 2020 18:59:27 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::,RULES_HIT:41:355:379:599:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2525:2553:2560:2563:2682:2685:2828:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3352:3622:3865:3866:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6742:8985:9025:10004:10400:10471:10848:11026:11232:11658:11914:12043:12296:12297:12438:12555:12740:12760:12895:13069:13255:13311:13357:13439:14181:14659:14721:14777:21080:21433:21611:21627:21819:21990:30022:30030:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: wrist39_523ece1de781a X-Filterd-Recvd-Size: 2302 Received: from XPS-9350.home (unknown [47.151.143.254]) (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA; Thu, 6 Feb 2020 18:59:25 +0000 (UTC) Message-ID: <51a4b570eb47e80801a460c89acf20d13a269600.camel@perches.com> Subject: Re: [PATCH v3] tools/perf/metricgroup: Fix printing event names of metric group with multiple events incase of overlapping events From: Joe Perches To: Jiri Olsa , Kajol Jain Cc: acme@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Alexander Shishkin , Andi Kleen , Kan Liang , Peter Zijlstra , Jin Yao , Madhavan Srinivasan , Anju T Sudhakar , Ravi Bangoria Date: Thu, 06 Feb 2020 10:58:12 -0800 In-Reply-To: <20200206184510.GA1669706@krava> References: <20200131052522.7267-1-kjain@linux.ibm.com> <20200206184510.GA1669706@krava> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-02-06 at 19:45 +0100, Jiri Olsa wrote: > On Fri, Jan 31, 2020 at 10:55:22AM +0530, Kajol Jain wrote: > > SNIP > > > ev->metric_leader = metric_events[i]; > > } > > + j++; > > } > > + ev = metric_events[i]; > > + evlist_used[ev->idx] = true; > > } > > > > return metric_events[0]; > > @@ -160,6 +161,9 @@ static int metricgroup__setup_events(struct list_head *groups, > > int ret = 0; > > struct egroup *eg; > > struct evsel *evsel; > > + bool evlist_used[perf_evlist->core.nr_entries]; > > + > > + memset(evlist_used, 0, perf_evlist->core.nr_entries); > > I know I posted this in the previous email, but are we sure bool > is always 1 byte? would sizeod(evlist_used) be safer? > > other than that it looks ok > > Andi, you're ok with this? stack declarations of variable length arrays are not a good thing. https://lwn.net/Articles/749089/ and bool evlist_used[perf_evlist->core.nr_entries] = {}; would be better.