linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Aaron Tomlin <atomlin@atomlin.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com,
	james.clark@linaro.org, howardchu95@gmail.com, neelx@suse.com,
	chjohnst@mail.com, sean@ashe.io, steve@abita.co,
	rishil1999@outlook.com, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] perf sched: Suppress latency table output when trace samples are missing
Date: Fri, 31 Jul 2026 14:59:23 -0700	[thread overview]
Message-ID: <am0auzlYObfEmwCe@google.com> (raw)
In-Reply-To: <20260730185416.97166-2-atomlin@atomlin.com>

Hello,

On Thu, Jul 30, 2026 at 02:54:14PM -0400, Aaron Tomlin wrote:
> When 'perf sched latency' is executed on a perf.data file that lacks
> tracepoint samples (i.e., a file recorded without the -R flag or
> containing only non-tracepoint events), perf_session__has_traces()
> correctly outputs an error message. However, perf_sched__read_events()
> subsequently falls through and returns 0 (success).
> 
> Consequently, caller functions such as perf_sched__lat() assume event
> processing succeeded and proceed to render empty latency header tables
> and total summary statistics.
> 
> Fix this behaviour by ensuring perf_sched__read_events() aborts early and
> returns a suitable error code when perf_session__has_traces() evaluates
> to false.
> 
> For pipe mode streams, event attributes are received dynamically during
> event processing, meaning session->evlist is not populated prior to
> perf_session__process_events(). To handle pipe input correctly:
>   - Register the missing .attr, .tracing_data, .build_id, and .feature
>     callbacks in cmd_sched()
> 
>   - Promote the handlers array to file-scope (latency_handlers[]) and
>     invoke evlist__set_tracepoints_handlers() dynamically inside
>     perf_sched__process_tracepoint_sample() when evsel->handler is NULL
> 
>   - Perform the trace check post-processing when handling pipe data

Can you please split the pipe mode changes into a separate commit?

> 
> Additionally, validate thread__get_runtime() against NULL in
> map_switch_event() to prevent potential null-pointer dereferences.

This is small enough to be squashed.

Thanks,
Namhyung

  reply	other threads:[~2026-07-31 21:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 18:54 [PATCH v5 0/3] perf sched latency: Refine outputs, unit scaling, and histogram support Aaron Tomlin
2026-07-30 18:54 ` [PATCH v5 1/3] perf sched: Suppress latency table output when trace samples are missing Aaron Tomlin
2026-07-31 21:59   ` Namhyung Kim [this message]
2026-07-31 22:03     ` Aaron Tomlin
2026-07-30 18:54 ` [PATCH v5 2/3] perf sched latency: Auto-scale latency and runtime display units Aaron Tomlin
2026-07-31 22:01   ` Namhyung Kim
2026-07-30 18:54 ` [PATCH v5 3/3] perf sched latency: Add histogram and time interval options Aaron Tomlin

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=am0auzlYObfEmwCe@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=atomlin@atomlin.com \
    --cc=chjohnst@mail.com \
    --cc=howardchu95@gmail.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=neelx@suse.com \
    --cc=peterz@infradead.org \
    --cc=rishil1999@outlook.com \
    --cc=sean@ashe.io \
    --cc=steve@abita.co \
    /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).