From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/5] perf trace-event: Report tracepoint format errors with NULL and errno
Date: Fri, 18 Sep 2026 06:41:57 +0000 [thread overview]
Message-ID: <20260918064157.7C6741F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260918063249.2172589-2-irogers@google.com>
> trace_event__tp_format() encoded failure with ERR_PTR() while
> trace_event__tp_format_id() returned a plain NULL when tep_find_event()
> found nothing, and tp_format() itself returned NULL when
> tep_parse_format() failed, as its return value was discarded. Callers
> test with IS_ERR(), which NULL does not satisfy, so those two failures
> were taken for success. In syscall__read_info() that leads straight to:
>
> if (IS_ERR(sc->tp_format)) {
> ...
> return err;
> }
> if (syscall__alloc_arg_fmts(sc, sc->tp_format->format.nr_fields - 1))
>
> which dereferences NULL when a format file fails to parse.
>
> Mixing encoded error pointers with pointers that are compared against
> NULL is what allows that to happen, so drop ERR_PTR() here and report
> failures the way the rest of these paths already expect, by returning
> NULL with errno set. evsel__tp_format() no longer has to translate the
> error back into errno before printing it with %m, and the remaining
> callers become NULL tests.
>
> syscall__scnprintf_args() gains back its fallback of printing raw
> arguments: it asked for IS_ERR(sc->tp_format), but syscall__read_info()
> had already replaced the error pointer with NULL, so the branch could
> never be taken.
>
> Assisted-by: Antigravity:gemini-3.1-pro
> Signed-off-by: Ian Rogers <irogers@google.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260918063249.2172589-1-irogers@google.com?part=1
next prev parent reply other threads:[~2026-09-18 6:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 6:32 [PATCH v1 0/5] perf trace: Tracepoint format error handling and leak fixes Ian Rogers
2026-09-18 6:32 ` [PATCH v1 1/5] perf trace-event: Report tracepoint format errors with NULL and errno Ian Rogers
2026-09-18 6:41 ` sashiko-bot [this message]
2026-09-18 6:32 ` [PATCH v1 2/5] perf trace-event: Reuse an already parsed tracepoint format Ian Rogers
2026-09-18 6:38 ` sashiko-bot
2026-09-18 6:32 ` [PATCH v1 3/5] perf trace-event: Free the global trace_event when a command ends Ian Rogers
2026-09-18 6:41 ` sashiko-bot
2026-09-18 6:32 ` [PATCH v1 4/5] perf trace: Free the host machine allocation Ian Rogers
2026-09-18 6:45 ` sashiko-bot
2026-09-18 6:32 ` [PATCH v1 5/5] perf thread: Free the comm read from procfs Ian Rogers
2026-09-18 6:38 ` sashiko-bot
2026-09-25 13:00 ` [PATCH v1 0/5] perf trace: Tracepoint format error handling and leak fixes Arnaldo Carvalho de Melo
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=20260918064157.7C6741F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.