Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1229521imm; Tue, 5 Jun 2018 11:02:16 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI6ESXForB5nFHRFSkeKgNLdgf3mCt8nqUa/+BIzYL42lmGPkD23EX+o9KwRHlbwTznwcH+ X-Received: by 2002:a63:4384:: with SMTP id q126-v6mr21445951pga.294.1528221736944; Tue, 05 Jun 2018 11:02:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221736; cv=none; d=google.com; s=arc-20160816; b=GPz7e3SXlTbZjbsCcnvukclCZsB+tffYEOCzuPxc48QI3EF/OEiOxGkidivG8Pqogi yBN1fJYaOMO2Gwyo5SFCeTeuvbpwAuqFmJpxkCGQipEE/bz5/cz9RQCvn5WKKlBjV+3W xu5L3nODvFWVrsru1jGKewkRJcqhmI93lHCNdEn3eWCJ2xAFaNUHz5EAAX7udz8DYE8H GJUSoC5Dhc4YhQenb7/2dp8Z01LUurSMd9JBgSbqdZaxSt9n2dCZU1im24XxgBL3HQY6 fhySv90kRgiKzT7cV5Nxww4zraGNIbeE8LWq6yKXp6dNthrzqrXxjtNGTnMtwEMpO88e NoCg== 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=cCtc3OpXuriMOFpbkJMF0OqkObVOvbC82KqGqhkrqj4=; b=TxfBdG8lzFqq05gMWO7RsL3+wW75yRutJm7JtB4PTX1WRdKxeIkcsnEHP5ODCHkiLU 7FYhVsnmwjAQfHFLZCunfWdVTcx31eUc3bDtzvFGQPAJ3WLnol6vN5yECtRSZ0lZlQV8 Z+x5aqQplI+ys/uQh/04bOIGNdF2vbEkITmWZGtyeY0Lq4H+06OETYTWVKRr7KGpqFOo ILPYca32QeLS8nWgcDRCrUvDRLPTv47lCLupwgUHnrKmX7qr4MIAckzCaV0A6wAdCPiJ TUXf6VvFVgaQWmsyIxUzQ3ZzFaNYtn98WynKhvEKNcly0kJHYgC1DGH+ndla4m6wSxe6 XjZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hOeXvAZi; 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 t5-v6si9139865pgc.189.2018.06.05.11.02.02; Tue, 05 Jun 2018 11:02:16 -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=hOeXvAZi; 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 S1752586AbeFERvp (ORCPT + 99 others); Tue, 5 Jun 2018 13:51:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:46064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463AbeFERvo (ORCPT ); Tue, 5 Jun 2018 13:51:44 -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 576332075B; Tue, 5 Jun 2018 17:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221103; bh=MNZ17VBxdMhlVWMsMT/JSt9nAp2zQ4XkM+HVTzItytE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOeXvAZi13zmZH65akYsUQpk545IBjmpIk3CMZmlgjrPGPEAp/Mm/ZGaBhrZa5DVD l4y9bP7DArsh4dI3+n94cOBn5GhQnQqS1zs8VCNaEb8EPWF6ZFshSP9Et5+BdgbUoZ C8g9lgyyqp2N3gEG8jIr1AVOQBooUZz5KUnj8PNQ= 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 21/46] perf annotate: Pass annotation_options to symbol__annotate() Date: Tue, 5 Jun 2018 14:50:05 -0300 Message-Id: <20180605175030.32549-22-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 Now all callers to symbol__disassemble() can hand it the per-tool annotation_options, which will allow us to remove lots of stuff from symbol_options, the kitchen sink of perf configs, reducing its size and getting annotation specific stuff grouped together. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-vpr7ys7ggvs2fzpg8wbjcw7e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 2 +- tools/perf/ui/gtk/annotate.c | 2 +- tools/perf/util/annotate.c | 7 +++++-- tools/perf/util/annotate.h | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5e58cd4de90b..2c14ca61c657 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -133,7 +133,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) return err; } - err = symbol__annotate(sym, map, evsel, 0, NULL); + err = symbol__annotate(sym, map, evsel, 0, &top->annotation_opts, NULL); if (err == 0) { top->sym_filter_entry = he; } else { diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c index aeeaf15029f0..48428c9acd89 100644 --- a/tools/perf/ui/gtk/annotate.c +++ b/tools/perf/ui/gtk/annotate.c @@ -169,7 +169,7 @@ static int symbol__gtk_annotate(struct symbol *sym, struct map *map, if (map->dso->annotate_warned) return -1; - err = symbol__annotate(sym, map, evsel, 0, NULL); + err = symbol__annotate(sym, map, evsel, 0, &annotation__default_options, NULL); if (err) { char msg[BUFSIZ]; symbol__strerror_disassemble(sym, map, err, msg, sizeof(msg)); diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index abcc7e24c365..502f9d124a44 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1067,6 +1067,7 @@ struct annotate_args { struct arch *arch; struct map_symbol ms; struct perf_evsel *evsel; + struct annotation_options *options; s64 offset; char *line; int line_nr; @@ -1803,11 +1804,13 @@ void symbol__calc_percent(struct symbol *sym, struct perf_evsel *evsel) int symbol__annotate(struct symbol *sym, struct map *map, struct perf_evsel *evsel, size_t privsize, + struct annotation_options *options, struct arch **parch) { struct annotate_args args = { .privsize = privsize, .evsel = evsel, + .options = options, }; struct perf_env *env = perf_evsel__env(evsel); const char *arch_name = perf_env__arch(env); @@ -2409,7 +2412,7 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, struct dso *dso = map->dso; struct rb_root source_line = RB_ROOT; - if (symbol__annotate(sym, map, evsel, 0, NULL) < 0) + if (symbol__annotate(sym, map, evsel, 0, opts, NULL) < 0) return -1; symbol__calc_percent(sym, evsel); @@ -2655,7 +2658,7 @@ int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *ev if (perf_evsel__is_group_event(evsel)) nr_pcnt = evsel->nr_members; - err = symbol__annotate(sym, map, evsel, 0, parch); + err = symbol__annotate(sym, map, evsel, 0, options, parch); if (err) goto out_free_offsets; diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 20f3326cc640..013d414b0e57 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -306,6 +306,7 @@ void symbol__annotate_zero_histograms(struct symbol *sym); int symbol__annotate(struct symbol *sym, struct map *map, struct perf_evsel *evsel, size_t privsize, + struct annotation_options *options, struct arch **parch); int symbol__annotate2(struct symbol *sym, struct map *map, struct perf_evsel *evsel, -- 2.14.3