From patchwork Thu Dec 6 21:25:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 1009014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ij6yk5Yp"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="hqQdov7A"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 439pgs3cfVz9s8J for ; Fri, 7 Dec 2018 08:31:21 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mNjYPfF4/Pn8h1Z6QNcInCKyMEvvXzu4xl0zaDY8Am4=; b=Ij6yk5YpwAhqgh R/rDNb+EPieejTwCn9s/ejj17NcdrcSSgnHBsP/UVVR1mGi8OfuD27VPSWjixy8xxKcfBcHN/X2ji kwR0vXVkqdnI/2gbz6UFBKGJQdXEc3jFs8zvfOB3CA8bR3xlcZ6DddNlYw209FlDrCiXqXegNgnkg dmiE4zedl6CUcr5FH8QEveqmYHbJ1JtWNuZGVxmJwc7wMbubnbRkMLOAWlmcwz4pd3ZvtVPs50g2I RZvkhqrPW8ur5BLd688bZ1AwA+U7cTFrRo0XxSOUlMbSeONisBzGgclNOjr4arS9uqNvalmflM4Ae TxiBcofRl24qctbsczCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gV1Et-0005wd-Db; Thu, 06 Dec 2018 21:31:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gV1Eq-0005t7-Oy for linux-snps-arc@lists.infradead.org; Thu, 06 Dec 2018 21:31:18 +0000 Received: from quaco.ghostprotocols.net (179.187.13.223.dynamic.adsl.gvt.net.br [179.187.13.223]) (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 7C2D8208E7; Thu, 6 Dec 2018 21:31:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544131866; bh=MaBBpAWMpYZgpQAWlIKHF2gFMboz1hZdvSLroX5LopU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hqQdov7AF0agb/YRuIUZACKOhI/KNIG1SASeIAZzga5DOCh2oQLuE1kv1P7F3/9uc 7GD0cU3LOnUw7hEkkW23QUe6J7qPCrmVlQ/HljBT7TgmRh6nGBYt3hgK7Y1S3dQobU +SUAQ9XcoFBKkr9d6jQ9pevRTpjIIvheO/tvC8f0= From: Arnaldo Carvalho de Melo To: Ingo Molnar Subject: [PATCH 71/75] perf annotate: Introduce basic support for ARC Date: Thu, 6 Dec 2018 18:25:58 -0300 Message-Id: <20181206212602.20474-72-acme@kernel.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181206212602.20474-1-acme@kernel.org> References: <20181206212602.20474-1-acme@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181206_133116_850388_26DE7896 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -5.2 (-----) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-5.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.145.29.99 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 DKIMWL_WL_HIGH DKIMwl.org - Whitelisted High sender X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnaldo Carvalho de Melo , Clark Williams , Jiri Olsa , Vineet Gupta , Alexey Brodkin , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Alexander Shishkin , Peter Zijlstra , Namhyung Kim , linux-snps-arc@lists.infradead.org, Eugeniy Paltsev Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Eugeniy Paltsev Introduce basic 'perf annotate' support for ARC to be able to use anotation via stdio interface. Signed-off-by: Eugeniy Paltsev Cc: Alexander Shishkin Cc: Alexey Brodkin Cc: Jiri Olsa Cc: linux-snps-arc@lists.infradead.org Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Vineet Gupta Link: http://lkml.kernel.org/r/20181204175118.25232-1-Eugeniy.Paltsev@synopsys.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/arch/arc/annotate/instructions.c | 9 +++++++++ tools/perf/arch/common.c | 11 ++++++++++- tools/perf/util/annotate.c | 5 +++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 tools/perf/arch/arc/annotate/instructions.c diff --git a/tools/perf/arch/arc/annotate/instructions.c b/tools/perf/arch/arc/annotate/instructions.c new file mode 100644 index 000000000000..2f00e995c7e3 --- /dev/null +++ b/tools/perf/arch/arc/annotate/instructions.c @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0 +#include + +static int arc__annotate_init(struct arch *arch, char *cpuid __maybe_unused) +{ + arch->initialized = true; + arch->objdump.comment_char = ';'; + return 0; +} diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c index 5f69fd0b745a..f3824ca7c20b 100644 --- a/tools/perf/arch/common.c +++ b/tools/perf/arch/common.c @@ -5,6 +5,13 @@ #include "../util/util.h" #include "../util/debug.h" +const char *const arc_triplets[] = { + "arc-linux-", + "arc-snps-linux-uclibc-", + "arc-snps-linux-gnu-", + NULL +}; + const char *const arm_triplets[] = { "arm-eabi-", "arm-linux-androideabi-", @@ -147,7 +154,9 @@ static int perf_env__lookup_binutils_path(struct perf_env *env, zfree(&buf); } - if (!strcmp(arch, "arm")) + if (!strcmp(arch, "arc")) + path_list = arc_triplets; + else if (!strcmp(arch, "arm")) path_list = arm_triplets; else if (!strcmp(arch, "arm64")) path_list = arm64_triplets; diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 51d291b0b81f..ac9805e0bc76 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -134,6 +134,7 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i return 0; } +#include "arch/arc/annotate/instructions.c" #include "arch/arm/annotate/instructions.c" #include "arch/arm64/annotate/instructions.c" #include "arch/x86/annotate/instructions.c" @@ -142,6 +143,10 @@ static int arch__associate_ins_ops(struct arch* arch, const char *name, struct i #include "arch/sparc/annotate/instructions.c" static struct arch architectures[] = { + { + .name = "arc", + .init = arc__annotate_init, + }, { .name = "arm", .init = arm__annotate_init,