]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - tools/perf/builtin-stat.c
perf stat: Remove misplaced __maybe_unused
[mirror_ubuntu-hirsute-kernel.git] / tools / perf / builtin-stat.c
index 9d0d52d55ee610943133af873993016d89fe4a01..b27b2645eb3cacec8cf69293cd1498acff99802c 100644 (file)
@@ -58,7 +58,6 @@
 #include "util/thread.h"
 #include "util/thread_map.h"
 
-#include <signal.h>
 #include <stdlib.h>
 #include <sys/prctl.h>
 #include <locale.h>
@@ -542,8 +541,8 @@ static int __run_perf_stat(int argc, const char **argv)
        }
 
        if (forks) {
-               if (perf_evlist__prepare_workload(evsel_list, &target, argv,
-                                                 false, true) < 0) {
+               if (perf_evlist__prepare_workload(evsel_list, &target, argv, false,
+                                                 workload_exec_failed_signal) < 0) {
                        perror("failed to prepare workload");
                        return -1;
                }
@@ -598,18 +597,6 @@ static int __run_perf_stat(int argc, const char **argv)
        clock_gettime(CLOCK_MONOTONIC, &ref_time);
 
        if (forks) {
-               struct sigaction act = {
-                       .sa_flags     = SA_SIGINFO,
-                       .sa_sigaction = workload_exec_failed_signal,
-               };
-               /*
-                * perf_evlist__prepare_workload will, after we call
-                * perf_evlist__start_Workload, send a SIGUSR1 if the exec call
-                * fails, that we will catch in workload_signal to flip
-                * workload_exec_errno.
-                */
-               sigaction(SIGUSR1, &act, NULL);
-
                perf_evlist__start_workload(evsel_list);
                handle_initial_delay();
 
@@ -658,7 +645,7 @@ static int __run_perf_stat(int argc, const char **argv)
        return WEXITSTATUS(status);
 }
 
-static int run_perf_stat(int argc __maybe_unused, const char **argv)
+static int run_perf_stat(int argc, const char **argv)
 {
        int ret;
 
@@ -1795,14 +1782,14 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
        if (interval && interval < 100) {
                pr_err("print interval must be >= 100ms\n");
                parse_options_usage(stat_usage, options, "I", 1);
-               goto out_free_maps;
+               goto out;
        }
 
        if (perf_evlist__alloc_stats(evsel_list, interval))
-               goto out_free_maps;
+               goto out;
 
        if (perf_stat_init_aggr_mode())
-               goto out_free_maps;
+               goto out;
 
        /*
         * We dont want to block the signals - that would cause
@@ -1834,8 +1821,6 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
                print_stat(argc, argv);
 
        perf_evlist__free_stats(evsel_list);
-out_free_maps:
-       perf_evlist__delete_maps(evsel_list);
 out:
        perf_evlist__delete(evsel_list);
        return status;