From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932821AbbLHEfa (ORCPT ); Mon, 7 Dec 2015 23:35:30 -0500 Received: from terminus.zytor.com ([198.137.202.10]:50841 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932498AbbLHEf2 (ORCPT ); Mon, 7 Dec 2015 23:35:28 -0500 Date: Mon, 7 Dec 2015 20:35:00 -0800 From: tip-bot for Russell King Message-ID: Cc: linux-kernel@vger.kernel.org, acme@redhat.com, rmk+kernel@arm.linux.org.uk, will.deacon@arm.com, mingo@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl, hpa@zytor.com Reply-To: a.p.zijlstra@chello.nl, hpa@zytor.com, mingo@kernel.org, will.deacon@arm.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, acme@redhat.com, rmk+kernel@arm.linux.org.uk To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf annotate: ARM support Git-Commit-ID: cfef25b8daf7e4b49c84e174a904af9d89dc7c46 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: cfef25b8daf7e4b49c84e174a904af9d89dc7c46 Gitweb: http://git.kernel.org/tip/cfef25b8daf7e4b49c84e174a904af9d89dc7c46 Author: Russell King AuthorDate: Sun, 6 Dec 2015 23:07:13 +0000 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 7 Dec 2015 18:13:00 -0300 perf annotate: ARM support Add basic support to parse ARM assembly. This: * enables perf to correctly show the disassembly, rather than chopping some constants off at the '#' (which is not a comment character on ARM). * allows perf to identify ARM instructions that branch to other parts within the same function, thereby properly annotating them. * allows perf to identify function calls, allowing called functions to be followed in the annotated view. Signed-off-by: Russell King Cc: Peter Zijlstra Cc: Will Deacon Link: http://lkml.kernel.org/n/tip-owp1uj0nmcgfrlppfyeetuyf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/annotate.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 1dd1949..b795b69 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -65,6 +65,11 @@ static int call__parse(struct ins_operands *ops) name++; +#ifdef __arm__ + if (strchr(name, '+')) + return -1; +#endif + tok = strchr(name, '>'); if (tok == NULL) return -1; @@ -246,7 +251,11 @@ static int mov__parse(struct ins_operands *ops) return -1; target = ++s; +#ifdef __arm__ + comment = strchr(s, ';'); +#else comment = strchr(s, '#'); +#endif if (comment != NULL) s = comment - 1; @@ -354,6 +363,20 @@ static struct ins instructions[] = { { .name = "addq", .ops = &mov_ops, }, { .name = "addw", .ops = &mov_ops, }, { .name = "and", .ops = &mov_ops, }, +#ifdef __arm__ + { .name = "b", .ops = &jump_ops, }, // might also be a call + { .name = "bcc", .ops = &jump_ops, }, + { .name = "bcs", .ops = &jump_ops, }, + { .name = "beq", .ops = &jump_ops, }, + { .name = "bge", .ops = &jump_ops, }, + { .name = "bgt", .ops = &jump_ops, }, + { .name = "bhi", .ops = &jump_ops, }, + { .name = "bl", .ops = &call_ops, }, + { .name = "blt", .ops = &jump_ops, }, + { .name = "bls", .ops = &jump_ops, }, + { .name = "blx", .ops = &call_ops, }, + { .name = "bne", .ops = &jump_ops, }, +#endif { .name = "bts", .ops = &mov_ops, }, { .name = "call", .ops = &call_ops, }, { .name = "callq", .ops = &call_ops, },