linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf arm64: Fix mksyscalltbl, don't lose syscalls due to sort -nu
@ 2020-12-28  2:39 Hans-Peter Nilsson
  2020-12-29  3:09 ` Leo Yan
  0 siblings, 1 reply; 10+ messages in thread
From: Hans-Peter Nilsson @ 2020-12-28  2:39 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel
  Cc: John Garry, Will Deacon, Mathieu Poirier, Leo Yan,
	Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Kim Phillips

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>
Cc: John Garry <john.garry@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Kim Phillips <kim.phillips@arm.com>
---
 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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-12-21 20:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).