mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Howard Chu <howardchu95@gmail.com>, Namhyung Kim <namhyung@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Ian Rogers <irogers@google.com>, Jiri Olsa <jolsa@kernel.org>,
	Kan Liang <kan.liang@intel.com>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH/RFT] Re: [PATCH v5 1/8] perf trace: Fix iteration of syscall ids in syscalltbl->entries
Date: Thu, 10 Oct 2024 10:22:12 +0200	[thread overview]
Message-ID: <3a592835-a14f-40be-8961-c0cee7720a94@kernel.org> (raw)
In-Reply-To: <CAH0uvojw5EKqxqETq_H3-5zmjXiK=ew2hBQiPDpCtZmO7=mrKA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1289 bytes --]

On 09. 10. 24, 8:58, Howard Chu wrote:
> If Namhyung's fix alone does not solve the problem please try this:

Hi,

it obviously did not. But this one indeed does.

> --- a/tools/perf/util/syscalltbl.c
> +++ b/tools/perf/util/syscalltbl.c
> @@ -46,6 +46,11 @@ static const char *const *syscalltbl_native =
> syscalltbl_mips_n64;
>   #include <asm/syscalls.c>
>   const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID;
>   static const char *const *syscalltbl_native = syscalltbl_loongarch;
> +#else
> +const int syscalltbl_native_max_id = 1;

This ^^^ should be 0 IMO. Look:
         for (i = 0; i <= syscalltbl_native_max_id; ++i)
                 if (syscalltbl_native[i])
                         ++nr_entries;

> +static const char *const syscalltbl_native[] = {
> +       [0] = "unknown",
> +};
>   #endif
> 
>   struct syscall {
> @@ -182,6 +187,11 @@ int syscalltbl__id(struct syscalltbl *tbl, const
> char *name)
>           return audit_name_to_syscall(name, tbl->audit_machine);
>   }
> 
> +int syscalltbl__id_at_idx(struct syscalltbl *tbl __maybe_unused, int idx)
> +{
> +        return idx;
> +}

This looks somewhat familiar :):
https://lore.kernel.org/all/739001a4-4df1-4dec-a141-926c78c5c07e@kernel.org/

I am attaching an updated patch.

thanks,
-- 
js
suse labs

[-- Attachment #2: 0001-perf-fix-non-listed-archs.patch --]
[-- Type: text/x-patch, Size: 1350 bytes --]

From 3d4f06d79c949a8f155c20652b4f685540899ad4 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <jslaby@suse.cz>
Date: Thu, 10 Oct 2024 09:57:07 +0200
Subject: [PATCH] perf: fix non-listed archs

Suggested-by: Howard Chu <howardchu95@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 tools/perf/util/syscalltbl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/syscalltbl.c b/tools/perf/util/syscalltbl.c
index 7c15dec6900d..6c45ded922b6 100644
--- a/tools/perf/util/syscalltbl.c
+++ b/tools/perf/util/syscalltbl.c
@@ -46,6 +46,11 @@ static const char *const *syscalltbl_native = syscalltbl_mips_n64;
 #include <asm/syscalls.c>
 const int syscalltbl_native_max_id = SYSCALLTBL_LOONGARCH_MAX_ID;
 static const char *const *syscalltbl_native = syscalltbl_loongarch;
+#else
+const int syscalltbl_native_max_id = 0;
+static const char *const syscalltbl_native[] = {
+	[0] = "unknown",
+};
 #endif
 
 struct syscall {
@@ -182,6 +187,11 @@ int syscalltbl__id(struct syscalltbl *tbl, const char *name)
 	return audit_name_to_syscall(name, tbl->audit_machine);
 }
 
+int syscalltbl__id_at_idx(struct syscalltbl *tbl __maybe_unused, int idx)
+{
+	return idx;
+}
+
 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused,
 				  const char *syscall_glob __maybe_unused, int *idx __maybe_unused)
 {
-- 
2.46.1


  reply	other threads:[~2024-10-10  8:22 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 13:20 [PATCH v5 0/8] perf trace: Augment enum arguments with BTF Howard Chu
2024-07-05 13:20 ` [PATCH v5 1/8] perf trace: Fix iteration of syscall ids in syscalltbl->entries Howard Chu
2024-07-12 16:51   ` Namhyung Kim
2024-08-30 10:24   ` Jiri Slaby
2024-08-30 10:27     ` Jiri Slaby
2024-08-30 23:30     ` [PATCH/RFT] " Arnaldo Carvalho de Melo
2024-08-31  0:35       ` Ian Rogers
2024-09-02 18:53         ` Arnaldo Carvalho de Melo
2024-09-02  5:25       ` Jiri Slaby
2024-09-02 18:54         ` Arnaldo Carvalho de Melo
2024-09-27  5:09           ` Jiri Slaby
2024-10-08  9:09             ` Jiri Slaby
2024-10-09  5:57               ` Namhyung Kim
     [not found]                 ` <CAH0uvoi622J7gZ9BoTik7niNH3axVJR0kPNovUQnMjUB6GWLNg@mail.gmail.com>
2024-10-09  6:58                   ` Howard Chu
2024-10-10  8:22                     ` Jiri Slaby [this message]
2024-10-10 16:29                       ` Namhyung Kim
2024-10-10 16:31                         ` Namhyung Kim
2024-10-10 21:02                           ` Arnaldo Carvalho de Melo
2024-10-14 12:19                             ` Jiri Slaby
     [not found]                               ` <CA+JHD937angqu=48-kPC7LvtMMQPgUGp+2x5b+JKVNoFa3+9HQ@mail.gmail.com>
2024-10-14 13:04                                 ` Jiri Slaby
2024-10-14 13:06                                   ` Jiri Slaby
2024-10-14 13:12                                   ` Jiri Slaby
2024-10-18 22:16                               ` Arnaldo Carvalho de Melo
2024-10-18 22:26                                 ` Arnaldo Carvalho de Melo
2024-10-21  5:43                                   ` Jiri Slaby
2024-10-22 15:18                                     ` Arnaldo Carvalho de Melo
2024-10-10  8:11                 ` Jiri Slaby
2024-10-10 16:19                   ` Namhyung Kim
2024-07-05 13:20 ` [PATCH v5 2/8] perf trace: BTF-based enum pretty printing for syscall args Howard Chu
2024-07-05 13:20 ` [PATCH v5 3/8] perf trace: Augment non-syscall tracepoints with enum arguments with BTF Howard Chu
2024-07-05 13:20 ` [PATCH v5 4/8] perf trace: Filter enum arguments with enum names Howard Chu
2024-07-05 13:20 ` [PATCH v5 5/8] perf test: Add landlock workload Howard Chu
2024-07-05 13:20 ` [PATCH v5 6/8] perf test trace_btf_enum: Add regression test for the BTF augmentation of enums in 'perf trace' Howard Chu
2024-07-05 13:20 ` [PATCH v5 7/8] perf trace: Introduce trace__btf_scnprintf() Howard Chu
2024-07-05 13:20 ` [PATCH v5 8/8] perf trace: Remove arg_fmt->is_enum, we can get that from the BTF type Howard Chu
2024-07-10 18:02 ` [PATCH v5 0/8] perf trace: Augment enum arguments with BTF Ian Rogers
2024-07-13 15:06 ` Namhyung Kim

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=3a592835-a14f-40be-8961-c0cee7720a94@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=howardchu95@gmail.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@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

all inboxes | Powered by JetHome®