From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946049AbdKRIRa (ORCPT ); Sat, 18 Nov 2017 03:17:30 -0500 Received: from terminus.zytor.com ([65.50.211.136]:53229 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946029AbdKRIRR (ORCPT ); Sat, 18 Nov 2017 03:17:17 -0500 Date: Sat, 18 Nov 2017 00:13:48 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, dsahern@gmail.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, acme@redhat.com, jolsa@kernel.org, mingo@kernel.org, andi@firstfloor.org Reply-To: dsahern@gmail.com, tglx@linutronix.de, hpa@zytor.com, peterz@infradead.org, namhyung@kernel.org, linux-kernel@vger.kernel.org, mingo@kernel.org, andi@firstfloor.org, jolsa@kernel.org, acme@redhat.com In-Reply-To: <20171011150158.11895-10-jolsa@kernel.org> References: <20171011150158.11895-10-jolsa@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate: Add offset/line/line_nr into struct annotate_args Git-Commit-ID: 4748834f96903f843719b02190f98e36b2c55192 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4748834f96903f843719b02190f98e36b2c55192 Gitweb: https://git.kernel.org/tip/4748834f96903f843719b02190f98e36b2c55192 Author: Jiri Olsa AuthorDate: Wed, 11 Oct 2017 17:01:32 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 13 Nov 2017 09:39:58 -0300 perf annotate: Add offset/line/line_nr into struct annotate_args Add offset/line/line_nr into struct annotate_args to reduce the number of arguments that need to travel all the way to line allocation. Signed-off-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20171011150158.11895-10-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 30da440..681c9c4 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -882,23 +882,24 @@ struct annotate_args { size_t privsize; struct arch *arch; struct map *map; + s64 offset; + char *line; + int line_nr; }; -static struct disasm_line *disasm_line__new(struct annotate_args *args, - s64 offset, char *line, - int line_nr) +static struct disasm_line *disasm_line__new(struct annotate_args *args) { struct disasm_line *dl = zalloc(sizeof(*dl) + args->privsize); if (dl != NULL) { - dl->al.offset = offset; - dl->al.line = strdup(line); - dl->al.line_nr = line_nr; + dl->al.offset = args->offset; + dl->al.line = strdup(args->line); + dl->al.line_nr = args->line_nr; if (dl->al.line == NULL) goto out_delete; - if (offset != -1) { + if (args->offset != -1) { if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0) goto out_free_line; @@ -1269,7 +1270,11 @@ static int symbol__parse_objdump_line(struct symbol *sym, FILE *file, parsed_line = tmp2 + 1; } - dl = disasm_line__new(args, offset, parsed_line, *line_nr); + args->offset = offset; + args->line = parsed_line; + args->line_nr = *line_nr; + + dl = disasm_line__new(args); free(line); (*line_nr)++;