diff --git a/src/util/u_debug_refcnt.c b/src/util/u_debug_refcnt.c index 06498eb6772..566fb9cc51c 100644 --- a/src/util/u_debug_refcnt.c +++ b/src/util/u_debug_refcnt.c @@ -174,10 +174,12 @@ debug_reference_slowpath(const struct pipe_reference *p, /* this is here to provide a gradual change even if we don't see * the initialization */ - for (i = 1; i <= refcnt - change; ++i) { - fprintf(stream, "<%s> %p %u AddRef %u\n", buf, (void *) p, - serial, i); - debug_backtrace_print(stream, frames, STACK_LEN); + if (refcnt <= 10) { + for (i = 1; i <= refcnt - change; ++i) { + fprintf(stream, "<%s> %p %u AddRef %u\n", buf, (void *) p, + serial, i); + debug_backtrace_print(stream, frames, STACK_LEN); + } } }