Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1229686imm; Tue, 5 Jun 2018 11:02:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJy9YaqSolyJIAvFsVumTgm2vD+fIelYqmMYIh/Zz6u4Kih5Ge0zJ72Pw/lo+6f+aXFEbp0 X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr27092682plu.22.1528221746805; Tue, 05 Jun 2018 11:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528221746; cv=none; d=google.com; s=arc-20160816; b=WhyQkpl8mjlEbc8KD49KKzx1nR5Sn9OJ565Ozm57OovnkEaMB1LtiUZfdFjHrDZTKY 7ypQK/eob2LYTBcyjGmsMGQja7IA79Ski0tvd2UzDTbHqAnGgFtNssPtxDUQs7jCQ/xx mXDsRR9SEEM6SnKTUj9LNKQ+kq1frf4iYC/8az6l2nQn9D9Hw3CWH62DMt4rR781E1OC D1kfrUziIf6jAAmt7RFL4ui3hiP4vrwf0KHOZ5qwbKGlq05/tW+NPOgXdr7DbglutCj3 93f0HFFPHVvFJImz0S8o2AluY61Hl+MFkyMVIxr6kzAJ8rii3OUkHxaDTNo24HqdhDc1 F4Iw== 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=XnSDOYN9RgIjpHgW3lb40S/BTCh1bHTjnQjHk8qc7pY=; b=ScPCkzfSMoSevBy/51vpb55WKX57Ze0UB4j7fxNazUoIlZbukBebZL4QEnrTQAVGF+ Jmb3foWgQaHCV5r32uzZb/G75hAwjbMAVUUbO9aD+RvidFLh8Wt+WNQXgLO+OhhRDeIU W0+ltLC7/ODcPZAIxKI8NnVwO09Mq3YKjlCakHTeHix96J7ak5QHxEIMyB9JwEJIK5iI XnIRDrGCymvkNPGbWgPqbG1myrB8gkLwT2kUqzvIb16oexjmj1+63PpGqSEUeucla/7z CVtFfjGqqc2H9HGh1UV1FUvCA9PIY5kcSPkxsiNrIgQhtxEEM0+jn/vZqKmb0vjEtr7u VAkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ApXNVO5S; 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 t1-v6si6364013pgc.606.2018.06.05.11.02.11; Tue, 05 Jun 2018 11:02:26 -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=ApXNVO5S; 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 S1752656AbeFERvx (ORCPT + 99 others); Tue, 5 Jun 2018 13:51:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:46148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752638AbeFERvu (ORCPT ); Tue, 5 Jun 2018 13:51:50 -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 3204A2083B; Tue, 5 Jun 2018 17:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528221109; bh=SlHqac44WK5NDfqb1+YYLMM0/dtd8+3dHNLhmRTWohc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ApXNVO5SBrSyCPp08gEmxsmN+QS7ERoUKSYKM1bDnWUeL7FJ+oDmzaKBMZNiNvvsu u9sFW54m8wubQsmgelmZn724QD6x1JqIBEFNM8vGjm1oooVAArljLpjbN3CPHOAxTC 7KvZoRLVW0nUbqnrqWN32fJbkjIO5f+zaSuSMXtc= 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 23/46] perf annotate: Move disassembler_style global to annotation_options Date: Tue, 5 Jun 2018 14:50:07 -0300 Message-Id: <20180605175030.32549-24-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 Continuing to group annotation specific stuff into a struct. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-p3cdhltj58jt0byjzg3g7obx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-annotate.c | 2 +- tools/perf/builtin-report.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/util/annotate.c | 5 ++--- tools/perf/util/annotate.h | 3 +-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 2ca7172f0780..3ee063598364 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -519,7 +519,7 @@ int cmd_annotate(int argc, const char **argv) "Interleave source code with assembly code (default)"), OPT_BOOLEAN(0, "asm-raw", &annotate.opts.show_asm_raw, "Display raw encoding of assembly instructions (default)"), - OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", + OPT_STRING('M', "disassembler-style", &annotate.opts.disassembler_style, "disassembler style", "Specify disassembler style (e.g. -M intel for intel syntax)"), OPT_STRING(0, "objdump", &objdump_path, "path", "objdump binary to use for disassembly and annotations"), diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index bee6dbfbf11e..c74f9a219ad1 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -1083,7 +1083,7 @@ int cmd_report(int argc, const char **argv) "Interleave source code with assembly code (default)"), OPT_BOOLEAN(0, "asm-raw", &report.annotation_opts.show_asm_raw, "Display raw encoding of assembly instructions (default)"), - OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", + OPT_STRING('M', "disassembler-style", &report.annotation_opts.disassembler_style, "disassembler style", "Specify disassembler style (e.g. -M intel for intel syntax)"), OPT_BOOLEAN(0, "show-total-period", &symbol_conf.show_total_period, "Show a column with the sum of periods"), diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e65e72c06a01..739c158fb39e 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1348,7 +1348,7 @@ int cmd_top(int argc, const char **argv) "Enable kernel symbol demangling"), OPT_STRING(0, "objdump", &objdump_path, "path", "objdump binary to use for disassembly and annotations"), - OPT_STRING('M', "disassembler-style", &disassembler_style, "disassembler style", + OPT_STRING('M', "disassembler-style", &top.annotation_opts.disassembler_style, "disassembler style", "Specify disassembler style (e.g. -M intel for intel syntax)"), OPT_STRING('u', "uid", &target->uid_str, "user", "user to profile"), OPT_CALLBACK(0, "percent-limit", &top, "percent", diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index ff8f4f474b22..a90777717b60 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -51,7 +51,6 @@ struct annotation_options annotation__default_options = { .offset_level = ANNOTATION__OFFSET_JUMP_TARGETS, }; -const char *disassembler_style; const char *objdump_path; static regex_t file_lineno; @@ -1659,8 +1658,8 @@ static int symbol__disassemble(struct symbol *sym, struct annotate_args *args) " --stop-address=0x%016" PRIx64 " -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s:\"|expand", objdump_path ? objdump_path : "objdump", - disassembler_style ? "-M " : "", - disassembler_style ? disassembler_style : "", + opts->disassembler_style ? "-M " : "", + opts->disassembler_style ?: "", map__rip_2objdump(map, sym->start), map__rip_2objdump(map, sym->end), opts->show_asm_raw ? "" : "--no-show-raw", diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 476ea2a25649..71a734b86873 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -80,6 +80,7 @@ struct annotation_options { int min_pcnt; int max_lines; int context; + const char *disassembler_style; }; enum { @@ -368,8 +369,6 @@ static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, } #endif -extern const char *disassembler_style; - void annotation_config__init(void); #endif /* __PERF_ANNOTATE_H */ -- 2.14.3