2023-05-29 02:40:25

by Tiezhu Yang

[permalink] [raw]
Subject: [PATCH v2 1/3] perf arm64: Rename create_table_from_c() to create_sc_table()

After commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"),
it has been removed the temporary C program and used shell to
generate syscall table, so let us rename create_table_from_c()
to create_sc_table() to avoid confusion.

Suggested-by: Leo Yan <[email protected]>
Signed-off-by: Tiezhu Yang <[email protected]>
---
tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
index 22cdf91..e530587 100755
--- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -19,7 +19,7 @@ if ! test -r $input; then
exit 1
fi

-create_table_from_c()
+create_sc_table()
{
local sc nr last_sc

@@ -35,7 +35,7 @@ create_table()
{
echo "#include \"$input\""
echo "static const char *syscalltbl_arm64[] = {"
- create_table_from_c
+ create_sc_table
echo "};"
}

--
2.1.0



2023-05-29 17:14:49

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] perf arm64: Rename create_table_from_c() to create_sc_table()

On Sun, May 28, 2023 at 7:23 PM Tiezhu Yang <[email protected]> wrote:
>
> After commit 9854e7ad35fe ("perf arm64: Simplify mksyscalltbl"),
> it has been removed the temporary C program and used shell to
> generate syscall table, so let us rename create_table_from_c()
> to create_sc_table() to avoid confusion.
>
> Suggested-by: Leo Yan <[email protected]>
> Signed-off-by: Tiezhu Yang <[email protected]>
> ---
> tools/perf/arch/arm64/entry/syscalls/mksyscalltbl | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> index 22cdf91..e530587 100755
> --- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> +++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
> @@ -19,7 +19,7 @@ if ! test -r $input; then
> exit 1
> fi
>
> -create_table_from_c()
> +create_sc_table()
> {
> local sc nr last_sc
>
> @@ -35,7 +35,7 @@ create_table()
> {
> echo "#include \"$input\""
> echo "static const char *syscalltbl_arm64[] = {"

I know this isn't changed here, but this would be better as:
echo "static const char *const syscalltbl_arm64[] = {"
as the array itself, not just the strings, should never be changing.

Thanks,
Ian

> - create_table_from_c
> + create_sc_table
> echo "};"
> }
>
> --
> 2.1.0
>