mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
perf evlist: Move the SIGUSR1 error reporting logic to prepare_workload
So that we have the boilerplate in the preparation method, instead of open coded in tools wanting the reporting when the exec fails. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-purbdzcphdveskh7wwmnm4t7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
f33cbe72e6
commit
735f7e0bbe
7 changed files with 32 additions and 40 deletions
|
@ -390,7 +390,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
|
|||
if (forks) {
|
||||
err = perf_evlist__prepare_workload(evsel_list, &opts->target,
|
||||
argv, file->is_pipe,
|
||||
true);
|
||||
workload_exec_failed_signal);
|
||||
if (err < 0) {
|
||||
pr_err("Couldn't run the workload!\n");
|
||||
goto out_delete_session;
|
||||
|
@ -507,20 +507,8 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
|
|||
/*
|
||||
* Let the child rip
|
||||
*/
|
||||
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);
|
||||
if (forks)
|
||||
perf_evlist__start_workload(evsel_list);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
int hits = rec->samples;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue