Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2144517imm; Thu, 9 Aug 2018 08:02:18 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz+ZDK9rjnGs1MKfVLmsdAxS+docyukpwuumvNf2hRmkxWWpvBahaD2caL0CnU3xIdRi8ba X-Received: by 2002:a17:902:7587:: with SMTP id j7-v6mr2398299pll.256.1533826938877; Thu, 09 Aug 2018 08:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533826938; cv=none; d=google.com; s=arc-20160816; b=ub0cj2jENtBd7ZQ26gjwsdnboC6NRBLajarfEIjontXaERVAhU8m9oGFFCkS2L6dI9 KdoX4dSaMHmgVRO+0YKR61ESS7dJpnKfnYVQPeXdmW/p1x+uZeztsjTXaY7RbKUtaOIb GXGdsa7Pr7AvKnQR1dEbcpy52WHzS+H13BW+yhwxBew/uXu2GvMkd8llHDrFWJbjtUa8 0a4HS8JepJU5xqQgWIApGjyD3pbjnxaWBW2zga0t6Xyow4vMaSVxN4zuyAN8hrb05a1S 2TcpEtFXGJq6VHsGcNJGneyOjAhROXneLiZIt/OyFIkLBeuM+IV9RAUI97M40iYMmSl0 fiIA== 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=a6G8yCeQZxFqyiOz5k/dP34VZwEB7PRI9QmOrnge6P0=; b=PgVgPWHu0aNYkAxtcw+IJs5CA3TkPa+LWbq7Uhn4iETXI9zUYpy4BIYOQa5ZW8GBzC W0aOVbYwE0chxD6eh0JErdrh8c/198uANWQFxHhcOKyRADnU+VsITa2Kl0GeGpsY0BMM MZt0es3/IC7ENBlwdnQd+HYz/URHLQFljvaWYMLt9tYb/PTPq/gPl/9LMPm6J3ypnlWK BLGEAyu+uoRPuiUPslzpto2BpSltrq/oVqPCuA+G4A2LSlukv6h8YI54Ir4cT7X+8jCE UKDSNb7ImdE2FraoysGWPuoXjUcxDW4vD3mZImZ5cYC4LDhyfBGtF7xXn3wA2egbBGuK qXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nzuoQVuQ; 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 x21-v6si5939474pll.24.2018.08.09.08.02.04; Thu, 09 Aug 2018 08:02:18 -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=nzuoQVuQ; 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 S1732961AbeHIRZx (ORCPT + 99 others); Thu, 9 Aug 2018 13:25:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:37458 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732116AbeHIRZw (ORCPT ); Thu, 9 Aug 2018 13:25:52 -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 0587721EA2; Thu, 9 Aug 2018 15:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1533826835; bh=y0Z2s47tfbJSnZ9O3Xhi+K/mwIbI9VshPh3JV/w4D3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nzuoQVuQjS6i5tducoByzzrS64FO7iiIcD4vU7KTp/Yc1tVTa8glgEcVJL2ez8dDy BThJIS75EDOJZUxD01Om/bdvsl6Llg3YmSX3RGtfgGWOy4SvGbaDevTcc29JNGe2f7 pkWQKfeaQfTq7xOxkAo9EiAT68V7gOww+kfXtfCg= 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 25/44] perf annotate: Pass struct annotation_options to symbol__calc_lines() Date: Thu, 9 Aug 2018 11:58:03 -0300 Message-Id: <20180809145822.21391-26-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 Pass struct annotation_options to symbol__calc_lines(), to carry on and pass the percent_type value. 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-14-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 91528a065768..2b06476c79c2 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1868,7 +1868,8 @@ int symbol__annotate(struct symbol *sym, struct map *map, return symbol__disassemble(sym, &args); } -static void insert_source_line(struct rb_root *root, struct annotation_line *al) +static void insert_source_line(struct rb_root *root, struct annotation_line *al, + struct annotation_options *opts) { struct annotation_line *iter; struct rb_node **p = &root->rb_node; @@ -1883,7 +1884,7 @@ static void insert_source_line(struct rb_root *root, struct annotation_line *al) if (ret == 0) { for (i = 0; i < al->data_nr; i++) { iter->data[i].percent_sum += annotation_data__percent(&al->data[i], - PERCENT_HITS_LOCAL); + opts->percent_type); } return; } @@ -1896,7 +1897,7 @@ static void insert_source_line(struct rb_root *root, struct annotation_line *al) for (i = 0; i < al->data_nr; i++) { al->data[i].percent_sum = annotation_data__percent(&al->data[i], - PERCENT_HITS_LOCAL); + opts->percent_type); } rb_link_node(&al->rb_node, parent, p); @@ -2372,7 +2373,8 @@ void annotation__update_column_widths(struct annotation *notes) } static void annotation__calc_lines(struct annotation *notes, struct map *map, - struct rb_root *root) + struct rb_root *root, + struct annotation_options *opts) { struct annotation_line *al; struct rb_root tmp_root = RB_ROOT; @@ -2385,7 +2387,7 @@ static void annotation__calc_lines(struct annotation *notes, struct map *map, double percent; percent = annotation_data__percent(&al->data[i], - PERCENT_HITS_LOCAL); + opts->percent_type); if (percent > percent_max) percent_max = percent; @@ -2396,18 +2398,19 @@ static void annotation__calc_lines(struct annotation *notes, struct map *map, al->path = get_srcline(map->dso, notes->start + al->offset, NULL, false, true, notes->start + al->offset); - insert_source_line(&tmp_root, al); + insert_source_line(&tmp_root, al, opts); } resort_source_line(root, &tmp_root); } static void symbol__calc_lines(struct symbol *sym, struct map *map, - struct rb_root *root) + struct rb_root *root, + struct annotation_options *opts) { struct annotation *notes = symbol__annotation(sym); - annotation__calc_lines(notes, map, root); + annotation__calc_lines(notes, map, root, opts); } int symbol__tty_annotate2(struct symbol *sym, struct map *map, @@ -2424,7 +2427,7 @@ int symbol__tty_annotate2(struct symbol *sym, struct map *map, if (opts->print_lines) { srcline_full_filename = opts->full_path; - symbol__calc_lines(sym, map, &source_line); + symbol__calc_lines(sym, map, &source_line, opts); print_summary(&source_line, dso->long_name); } @@ -2451,7 +2454,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, if (opts->print_lines) { srcline_full_filename = opts->full_path; - symbol__calc_lines(sym, map, &source_line); + symbol__calc_lines(sym, map, &source_line, opts); print_summary(&source_line, dso->long_name); } -- 2.14.4