diff options
author | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-08-16 10:44:25 -0400 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-08-26 01:47:30 +0000 |
commit | 0bbb9001c24285e2c7ed93bef3638cd61c029230 (patch) | |
tree | 325a8a117b68db7698e4c05315119b8a56b9744e /src/mesa/drivers/dri | |
parent | 565f9105b70b2efd9cab34c218d90596a2d04ce0 (diff) |
i915: remove use of backtrace and backtrace_symbols
The function `debug_backtrace` relied on glibc specific functions, and is
unused unless someone manually patches the source to set DEBUG_BACKTRACE_SIZE
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12108>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_regions.c | 60 |
1 files changed, 4 insertions, 56 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_regions.c b/src/mesa/drivers/dri/i915/intel_regions.c index 803ea9326e8..ae49f9c363a 100644 --- a/src/mesa/drivers/dri/i915/intel_regions.c +++ b/src/mesa/drivers/dri/i915/intel_regions.c @@ -52,58 +52,6 @@ #define FILE_DEBUG_FLAG DEBUG_REGION -/* This should be set to the maximum backtrace size desired. - * Set it to 0 to disable backtrace debugging. - */ -#define DEBUG_BACKTRACE_SIZE 0 - -#if DEBUG_BACKTRACE_SIZE == 0 || !defined(HAVE_EXECINFO_H) -/* Use the standard debug output */ -#define _DBG(...) DBG(__VA_ARGS__) -#else -/* Use backtracing debug output */ -#define _DBG(...) {debug_backtrace(); DBG(__VA_ARGS__);} - -/* Backtracing debug support */ -#include <execinfo.h> - -static void -debug_backtrace(void) -{ - void *trace[DEBUG_BACKTRACE_SIZE]; - char **strings = NULL; - int traceSize; - register int i; - - traceSize = backtrace(trace, DEBUG_BACKTRACE_SIZE); - strings = backtrace_symbols(trace, traceSize); - if (strings == NULL) { - DBG("no backtrace:"); - return; - } - - /* Spit out all the strings with a colon separator. Ignore - * the first, since we don't really care about the call - * to debug_backtrace() itself. Skip until the final "/" in - * the trace to avoid really long lines. - */ - for (i = 1; i < traceSize; i++) { - char *p = strings[i], *slash = strings[i]; - while (*p) { - if (*p++ == '/') { - slash = p; - } - } - - DBG("%s:", slash); - } - - /* Free up the memory, and we're done */ - free(strings); -} - -#endif - static struct intel_region * intel_region_alloc_internal(struct intel_screen *screen, GLuint cpp, @@ -124,7 +72,7 @@ intel_region_alloc_internal(struct intel_screen *screen, region->bo = buffer; region->tiling = tiling; - _DBG("%s <-- %p\n", __func__, region); + DBG("%s <-- %p\n", __func__, region); return region; } @@ -241,7 +189,7 @@ intel_region_alloc_for_fd(struct intel_screen *screen, void intel_region_reference(struct intel_region **dst, struct intel_region *src) { - _DBG("%s: %p(%d) -> %p(%d)\n", __func__, + DBG("%s: %p(%d) -> %p(%d)\n", __func__, *dst, *dst ? (*dst)->refcount : 0, src, src ? src->refcount : 0); if (src != *dst) { @@ -260,11 +208,11 @@ intel_region_release(struct intel_region **region_handle) struct intel_region *region = *region_handle; if (region == NULL) { - _DBG("%s NULL\n", __func__); + DBG("%s NULL\n", __func__); return; } - _DBG("%s %p %d\n", __func__, region, region->refcount - 1); + DBG("%s %p %d\n", __func__, region, region->refcount - 1); assert(region->refcount > 0); region->refcount--; |