Received: by 10.223.176.5 with SMTP id f5csp2601363wra; Mon, 29 Jan 2018 00:34:19 -0800 (PST) X-Google-Smtp-Source: AH8x224+puyGAjT7Ynw4j2DZphKpaIPXfPbxAxxK4d1kE8xL79Hhd7UhHubkvR+wVM4tFQT5CzGC X-Received: by 2002:a17:902:781:: with SMTP id 1-v6mr20878619plj.411.1517214859302; Mon, 29 Jan 2018 00:34:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517214859; cv=none; d=google.com; s=arc-20160816; b=s0T9JqGHQ8scAnPnDXB34pc1Aw+h95MXy4lEo1bdWe0Vpgtaw6de2aLuUgJwzIvcEZ loMg2Hdwm+GqPaZFLpOv8jADhcfJABizyaFEzLhDL1IkOafTSxt0fJqJP6gbMerbvG/B A6VPCz5ZG9BZS9YLYQxTjSHSZCe4MbPpQEiwvrPjCf8fJMFJmXU1QqexWt6nro1FS4ST kjHWrtZe22hV/gEQvkruZrgm3R3r453QauM00Mb2tp+ZZrVh8YNS5tXbuA/0hbjoYbp9 2VZRdge0PsJ4QKXxrJ0AyQB4OuPfYc+K0ICPyZltQ4a+hUJVp3sv1eLAAq1idOYcnFLs VXQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=+4MnwOyUhtrCccJ17AjLmOk7L91AeS+QwEOrfuzWYH0=; b=F7NVCIgLEyvAT86zmkp6HdR08suGp7BQgatXj6wcjUvxa0P9l4pXvilaWGIcfSRW16 NIIvgKEEqqgBpFt8XmToYesaHDx36MCnjy5NueJk1x8UvTlSPKOPE1g1ka45fGqtcbCU Acs391JQk8iUR3TTjXzw6LMGRrnCb270WYM0igT1hlZVwNrbFXHEZYMsFqgsd2z7g/2t vWF9twdV1gqlPrqwhNjsaqH+uaW5BjIDNJO66zyQAzDhoGpF6N6EBkM3fScsjgC+VdtA wK5tjj0vOLt5V4PQgrS5ECgpPievXY4+hwIviPLGcpzXUptH6FxUKtYA00MxowTvLUXP 4a8A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1si7016730pgc.802.2018.01.29.00.34.05; Mon, 29 Jan 2018 00:34:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751684AbeA2Id1 (ORCPT + 99 others); Mon, 29 Jan 2018 03:33:27 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47682 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751448AbeA2Ic7 (ORCPT ); Mon, 29 Jan 2018 03:32:59 -0500 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0T8OHq0036022 for ; Mon, 29 Jan 2018 03:32:59 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ft007rknm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2018 03:32:59 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jan 2018 08:32:57 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Jan 2018 08:32:53 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0T8WrO165011928; Mon, 29 Jan 2018 08:32:53 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1E73B11C04A; Mon, 29 Jan 2018 08:26:25 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E15D11C04C; Mon, 29 Jan 2018 08:26:23 +0000 (GMT) Received: from bangoria.in.ibm.com (unknown [9.124.31.133]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 29 Jan 2018 08:26:23 +0000 (GMT) From: Ravi Bangoria To: acme@kernel.org Cc: alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, brueckner@linux.vnet.ibm.com, tmricht@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, Ravi Bangoria Subject: [PATCH 2/3] perf powerpc: Generate system call table from asm/unistd.h Date: Mon, 29 Jan 2018 14:04:16 +0530 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180129083417.31240-1-ravi.bangoria@linux.vnet.ibm.com> References: <20180129083417.31240-1-ravi.bangoria@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18012908-0012-0000-0000-000005A8D17C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012908-0013-0000-0000-0000192469F7 Message-Id: <20180129083417.31240-3-ravi.bangoria@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-29_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801290114 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This should speed up accessing new system calls introduced with the kernel rather than waiting for libaudit updates to include them. Signed-off-by: Ravi Bangoria --- tools/perf/arch/powerpc/Makefile | 21 +++++++++++++ .../perf/arch/powerpc/entry/syscalls/mksyscalltbl | 35 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile index 42dab7c..c93e8f4 100644 --- a/tools/perf/arch/powerpc/Makefile +++ b/tools/perf/arch/powerpc/Makefile @@ -6,3 +6,24 @@ endif HAVE_KVM_STAT_SUPPORT := 1 PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1 PERF_HAVE_JITDUMP := 1 + +# +# Syscall table generation for perf +# + +out := $(OUTPUT)arch/powerpc/include/generated/asm +header := $(out)/syscalls_64.c +sysdef := $(srctree)/tools/arch/powerpc/include/uapi/asm/unistd.h +sysprf := $(srctree)/tools/perf/arch/powerpc/entry/syscalls/ +systbl := $(sysprf)/mksyscalltbl + +# Create output directory if not already present +_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') + +$(header): $(sysdef) $(systbl) + $(Q)$(SHELL) '$(systbl)' '$(CC)' $(sysdef) > $@ + +clean:: + $(call QUIET_CLEAN, powerpc) $(RM) $(header) + +archheaders: $(header) diff --git a/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl new file mode 100755 index 0000000..975947c --- /dev/null +++ b/tools/perf/arch/powerpc/entry/syscalls/mksyscalltbl @@ -0,0 +1,35 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# +# Generate system call table for perf. Derived from +# s390 script. +# +# Copyright IBM Corp. 2017 +# Author(s): Hendrik Brueckner +# Changed by: Ravi Bangoria + +gcc=$1 +input=$2 + +if ! test -r $input; then + echo "Could not read input file" >&2 + exit 1 +fi + +create_table() +{ + local max_nr + + echo 'static const char *syscalltbl_powerpc_64[] = {' + while read sc nr; do + printf '\t[%d] = "%s",\n' $nr $sc + max_nr=$nr + done + echo '};' + echo "#define SYSCALLTBL_POWERPC_64_MAX_ID $max_nr" +} + +$gcc -m64 -E -dM -x c $input \ + |sed -ne 's/^#define __NR_//p' \ + |sort -t' ' -k2 -nu \ + |create_table -- 1.8.3.1