From: Vincent Whitchurch <vincent.whitchurch@axis.com>
To: Leo Yan <leo.yan@linaro.org>, Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Hans-Peter Nilsson <hp@axis.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
John Garry <john.garry@huawei.com>, Will Deacon <will@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Kim Phillips <kim.phillips@arm.com>
Subject: Re: [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu
Date: Fri, 25 Nov 2022 12:53:10 +0100 [thread overview]
Message-ID: <Y4Cspv98j8TqwCqZ@axis.com> (raw)
In-Reply-To: <20201229030933.GC28115@leoy-ThinkPad-X240s>
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 <hp@axis.com>
>
> 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 <leo.yan@linaro.org>
> Tested-by: Leo Yan <leo.yan@linaro.org>
It looks like this patch was never applied? AFAICS it is still needed
on current HEAD and it still applies cleanly.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-11-25 11:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 2:39 [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu Hans-Peter Nilsson
2020-12-29 3:09 ` Leo Yan
2022-11-25 11:53 ` Vincent Whitchurch [this message]
2022-11-25 12:54 ` Leo Yan
2022-11-25 13:56 ` Arnd Bergmann
2022-12-02 18:39 ` Arnaldo Carvalho de Melo
2022-12-12 10:52 ` Leo Yan
2022-12-12 13:42 ` Arnd Bergmann
2022-12-21 20:15 ` Arnaldo Carvalho de Melo
2022-12-21 20:21 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4Cspv98j8TqwCqZ@axis.com \
--to=vincent.whitchurch@axis.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=hp@axis.com \
--cc=john.garry@huawei.com \
--cc=jolsa@redhat.com \
--cc=kim.phillips@arm.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).