Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932859AbdCIRij (ORCPT ); Thu, 9 Mar 2017 12:38:39 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34480 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932461AbdCIRhc (ORCPT ); Thu, 9 Mar 2017 12:37:32 -0500 From: Taeung Song To: Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, Jiri Olsa , Namhyung Kim , Ingo Molnar , Peter Zijlstra , Wang Nan , Masami Hiramatsu , Taeung Song , Jiri Olsa Subject: [PATCH v3 4/7] perf annotate: More exactly grep -v in symbol__disassemble() Date: Fri, 10 Mar 2017 02:35:38 +0900 Message-Id: <1489080941-3965-5-git-send-email-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489080941-3965-1-git-send-email-treeze.taeung@gmail.com> References: <1489080941-3965-1-git-send-email-treeze.taeung@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 32 To remove the first line containing file name and file format as below, $ objdump -l -d -S -C /home/taeung/a.out | head -2 /home/taeung/a.out: file format elf64-x86-64 currently perf-annotate use objdump with grep -v "file name". But it cause a side effect eliminating filename:linenr of output of 'objdump -l' so fix it. Cc: Namhyung Kim Cc: Jiri Olsa Signed-off-by: Taeung Song --- tools/perf/util/annotate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 63130ec..e49eb7e 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -1443,7 +1443,7 @@ int symbol__disassemble(struct symbol *sym, struct map *map, const char *arch_na snprintf(command, sizeof(command), "%s %s%s --start-address=0x%016" PRIx64 " --stop-address=0x%016" PRIx64 - " -l -d %s %s -C %s 2>/dev/null|grep -v %s|expand", + " -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 : "", -- 2.7.4