]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tracing: Show size of requested perf buffer
authorRobin H. Johnson <robbat2@gentoo.org>
Tue, 31 Aug 2021 04:37:22 +0000 (21:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2024 14:23:43 +0000 (16:23 +0200)
commit a90afe8d020da9298c98fddb19b7a6372e2feb45 upstream.

If the perf buffer isn't large enough, provide a hint about how large it
needs to be for whatever is running.

Link: https://lkml.kernel.org/r/20210831043723.13481-1-robbat2@gentoo.org
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
kernel/trace/trace_event_perf.c

index 643e0b19920d25be593f9bce0be837fe1a6bdc38..eb81ad523a55311d988796672b11fc7a5f581c1d 100644 (file)
@@ -400,7 +400,8 @@ void *perf_trace_buf_alloc(int size, struct pt_regs **regs, int *rctxp)
        BUILD_BUG_ON(PERF_MAX_TRACE_SIZE % sizeof(unsigned long));
 
        if (WARN_ONCE(size > PERF_MAX_TRACE_SIZE,
-                     "perf buffer not large enough"))
+                     "perf buffer not large enough, wanted %d, have %d",
+                     size, PERF_MAX_TRACE_SIZE))
                return NULL;
 
        *rctxp = rctx = perf_swevent_get_recursion_context();