History

tools/lib/lockdep: Remove private kernel headers

Move to using tools/include/ instead.

Levin, Alexander (Sasha Levin) committed 9 years ago

Commit e58e8711 parent 4ea4b3c49 files · +103 −158Browse files

Showing the changes to tools/include/linux/stacktrace.h (1 of 49 files). Show all

Unified · Split

tools/include/linux/stacktrace.h+32−0
@@ -0,0 +1,32 @@
1+#ifndef _LIBLOCKDEP_LINUX_STACKTRACE_H_
2+#define _LIBLOCKDEP_LINUX_STACKTRACE_H_
3+
4+#include <execinfo.h>
5+
6+struct stack_trace {
7+ unsigned int nr_entries, max_entries;
8+ unsigned long *entries;
9+ int skip;
10+};
11+
12+static inline void print_stack_trace(struct stack_trace *trace, int spaces)
13+{
14+ backtrace_symbols_fd((void **)trace->entries, trace->nr_entries, 1);
15+}
16+
17+#define save_stack_trace(trace) \
18+ ((trace)->nr_entries = \
19+ backtrace((void **)(trace)->entries, (trace)->max_entries))
20+
21+static inline int dump_stack(void)
22+{
23+ void *array[64];
24+ size_t size;
25+
26+ size = backtrace(array, 64);
27+ backtrace_symbols_fd(array, size, 1);
28+
29+ return 0;
30+}
31+
32+#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t