|
@@ -37,6 +37,7 @@
|
|
#include "util/llvm-utils.h"
|
|
#include "util/llvm-utils.h"
|
|
#include "util/bpf-loader.h"
|
|
#include "util/bpf-loader.h"
|
|
#include "util/trigger.h"
|
|
#include "util/trigger.h"
|
|
|
|
+#include "util/perf-hooks.h"
|
|
#include "asm/bug.h"
|
|
#include "asm/bug.h"
|
|
|
|
|
|
#include <unistd.h>
|
|
#include <unistd.h>
|
|
@@ -206,6 +207,12 @@ static void sig_handler(int sig)
|
|
done = 1;
|
|
done = 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void sigsegv_handler(int sig)
|
|
|
|
+{
|
|
|
|
+ perf_hooks__recover();
|
|
|
|
+ sighandler_dump_stack(sig);
|
|
|
|
+}
|
|
|
|
+
|
|
static void record__sig_exit(void)
|
|
static void record__sig_exit(void)
|
|
{
|
|
{
|
|
if (signr == -1)
|
|
if (signr == -1)
|
|
@@ -833,6 +840,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
|
|
signal(SIGCHLD, sig_handler);
|
|
signal(SIGCHLD, sig_handler);
|
|
signal(SIGINT, sig_handler);
|
|
signal(SIGINT, sig_handler);
|
|
signal(SIGTERM, sig_handler);
|
|
signal(SIGTERM, sig_handler);
|
|
|
|
+ signal(SIGSEGV, sigsegv_handler);
|
|
|
|
|
|
if (rec->opts.auxtrace_snapshot_mode || rec->switch_output) {
|
|
if (rec->opts.auxtrace_snapshot_mode || rec->switch_output) {
|
|
signal(SIGUSR2, snapshot_sig_handler);
|
|
signal(SIGUSR2, snapshot_sig_handler);
|
|
@@ -970,6 +978,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
|
|
|
|
|
|
trigger_ready(&auxtrace_snapshot_trigger);
|
|
trigger_ready(&auxtrace_snapshot_trigger);
|
|
trigger_ready(&switch_output_trigger);
|
|
trigger_ready(&switch_output_trigger);
|
|
|
|
+ perf_hooks__invoke_record_start();
|
|
for (;;) {
|
|
for (;;) {
|
|
unsigned long long hits = rec->samples;
|
|
unsigned long long hits = rec->samples;
|
|
|
|
|
|
@@ -1114,6 +1123,8 @@ out_child:
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ perf_hooks__invoke_record_end();
|
|
|
|
+
|
|
if (!err && !quiet) {
|
|
if (!err && !quiet) {
|
|
char samples[128];
|
|
char samples[128];
|
|
const char *postfix = rec->timestamp_filename ?
|
|
const char *postfix = rec->timestamp_filename ?
|