Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2147287imm; Thu, 9 Aug 2018 08:04:08 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwmrxXqrU6Qf7pjQOzSQB/+5q5dbR/NXnlmKTgCKHYOpom0Fs/1f+j8Irt9S5TpF7/LLZYn X-Received: by 2002:a63:24c:: with SMTP id 73-v6mr2604306pgc.252.1533827048362; Thu, 09 Aug 2018 08:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533827048; cv=none; d=google.com; s=arc-20160816; b=it124BxwMdVQWoC0W1dUXapVEN9uYV6vkELDBX6gdkSG9nZC2AWaVoT5XPDlsfYeCm hOAE/AAcACwRxrdItqz0+w/DAkmimdJGsgQuMnTrZbiOAa52eAC91j3FpO/H+sN+olqV rIVwwKiqWnEXlgX5f9rvJMSI+vnZR1ojXGcxaOtC7xXjsa49Gj6wgVFIeFrJS840S2ed tkTAzXL7N4xoMwO5gK43xDDu9WpmoUtFJ9BSVijePmfLBlwcmyUgCr0o0t6Wsok0h/UY Vo3pxMXt1u0+guMgy6iafeVzXd2ML//au+5DKaO39N8oBT+9aIq0JzS7d1OT1ZudrS5S OH+A== 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=3UuHJR1o8O8mEUDJYLAD/zJy/+G4KmeWhXLLTmyBbn8=; b=cpsSnV3L97zbPjNFGWPYRkTzLAsczulzLGm0yVIKrULmxhmQuK+iu8gaXVsm2e8Fmu LluDAdSkl1HhLgFLCSTpdfnpJMxR1BSGxNaUiOs3BTmYYouXSVSsPzKv28kcehpwPxhl TOT7PGyafzamn87/fR1ijc3LnpYmoMUxdsZyDGhnTcH054M8z6enpLiBjRBz7yaxyDSu qJD7jOwknuX4bfkHi4MFNAQzXz0uw1xASUG6ZLR0zauj5CdtbZj8QIuMhLQy4ESfj1mc AXwoRfLlGTcWxeqS8tMX2EocsokWTQobs2KfvDsLebKd9X5V61iG5jndhILme4bn7yEj 9jOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="sDN+/1Ko"; 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 h4-v6si7790891pgm.441.2018.08.09.08.03.53; Thu, 09 Aug 2018 08:04:08 -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="sDN+/1Ko"; 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 S1733067AbeHIR0c (ORCPT + 99 others); Thu, 9 Aug 2018 13:26:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:38360 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732116AbeHIR0b (ORCPT ); Thu, 9 Aug 2018 13:26:31 -0400 Received: from jouet.infradead.org (179-240-153-38.3g.claro.net.br [179.240.153.38]) (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 0587421DEC; Thu, 9 Aug 2018 15:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533826873; bh=nOI7fMlqg/kTCVhk3dhWPGmVf9Mxi09yN6jwgJn0JKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sDN+/1KomAMa5szPTh3i75KyjoMHGJQFRtgLnvwzO8y/mxLZRtDyGQ1OQFpjy8m2k NOGyJPgkkdsygV3MpuRSSexMSgNXg3OEch3RutAhFsS1SHpDHW0m7UbwMUOqdpziOQ C4kmNxuQ3P56w5aTWjy+xI476UaXtVR6KLjmN51I= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Jiri Olsa , Alexander Shishkin , David Ahern , Namhyung Kim , Peter Zijlstra , Stephane Eranian , Arnaldo Carvalho de Melo Subject: [PATCH 32/44] perf report: Add --percent-type option Date: Thu, 9 Aug 2018 11:58:10 -0300 Message-Id: <20180809145822.21391-33-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180809145822.21391-1-acme@kernel.org> References: <20180809145822.21391-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa Set annotation percent type from following choices: global-period, local-period, global-hits, local-hits With following report option setup the percent type will be passed to annotation browser: $ perf report --percent-type period-local The local/global keywords set if the percentage is computed in the scope of the function (local) or the whole data (global). The period/hits keywords set the base the percentage is computed on - the samples period or the number of samples (hits). Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-21-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-report.txt | 9 +++++++++ tools/perf/builtin-report.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index 917e36fde6d8..474a4941f65d 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -477,6 +477,15 @@ include::itrace.txt[] Display monitored tasks stored in perf data. Displaying pid/tid/ppid plus the command string aligned to distinguish parent and child tasks. +--percent-type:: + Set annotation percent type from following choices: + global-period, local-period, global-hits, local-hits + + The local/global keywords set if the percentage is computed + in the scope of the function (local) or the whole data (global). + The period/hits keywords set the base the percentage is computed + on - the samples period or the number of samples (hits). + include::callchain-overhead-calculation.txt[] SEE ALSO diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 02f7a3c27761..143542ffac20 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1124,6 +1124,9 @@ int cmd_report(int argc, const char **argv) "Time span of interest (start,stop)"), OPT_BOOLEAN(0, "inline", &symbol_conf.inline_name, "Show inline function"), + OPT_CALLBACK(0, "percent-type", &report.annotation_opts, "local-period", + "Set percent type local/global-period/hits", + annotate_parse_percent_type), OPT_END() }; struct perf_data data = { -- 2.14.4