Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1915822ybv; Thu, 6 Feb 2020 12:12:31 -0800 (PST) X-Google-Smtp-Source: APXvYqwH8duwpHfZarpP/y7NvdBYVmjAkIMPBaMdZ+oB5LWV5PILWjBPQuX2gYtnIy8SgV/AX0l5 X-Received: by 2002:a9d:6289:: with SMTP id x9mr32467623otk.8.1581019951464; Thu, 06 Feb 2020 12:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581019951; cv=none; d=google.com; s=arc-20160816; b=pdbq/hCqvJZhrySvg/y4WzFRC/QikbaOa64xHJ73VbU5YwxMnzZNrFlVn0XejZM0ke 3j9u00NBJgsmfkX5FLR1tzLldU7KCORU1ifsZgZ++70nmm6Z7/udYCGbCLNxgVNwzEvy I9VFaTciwHMrMaTm2F6j1q+zvzTyqmsiuEAA2tLikFQ6/COTvAmveqAiW8S7J7yYIDBj +1SwLSSWv+4/zRQChAkfEJQ8FyAxwA8Y5BaO5Snlv5iIXlMZgSZ2Ovl9HL/H+V/E97fr yuu8Rk0Yq0BA+/7Nah5NqP6QcSm/uaQIvnUoH3UrmEnsoO2Te9z7Ffa0eD/PHubLkoBf JN9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xuX10ml97h9kTAkZbAOqjYuWr3sQjPbd/pUejqsSPjQ=; b=uPPYiflXTPqgsOje7u6weY+MyVtSOJBJ6uU1VQrCmObDeBFJpoLOLAvd7GAljTl4jP hFRy/O1LaONZvW0QOaWkYgrsYh6VfW75fa3oJLZ3EkOvqRVHkjcpf736UNzR7ELlpLwL yCLtKUp+aqMeehFLajavRVzrZuWXQAZAoXIPHj1VML23ru5eOSPxmMCK8bkf5dik9Sfa l2IdU7tg4VYllvxZCTl0N435WJmJRF6sCUoiUCA+mL7lTMKwqMoCE2FolK/JxCW0TNw5 70LwSye8Pym9XGhpyFRueFZBYxat0ZqvC+dGREUw0DeipJBdCVvs15ffcbzhm2HeymUP frDQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si379767oti.22.2020.02.06.12.12.10; Thu, 06 Feb 2020 12:12: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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbgBFUKZ (ORCPT + 99 others); Thu, 6 Feb 2020 15:10:25 -0500 Received: from mga01.intel.com ([192.55.52.88]:52228 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727827AbgBFUKY (ORCPT ); Thu, 6 Feb 2020 15:10:24 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2020 12:10:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,410,1574150400"; d="scan'208";a="225348205" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga007.fm.intel.com with ESMTP; 06 Feb 2020 12:10:23 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id F37893003A2; Thu, 6 Feb 2020 12:10:22 -0800 (PST) Date: Thu, 6 Feb 2020 12:10:22 -0800 From: Andi Kleen To: Jiri Olsa Cc: Kajol Jain , acme@kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Alexander Shishkin , Kan Liang , Peter Zijlstra , Jin Yao , Madhavan Srinivasan , Anju T Sudhakar , Ravi Bangoria Subject: Re: [PATCH v3] tools/perf/metricgroup: Fix printing event names of metric group with multiple events incase of overlapping events Message-ID: <20200206201022.GN302770@tassilo.jf.intel.com> References: <20200131052522.7267-1-kjain@linux.ibm.com> <20200206184510.GA1669706@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206184510.GA1669706@krava> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 06, 2020 at 07:45:10PM +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? Yes. -Andi