[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-79kjmerlw6d88csyx1afzwvn@git.kernel.org>
Date: Thu, 26 Feb 2015 03:34:51 -0800
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: tglx@...utronix.de, namhyung@...nel.org, jolsa@...hat.com,
bp@...e.de, adrian.hunter@...el.com, dzickus@...hat.com,
mingo@...nel.org, acme@...hat.com, eranian@...gle.com,
hpa@...or.com, dsahern@...il.com, linux-kernel@...r.kernel.org,
fweisbec@...il.com
Subject: [tip:perf/core] perf tools: Introduce dump_stack signal helper
Commit-ID: 07c1a0dadfce976e9877c55ce5212dd14753c91d
Gitweb: http://git.kernel.org/tip/07c1a0dadfce976e9877c55ce5212dd14753c91d
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Tue, 24 Feb 2015 15:34:23 -0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 24 Feb 2015 15:34:23 -0300
perf tools: Introduce dump_stack signal helper
To use in stdio based tools, like 'trace'.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Borislav Petkov <bp@...e.de>
Cc: David Ahern <dsahern@...il.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-79kjmerlw6d88csyx1afzwvn@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/util.c | 7 +++++++
tools/perf/util/util.h | 1 +
2 files changed, 8 insertions(+)
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists