|
@@ -1029,7 +1029,7 @@ out_err:
|
|
|
|
|
|
int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *target,
|
|
int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *target,
|
|
const char *argv[], bool pipe_output,
|
|
const char *argv[], bool pipe_output,
|
|
- bool want_signal)
|
|
|
|
|
|
+ void (*exec_error)(int signo, siginfo_t *info, void *ucontext))
|
|
{
|
|
{
|
|
int child_ready_pipe[2], go_pipe[2];
|
|
int child_ready_pipe[2], go_pipe[2];
|
|
char bf;
|
|
char bf;
|
|
@@ -1073,7 +1073,7 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *tar
|
|
|
|
|
|
execvp(argv[0], (char **)argv);
|
|
execvp(argv[0], (char **)argv);
|
|
|
|
|
|
- if (want_signal) {
|
|
|
|
|
|
+ if (exec_error) {
|
|
union sigval val;
|
|
union sigval val;
|
|
|
|
|
|
val.sival_int = errno;
|
|
val.sival_int = errno;
|
|
@@ -1084,6 +1084,14 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *tar
|
|
exit(-1);
|
|
exit(-1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (exec_error) {
|
|
|
|
+ struct sigaction act = {
|
|
|
|
+ .sa_flags = SA_SIGINFO,
|
|
|
|
+ .sa_sigaction = exec_error,
|
|
|
|
+ };
|
|
|
|
+ sigaction(SIGUSR1, &act, NULL);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (target__none(target))
|
|
if (target__none(target))
|
|
evlist->threads->map[0] = evlist->workload.pid;
|
|
evlist->threads->map[0] = evlist->workload.pid;
|
|
|
|
|