]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tracing/hist: Support POLLPRI event for poll on histogram
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Fri, 27 Dec 2024 04:08:07 +0000 (13:08 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:35 +0000 (14:39 +0200)
commiteecb62a24b23b89169a6b25a00b47626b322abb8
tree0dd18254c69e6d7ceb2f9b7f784aa58d525753d3
parentfe87f8d3a5b485eb8fc605d37437c8a70bf89731
tracing/hist: Support POLLPRI event for poll on histogram

[ Upstream commit 66fc6f521a0b91051ce6968a216a30bc52267bf8 ]

Since POLLIN will not be flushed until the hist file is read, the user
needs to repeatedly read() and poll() on the hist file for monitoring the
event continuously. But the read() is somewhat redundant when the user is
only monitoring for event updates.

Add POLLPRI poll event on the hist file so the event returns when a
histogram is updated after open(), poll() or read(). Thus it is possible
to wait for the next event without having to issue a read().

Cc: Shuah Khan <shuah@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/173527248770.464571.2536902137325258133.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: 0b4ffbe4888a ("tracing: Correct the refcount if the hist/hist_debug file fails to open")
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/trace/trace_events_hist.c