diff options
-rw-r--r-- | tools/perf/util/util.c | 7 | ||||
-rw-r--r-- | tools/perf/util/util.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index 92db3f1..4ee6d0d 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c @@ -269,6 +269,13 @@ void dump_stack(void) void dump_stack(void) {} #endif +void sighandler_dump_stack(int sig) +{ + psignal(sig, "perf"); + dump_stack(); + exit(sig); +} + void get_term_dimensions(struct winsize *ws) { char *s = getenv("LINES"); diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index 73c2f8e..fbd598a 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h @@ -277,6 +277,7 @@ char *ltrim(char *s); char *rtrim(char *s); void dump_stack(void); +void sighandler_dump_stack(int sig); extern unsigned int page_size; extern int cacheline_size; |