Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8536552imu; Tue, 4 Dec 2018 09:52:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/XZAJsaWVqhqk3ObAHnyivZxUMvcEvX4+2hc/CQAog0YCanzfuKAIvdoN8teCJ9pxs9XISP X-Received: by 2002:a62:d2c1:: with SMTP id c184mr21211685pfg.248.1543945952588; Tue, 04 Dec 2018 09:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543945952; cv=none; d=google.com; s=arc-20160816; b=uwkfwgAFd80TJnpswC7aDE4x08430St8p0X++5fPeJNFKsFjWgYJ4s2GLR8LxdGGAP f0+E6vqZInPE7jqavk0lfYCIqHhQkpPCfADADUyKQUPMP6FL9vcts7M2q+g8m9OY9fDW ogSmQnpbiaKTyNKyDjT2exMWZNc6L1Lb0g9ORCChXGlMb092XeK8o5YamnT+d00/ZK8r Hn380WqCkMt3WSmO+ipW3DbvSAvzTdYAv4G5s2IhHsPnhbaaN5RDyU+qTuvy560/kp1P p3vn0KubFNO5ANEeckpGflKv/vpDTG/qPF6duyOxdYYW0vW7W6fdKLxribKNOvzen1lx /1dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=fdGdEYYmRFnhHWADm7fy7IuDvYoxHh67w0mJNn+Iplw=; b=V5EWhOeRKskFEUcGwKvKhfF6q9HaDe0I6M5BPWDwzw/IXyJGbuRAcnUeB3/Ynemigg 7wm98h3aWjPWkEWxhuHiZ5Ih4Eh8iONorQNNb1ybvoFbqzluOOPDDUQ4JYtJ8LbFN4Az yztnZqTigXRj++xIx18jQi611cYs9cxUFqjg09iioNpf+lJqx+UlWuSkultkeOp4pBEN oQ/AKhHkvQje1jJkfFrr1bDLymuG0v6hrpliyBkG5ZDjsYOp5H1iYuu/oPRkF2I7k8HG 1yxzCltelxVkrYmVyH2zeEUhaY8v3co/mad4fAJ9Cv7VWSH3qwExc/FYIsUrTHp9J+Fl Rt0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=Y9sY34iV; 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=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w75si18145187pfd.55.2018.12.04.09.52.17; Tue, 04 Dec 2018 09:52:32 -0800 (PST) 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=@synopsys.com header.s=mail header.b=Y9sY34iV; 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=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbeLDRva (ORCPT + 99 others); Tue, 4 Dec 2018 12:51:30 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:35012 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726038AbeLDRva (ORCPT ); Tue, 4 Dec 2018 12:51:30 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 601E810C0752; Tue, 4 Dec 2018 09:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1543945889; bh=fmcoTSpyjVjlC+ZNuckSF5P/38d+2o5sC0i0xx6smWk=; h=From:To:Cc:Subject:Date:From; b=Y9sY34iVyrfh7DLNGgi5k/3I+dPSbqA2o+5gxDq7OvM20tji0YK4l6JYG8ki98Y6y WeQ1JzJkGJYp5i0y8rZ1K5E8pUZEsvwDmorxFR9VjleLK4Zv02Yz7q55kvL++U5OWx CjAvfr4F9Daan+0zGLEyRDWzQmdw6UM691ARlAUdDqAfjVdQIjaH9hcRhaWiVW2nRo LWhRkD1OmJHDrpRo2F39NgC3lHMkkbEn5VTA4CU24QE2HrHrurRlBH3LunAhI890vw Rd2HmWQUByrLJ15RApwY8m8qW//pOdT7n9W6aN5WyWYGcADI0jb0n/JTZshJbk0Mch xrZboJ+wValMQ== Received: from paltsev-e7480.internal.synopsys.com (paltsev-e7480.internal.synopsys.com [10.121.3.66]) by mailhost.synopsys.com (Postfix) with ESMTP id C1FD93822; Tue, 4 Dec 2018 09:51:24 -0800 (PST) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org, Vineet Gupta Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Eugeniy Paltsev Subject: [PATCH] ARC: introduce basic 'perf annotate' support for ARC Date: Tue, 4 Dec 2018 20:51:18 +0300 Message-Id: <20181204175118.25232-1-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce basic 'perf annotate' support for ARC to be able to use anotation via stdio interface. Signed-off-by: Eugeniy Paltsev --- 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 82657c01a3b8..f7cb57c424d1 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 6936daf89ddd..66066fb4d644 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, -- 2.14.5