Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2145121imm; Thu, 9 Aug 2018 08:02:43 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyB7xBq2ZDHq078VkAZMfpXtVmOqPP1Yd2abnXYEEgu49DnRxyqKDcl6v77SnGLwZIxwkds X-Received: by 2002:a63:6441:: with SMTP id y62-v6mr2518746pgb.240.1533826963847; Thu, 09 Aug 2018 08:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533826963; cv=none; d=google.com; s=arc-20160816; b=nO2UjUtsaUp0/VhOmZi2cBsY0WOHclxsVLbBqJAMiBAUzAHcNnwD083uI9J5ATTj1M oiDu0pdoe7GUgY4dvxljLaoOFZUqyFoXHlbq3M7/+aEX5eG/LSlb7NRxvUi1VOPayn8E 949RcbJC5q6swkwXg9u68scjPEvF4O5IsuysZj4Zjyh4aomslckuK+zAklTjxFLPGmaH 7bbMCvwl40OQxNaMI5VpRMvHXxJsxE0ZOpje7XYzqCJoa6qDVUPGxOWAY3amG4+oCb4R C0Bx3xABEbWxKQyGahpq/UvkNwCEFnc/8U7oF9NrBgj/7hKUzFCynMgTez3evct1GtYv VMeQ== 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=AzPy2W7qcaLyiOIsj5CQfv6LIubyRyDmgx6RPJP91sQ=; b=Hb5JHTVL6LrybBCpTrv7TZ3KOKV7YpR8PVLRgrmUN7bBqeZk4AUrXSIhEEtv1a/YTR VSeZqC79FcuDewYjF0txLbqz0Dg5F1ID5Y0+XrESfYzuifGROVID2LovEW94n1xnfaHp V3l0uVU0dTqH5Iuipmjj4+jOIRHN9FO2J805Yi2X7n/7RZkjcS9q/yGcipCYS4w1WKLb fqC8PPssNdGRKCQRCUCBonS8Sp1hROaRzYwcc0lLlzklh74X+T4CooRV4RHMxI739ksl t1NVJQQhBqurXjJZmpvxDN551jqOQCV/naos/wT7O1Yi9u2lHUmkXmPSVFTuRbo/A+Ih +hvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R3wFCzwh; 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 22-v6si8127423pfy.169.2018.08.09.08.02.29; Thu, 09 Aug 2018 08:02:43 -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=R3wFCzwh; 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 S1732928AbeHIRZo (ORCPT + 99 others); Thu, 9 Aug 2018 13:25:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:37322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732116AbeHIRZn (ORCPT ); Thu, 9 Aug 2018 13:25:43 -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 833A021D62; Thu, 9 Aug 2018 15:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533826826; bh=HpnBCk2sCquqoeWjvJNuhgtDwttdmYhbVVFv89MLqsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R3wFCzwhX/gGvuBdKuyEXtbefbgRzG+ZxI2FUXFHjlzDSer4K2sH3mgwWnuwFLuET VI9t6/PvMhpO/hgx1YgaHECdb4CrAn4b+xjMA2E5hipwKDBIEwnEmlj0qw6/Fmajg1 K9If83gIonhLlhttNaK4BsXMMbb7iqx5g9ZgKraA= 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 23/44] perf annotate: Add PERCENT_PERIOD_GLOBAL percent value Date: Thu, 9 Aug 2018 11:58:01 -0300 Message-Id: <20180809145822.21391-24-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 global period percent value for annotation line. Storing it in struct annotation_data percent array under new PERCENT_PERIOD_GLOBAL 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-12-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 3 +++ tools/perf/util/annotate.h | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index b37e8cc18668..e890164592b0 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1783,6 +1783,9 @@ static void calc_percent(struct sym_hist *sym_hist, if (sym_hist->period) data->percent[PERCENT_PERIOD_LOCAL] = 100.0 * period / sym_hist->period; + + if (hists->stats.total_period) + data->percent[PERCENT_PERIOD_GLOBAL] = 100.0 * period / hists->stats.total_period; } static void annotation__calc_percent(struct annotation *notes, diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 890b6869caa9..48fe2aa6b5a8 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -105,6 +105,7 @@ enum { PERCENT_HITS_LOCAL, PERCENT_HITS_GLOBAL, PERCENT_PERIOD_LOCAL, + PERCENT_PERIOD_GLOBAL, PERCENT_MAX, }; -- 2.14.4