aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/perf_counter/builtin-stat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index cf575c305a6c..03518d75d864 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -538,8 +538,14 @@ static void process_options(int argc, char **argv)
538 } 538 }
539} 539}
540 540
541static void skip_signal(int signo)
542{
543}
544
541int cmd_stat(int argc, char **argv, const char *prefix) 545int cmd_stat(int argc, char **argv, const char *prefix)
542{ 546{
547 sigset_t blocked;
548
543 page_size = sysconf(_SC_PAGE_SIZE); 549 page_size = sysconf(_SC_PAGE_SIZE);
544 550
545 process_options(argc, argv); 551 process_options(argc, argv);
@@ -548,5 +554,15 @@ int cmd_stat(int argc, char **argv, const char *prefix)
548 assert(nr_cpus <= MAX_NR_CPUS); 554 assert(nr_cpus <= MAX_NR_CPUS);
549 assert(nr_cpus >= 0); 555 assert(nr_cpus >= 0);
550 556
557 /*
558 * We dont want to block the signals - that would cause
559 * child tasks to inherit that and Ctrl-C would not work.
560 * What we want is for Ctrl-C to work in the exec()-ed
561 * task, but being ignored by perf stat itself:
562 */
563 signal(SIGINT, skip_signal);
564 signal(SIGALRM, skip_signal);
565 signal(SIGABRT, skip_signal);
566
551 return do_perfstat(argc, argv); 567 return do_perfstat(argc, argv);
552} 568}