1From bcfc4c8d7dc70bd81367c183a68cc9ee02ab4744 Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Fri, 28 May 2021 17:52:57 -0700 4Subject: [PATCH] track: Check for unw_set_caching_policy before using 5 6llvm libunwind does not implement unw_cache_* functions yet 7Include inttypes.h got PRI* macros 8 9Upstream-Status: Submitted [https://github.com/KDE/heaptrack/pull/33] 10Signed-off-by: Khem Raj <raj.khem@gmail.com> 11--- 12 src/track/trace_libunwind.cpp | 3 +++ 13 1 file changed, 3 insertions(+) 14 15diff --git a/src/track/trace_libunwind.cpp b/src/track/trace_libunwind.cpp 16index c76337c..96b2176 100644 17--- a/src/track/trace_libunwind.cpp 18+++ b/src/track/trace_libunwind.cpp 19@@ -26,6 +26,7 @@ 20 21 #define UNW_LOCAL_ONLY 22 #include <libunwind.h> 23+#include <inttypes.h> 24 25 #include <stdio.h> 26 27@@ -60,9 +61,11 @@ void Trace::print() 28 void Trace::setup() 29 { 30 // configure libunwind for better speed 31+#if UNW_CACHE_PER_THREAD 32 if (unw_set_caching_policy(unw_local_addr_space, UNW_CACHE_PER_THREAD)) { 33 fprintf(stderr, "WARNING: Failed to enable per-thread libunwind caching.\n"); 34 } 35+#endif 36 #if LIBUNWIND_HAS_UNW_SET_CACHE_SIZE 37 if (unw_set_cache_size(unw_local_addr_space, 1024, 0)) { 38 fprintf(stderr, "WARNING: Failed to set libunwind cache size.\n"); 39-- 402.31.1 41 42