+
+#define log_backtrace(count, max) \
+if (count++ < max) { \
+ void *array[20]; \
+ char **strings; \
+ int size, i; \
+ log(0, 0, 0, t, "Backtrace follows"); \
+ size = backtrace(array, 10); \
+ strings = backtrace_symbols(array, size); \
+ if (strings) for (i = 0; i < size; i++) \
+ { \
+ log(0, 0, 0, t, "%s\n", strings[i]); \
+ } \
+ free(strings); \
+}
+