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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B385C4332F for ; Fri, 25 Nov 2022 12:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=YQtUOX5fslsGfRAzWNWHanqZhSLciLRY3q//UnELn3I=; b=Nc8triuTJvh0nA f/BTyobacpxBu+LcYu3GyOG2b4L3Y2qYXpIcjBLclh0PUlRTS2sj+qZPLPEntQTevUeUvXIlwSjFo +lZn95rMPs13EX4wcoh1KmoJ2B6vDbb85rUy7WPkVkRSil/PB2nXeFXlbkL0hkMv5jESUyrwEOwFi ujP/8HL49QiK28HLo+ImQ2H2JajtqfL4O4n0UJaE2niXWNcOMSj+j0RI5TKearLfg21V7+NXN0QQB ieKZ2LR+REMUbZ1zJSxASMP6jCGpNOgf2QZGLtWr5uOMtHvDm8SEZaJ5rsH6jjt9FcNKwSimI6sIy VBMdSw2ZlloC9RsrYvlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyYDe-00GWw4-R2; Fri, 25 Nov 2022 12:54:14 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oyYDa-00GWtc-Vy for linux-arm-kernel@lists.infradead.org; Fri, 25 Nov 2022 12:54:12 +0000 Received: by mail-pf1-x42e.google.com with SMTP id b29so4059292pfp.13 for ; Fri, 25 Nov 2022 04:54:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DvxK7g2/OoP+dWq+SzoWxDDlutXiD4a/hU/5/6tjljU=; b=WDk8HuQoLgoFtqcCu7vG0M6zDpOHTB8F3PCm6MXmWptYILZ1mGyOau0HPDY8JSg6MM xWJeFl8gSaM/xZmZxN3GXGQh6VXSpGPICuwCNfLly8YRiSSIrNdPYP7Oj2wfigIMfk8j Ckf9OEsVHvHnIjJXThs5MQMR0wIf0px3jEI3mceKwZ+rSvXvckeNIv6R537Q/XZPBUlY pTPIjxuAa7XBfX2X7MeyCVswl+p/IiN7lSN6+ntN4fCgYd+GMiPuX44MIKWs+t5x9wOq sXMuo0aPMKjZbwwXpFnKWrwKXY2ZrN08vhx50Shlv98BQ9SsCS0QZ1HpY38mL+wGrnmX ESOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DvxK7g2/OoP+dWq+SzoWxDDlutXiD4a/hU/5/6tjljU=; b=Cl0Yfky8aV9RMkzOTmznvGvPG2axTRHG5NJZUfT5jQWgFv01Eh5AtynWkZ3AsiLfV+ jQNHYDt1lFD6r/2j/PMzKZLK292+UmlmAL2rY39oeeIFD8UYC8bHz6HpyUEQbrpq5u/b wXsy/+zWKIQvNZSlkxfEt4yFqvVe/vWTYk3I7xIh1mlZgSQ3eZ5uB3Lf2A1bRF+jvYFz 08r0rn/ieyCz1VsdCWbe5K7IZCpbZD99v9REd/9hCf5h7ulfS5Asf/C7er7cacFf5+Au GCZWS6LhrSs0/htxf8n4xITowu2ZKwWlU/Rn7LGdw6IQYXbS+SIz1JTgWUD2ZuVmVB2L sZOw== X-Gm-Message-State: ANoB5pkh8YOKTDNwJEAN1cB2GNzfqoVNkmvK+8J/ana16zOYGUc8pTcs GdfeAoVbxdHyc/UkJqkiU6mL4Q== X-Google-Smtp-Source: AA0mqf608MisyiUu6taSsiP77NzaO+DRdBelfI2fTX31wK6PdoWClQDxoDCMHtJpVKoNd4/wVf6X+w== X-Received: by 2002:a63:1062:0:b0:470:a47:996a with SMTP id 34-20020a631062000000b004700a47996amr16156950pgq.377.1669380848537; Fri, 25 Nov 2022 04:54:08 -0800 (PST) Received: from leoy-yangtze.lan (211-75-219-204.hinet-ip.hinet.net. [211.75.219.204]) by smtp.gmail.com with ESMTPSA id p21-20020a631e55000000b004597e92f99dsm2542684pgm.66.2022.11.25.04.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 04:54:07 -0800 (PST) Date: Fri, 25 Nov 2022 20:54:01 +0800 From: Leo Yan To: Vincent Whitchurch , Arnd Bergmann Cc: Arnaldo Carvalho de Melo , Hans-Peter Nilsson , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, John Garry , Will Deacon , Mathieu Poirier , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Kim Phillips Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu Message-ID: References: <20201228023941.E0DE2203B5@pchp3.se.axis.com> <20201229030933.GC28115@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221125_045411_052961_518F5985 X-CRM114-Status: GOOD ( 28.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Vincent, [ + Arnd ] On Fri, Nov 25, 2022 at 12:53:10PM +0100, Vincent Whitchurch wrote: > On Tue, Dec 29, 2020 at 11:09:33AM +0800, Leo Yan wrote: > > 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 > > It looks like this patch was never applied? AFAICS it is still needed > on current HEAD and it still applies cleanly. Thanks a lot for bringing up this. Before there have a discussion [1] for refactoring Arm64 system call table but it didn't really happen. I think it's the right thing to merge this patch, @Arnaldo, could you pick up this patch? Thanks, Leo [1] https://lore.kernel.org/lkml/CAK8P3a1G2YHh2FRd=vBY4xxsJ1wZFh2pB1wyw82QmQOaiV4+CA@mail.gmail.com/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel