Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2144211imm; Thu, 9 Aug 2018 08:02:06 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzaJjsw088bEP8+BWHC8zseU3Hnt7oZlFzEJjw1JzQBuTCfIUsw30SSzRFbl5slKcazHLWw X-Received: by 2002:a62:e218:: with SMTP id a24-v6mr2798820pfi.75.1533826926144; Thu, 09 Aug 2018 08:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533826926; cv=none; d=google.com; s=arc-20160816; b=Naitpf6MIJAZZQVgyj2VsuuplubPDI8AWEWMa3xAlF2p8HH7630ZsNZXYvFSN+gcqk qjR+kScq+tecRTFtWDrd3maZxI2TLpyUZAWsUW26F7UGdToLsf1Vu2IIK/qOcmgQdoQj TWSel+0RfDLR/kJghikNPHnwWWQywgGVGubWQzTFe+rqdOc23NP7P03zA1HzNeFjF/fI 13S/QHuv57phZi9zJ1i9UInyCsBAEWzHjDo07l82pTsI78ihqTaGavDzkMBJA7jufiGV bfRm2FWCoAvOL9FhAF8hBMQKMvDbw4V0mNLGmqoXDT5ouN1oceTDEFB3w2eGoAIVvf4G 1KUQ== 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=PEy9u6H0RZrJu42rRHhAIRWtIGR6Vj6sxnQm2Bx9WZs=; b=xpaX09sJdxgGGn5q1sWpB8McyAj6XfeLEx7SoAiwqAC8v6tXTK/RzPe0553axXfO4a PUev+F2bkuhtIkfHScdNlTUWRsiLMq4RZVt2ixu7a/PNZbt5I9W4Ay613bOggJp5e88V lwXRIbkozdqP+0BL3q3iLaHUwVEbLYmdaSzzANEiAmBJBH6dTBrMmdW1CqoI6sW/XT1Q U2Gw3NKL92MO7U9q0o7pbx5/e5buTK+N/140kUmXTG/oGoTz8J1CVtixJFiCrIjdESmU oICK4tGuXR3OxPUO7rilqjCW8T3uY1eG1yLfJzRCiBQWjPg+hoA8LmXgP8uJjb97biNH LYIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zGXVeqaX; 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 j30-v6si7556287pgm.26.2018.08.09.08.01.51; Thu, 09 Aug 2018 08:02:06 -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=zGXVeqaX; 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 S1732915AbeHIRZj (ORCPT + 99 others); Thu, 9 Aug 2018 13:25:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:37266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732116AbeHIRZj (ORCPT ); Thu, 9 Aug 2018 13:25:39 -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 96058214FF; Thu, 9 Aug 2018 15:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533826821; bh=pWxuls/CLTjnXIYrnJS4WD/wDIoDqAOtYtlF1rCJ9x8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zGXVeqaXuczVvRYu3m4nT6Wne4qw5NTUwXY2XgKMRznhrqKiNhM4O2lvbjhI2Grl8 2xZ5eGlPOuae8yVOCdsbP2HnbSVs0GJPNadEJW5s5eT4/HtA+fr3hXy3kocojfnNcX LwBr521o9CJ+KUNmStdJilo0Vbi/qcSnje2gLieE= 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 22/44] perf annotate: Add PERCENT_PERIOD_LOCAL percent value Date: Thu, 9 Aug 2018 11:58:00 -0300 Message-Id: <20180809145822.21391-23-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 Adding and computing local period percent value for annotation line. Storing it in struct annotation_data percent array under new PERCENT_PERIOD_LOCAL index. At the moment it's not displayed, it's coming in following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/20180804130521.11408-11-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 2 ++ tools/perf/util/annotate.h | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index b7485a512da1..b37e8cc18668 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1781,6 +1781,8 @@ static void calc_percent(struct sym_hist *sym_hist, if (hists->stats.nr_non_filtered_samples) data->percent[PERCENT_HITS_GLOBAL] = 100.0 * hits / hists->stats.nr_non_filtered_samples; + if (sym_hist->period) + data->percent[PERCENT_PERIOD_LOCAL] = 100.0 * period / sym_hist->period; } static void annotation__calc_percent(struct annotation *notes, diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 3a06cb2b6e28..890b6869caa9 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -104,6 +104,7 @@ struct sym_hist_entry { enum { PERCENT_HITS_LOCAL, PERCENT_HITS_GLOBAL, + PERCENT_PERIOD_LOCAL, PERCENT_MAX, }; -- 2.14.4