From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D15F0C433DB for ; Tue, 29 Dec 2020 03:11:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86085207B6 for ; Tue, 29 Dec 2020 03:11:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86085207B6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eOmq8eAFCpxglNbLSJT34tEVlosTtI1nfe/t2kjSw4A=; b=qSifYGX421+O0ZinYmjQ/N+SL 7KEv32yZH518pz/Op852rG+bmjO36qOCy7TnRM+fE4QInV6H3JL6BCIwRF510RjQvwHctShApoxhA DypifldNWp2sBRPcsI8tDOILfWj9brjZOc53Qe5lnZ27jR79puxTYjo85UwjvQPeyYPwt0ryv8Wb8 XW2sIxUEGcU8D+DnGI0OQezxQVRDVdkpVxcPNQkzqr9ACUfVzkSlfiSAafL3iBVJC1WNQF6rPwNeo y/dR1jPRbU3zsC0b5PUnMeN0i3unYpCfupusyUSWRerZFZhLLNyA+xFhlxfrDW0EB30V3JAA7/DIX XKhVG+Qdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ku5OR-0003Rh-UF; Tue, 29 Dec 2020 03:09:51 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ku5ON-0003Q2-Bx for linux-arm-kernel@lists.infradead.org; Tue, 29 Dec 2020 03:09:48 +0000 Received: by mail-pg1-x536.google.com with SMTP id i5so8469413pgo.1 for ; Mon, 28 Dec 2020 19:09:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=u5LSYcSeqxqNUQS5mYz7r4hErViy27m/hLCw3WqWA10=; b=b9rsft8eDiJyM+hftTFj4BiAS4UlgMzzruzWlmQbka8zVWWCN8nS1YhqcqSMEIzz/A BSftbF18ja4pagnGWj+iy1hLE4G82cbi+bggYmRc5goKjGMGqenp7QiwX7j/7tgS8FAA peCS3Ev8lKXNBlJvAgI2TKBQysIxDlwl6TRNkoUzNuml1kFdHqX25+WZgKiULY3sRRv7 /dUalDiaS+A8IfBFYArTnr7cPJtkxyHkRPUX6rbUkKbBfCTFqhPvsAk8HZijMKWiTcey HaFz6H/55dWjDD8I1NK3IhPTkJF1URKZ757TxMwAPhqOBHqtiebsILHz7FXhMcJHALUQ p7Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=u5LSYcSeqxqNUQS5mYz7r4hErViy27m/hLCw3WqWA10=; b=Iv90oX0PF8VUzOdkTO4sbompTJcCMmK7DzMztbl0itnmml9/xqzXPoTi+5GKPJCVOm DC3hcxYNsw/Q0veIMMYOYmD9yxxM2Js2qLh/sf1ypAYtBRKMW0VDBsGgHPj1kFb+Zkws 7ywUFsJH7jwMaHjGStzuJQpPYhhQoXwJSw48R/3KXSVX+c02NOOfAoVYv9umYkYof1z3 o0/4Ruq7/ik1h9/mLOLV3icUz8rug+eFwzie3BmHrOMV+fo5JuLOZJs/77qmprEklU24 Q0MM9h4OXjPGuEE2fIjuJymwJ9D/iBbyV6iwFrzPSoun1EFZ0mNNNTLQk1/Cg6Z4LD4q sCYg== X-Gm-Message-State: AOAM532OrS7dFVOyDp3BoFz/SIlPZ4vGqKSiqV5BjowhtPQc8O0QkIUI d++ZvqF+vvT4+TfN5XGnylStkw== X-Google-Smtp-Source: ABdhPJxulQui9Xpbf2MYQdWGnZHZ5k/XT9rKo0slndRUUNwj1ZMb1maBNvEYECiAKrACDz5b3UJ0lA== X-Received: by 2002:a05:6a00:230d:b029:18b:9cb:dead with SMTP id h13-20020a056a00230db029018b09cbdeadmr42775379pfh.24.1609211385223; Mon, 28 Dec 2020 19:09:45 -0800 (PST) Received: from leoy-ThinkPad-X240s ([45.137.216.7]) by smtp.gmail.com with ESMTPSA id v9sm36673616pff.102.2020.12.28.19.09.39 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Dec 2020 19:09:44 -0800 (PST) Date: Tue, 29 Dec 2020 11:09:33 +0800 From: Leo Yan To: Hans-Peter Nilsson Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu Message-ID: <20201229030933.GC28115@leoy-ThinkPad-X240s> References: <20201228023941.E0DE2203B5@pchp3.se.axis.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201228023941.E0DE2203B5@pchp3.se.axis.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201228_220947_740691_006084FC X-CRM114-Status: GOOD ( 22.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kim Phillips , Mathieu Poirier , Peter Zijlstra , Jiri Olsa , John Garry , linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Alexander Shishkin , Ingo Molnar , Namhyung Kim , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Hans-Peter, On Mon, Dec 28, 2020 at 03:39:41AM +0100, Hans-Peter Nilsson wrote: > When using "sort -nu", arm64 syscalls were lost. That is, the > io_setup syscall (number 0) and all but one (typically > ftruncate; 64) of the syscalls that are defined symbolically > (like "#define __NR_ftruncate __NR3264_ftruncate") at the point > where "sort" is applied. > > This creation-of-syscalls.c-scheme is, judging from comments, > copy-pasted from powerpc, and worked there because at the time, > its tools/arch/powerpc/include/uapi/asm/unistd.h had *literals*, > like "#define __NR_ftruncate 93". > > With sort being numeric and the non-numeric key effectively > evaluating to 0, the sort option "-u" means these "duplicates" > are removed. There's no need to remove syscall lines with > duplicate numbers for arm64 because there are none, so let's fix > that by just losing the "-u". Having the table numerically > sorted on syscall-number for the rest of the syscalls looks > nice, so keep the "-n". > > Signed-off-by: Hans-Peter Nilsson Very good catching! I tested this patch with the commands: $ cd $LINUX_KERN $ tools/perf/arch/arm64/entry/syscalls/mksyscalltbl \ $ARM64_TOOLCHAIN_PATH/aarch64-linux-gnu-gcc \ gcc tools tools/include/uapi/asm-generic/unistd.h It gives out complete syscall tables: $ diff /tmp/mksyscall_before.txt /tmp/mksyscall_after.txt 1a2,4 > [223] = "fadvise64", > [25] = "fcntl", > [44] = "fstatfs", 2a6,11 > [0] = "io_setup", > [62] = "lseek", > [222] = "mmap", > [71] = "sendfile", > [43] = "statfs", > [45] = "truncate", Rather than dropping option "-u" for sort command, I googled and read the manual of "sort", but cannot find other better method. So this patch looks good for me: Reviewed-by: Leo Yan Tested-by: Leo Yan > Cc: John Garry > Cc: Will Deacon > Cc: Mathieu Poirier > Cc: Leo Yan > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Mark Rutland > Cc: Alexander Shishkin > Cc: Jiri Olsa > Cc: Namhyung Kim > Cc: Kim Phillips > --- > tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl > index 459469b7222c..a7ca48d1e37b 100755 > --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl > +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl > @@ -58,5 +58,5 @@ create_table() > > $gcc -E -dM -x c -I $incpath/include/uapi $input \ > |sed -ne 's/^#define __NR_//p' \ > - |sort -t' ' -k2 -nu \ > + |sort -t' ' -k2 -n \ > |create_table > -- > 2.11.0 > > brgds, H-P _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel