Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1233351imm; Tue, 5 Jun 2018 11:05:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKb2f0MYFbhU1d0Vc6ZHsSWM82MsM6T3M70Bh/6pKd1pG+eFDFMlzOV0Xns98qc8Z4J5xa1 X-Received: by 2002:a17:902:14d:: with SMTP id 71-v6mr27437572plb.275.1528221936798; Tue, 05 Jun 2018 11:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221936; cv=none; d=google.com; s=arc-20160816; b=htZERD0Ge0KEntdLPiKMTOzrOZkdfzhM9Q2Wm3XIeVBe4vz1rHXLPxfG/9SLLzaYj0 vk28t6Uvu+9PsN1vvgyujYLsLxYOv/xdfM3cib6n4mP53g+bU0VQkGC4dc+SCFx+Qs3X Pq5cSNYafualvGa+adQXSGY1FUCUl5Lr+vqUqckk2kay8134lWZnn4ioWi2VzTrcx5a5 0hTg8MPLBKXYLuWRtwU36o6Md5mO8BmQ2ZIZhDrv203zZCHMzJjVmvAuPNYOo1CRwFKR o5ugy1Bk4fWzCEBhxl1kZIos3x2ed15tl1pXTV5mXSMYYWMioKxHiV6ohYB86u+kZJti N9Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=kIgdYq5BYpY22cQgLFPr1PJhK3FoVs2gxlI6HOv2wME=; b=MJe4D3BZV4jd/XSeUDF/SaiAwx38ASQhaW2p8/XPszmoMK0vB+YYRk44Jiej/IJoCd 1D3U6UajbwGbE025dpxFEtJiW2YAYEFZgX9vZsxW54DH0g9Md+07mqJxzotHuAGRIh5r 5emC5ASMwVBVLFtWEKpeI+VXE2jeeHon3rYckwcsmzJdlzYxJ0hp7vWYOZ3IfECJsCNC 9ofse5v5tQCf1aRgF7emL5wzGQKBUmZVma3nRZm4J9lgj9D2rZG93qSI517QVuTMqt0v yulCxSV2D5iHHkSsxJjc35da/bFOXJc5YBANWcBth9xjU3QAcddC0QgGhbIfEtQIMkMD osfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v2pDoBej; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21-v6si48203457plp.199.2018.06.05.11.05.22; Tue, 05 Jun 2018 11:05:36 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=v2pDoBej; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752789AbeFESDu (ORCPT + 99 others); Tue, 5 Jun 2018 14:03:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:45884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752382AbeFERv3 (ORCPT ); Tue, 5 Jun 2018 13:51:29 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ABD9C2077B; Tue, 5 Jun 2018 17:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221089; bh=dy+tz0mRpSx+luVU8XDLb/y54be41WWUCeQzRv+I3Qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v2pDoBejG7aHddVcV4LObm4EheMApKvrXTjmaag2AjRTRsDDiRk5lYK80AF4eyj1z kMdcuf+8aRx+vj3/fdX0va55OrIv28/tclba6gNsvYfNPdellI7hvdN2wt6dkWof/y cNeCf640Uz2IZtmKpc/JuX0F1U/UO8RRq0BKDoQA= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 16/46] perf annotate: Add comment about annotated_src->nr_histograms Date: Tue, 5 Jun 2018 14:50:00 -0300 Message-Id: <20180605175030.32549-17-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180605175030.32549-1-acme@kernel.org> References: <20180605175030.32549-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo When we have multiple groups in an evlist, say: $ perf stat -e '{cycles,instructions},{cache-references,cache-misses}' sleep 1 Performance counter stats for 'sleep 1': 343,134 cycles:u 249,292 instructions:u # 0.73 insn per cycle 15,556 cache-references:u 8,925 cache-misses:u # 57.373 % of all cache refs 1.000957550 seconds time elapsed $ Then the perf_evsel instances for the two group leaders ("cycles" and "cache-references") will have evsel->nr_members set to 2, while all the evsel->evlist->nr_entries will be set to 4, so we can't use evsel->evlist->nr_entries everywhere, as event groups need to be taken into account. But this probably requires us to audit at least the forced-group code, where we want all of the events to be in a "group", to see them all in the screen, one column for each, even knowing that they were not necessarily scheduled to count at the same time by the kernel perf subsystem. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2g0vwqnc49wl4ttjk8dvpgcc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 7ad503fbff74..3dc4ca1d6c08 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -202,6 +202,10 @@ struct cyc_hist { /** struct annotated_source - symbols with hits have this attached as in sannotation * * @histograms: Array of addr hit histograms per event being monitored + * nr_histograms: This may not be the same as evsel->evlist->nr_entries if + * we have more than a group in a evlist, where we will want + * to see each group separately, that is why symbol__annotate2() + * sets src->nr_histograms to evsel->nr_members. * @lines: If 'print_lines' is specified, per source code line percentages * @source: source parsed from a disassembler like objdump -dS * @cyc_hist: Average cycles per basic block -- 2.14.3