Commit 7b392ef0 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo
Browse files

perf evlist: Use the right prefix for 'struct evlist' 'workload' methods



perf_evlist__ is for 'struct perf_evlist' methods, in tools/lib/perf/,
go on completing this split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a622eafa
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ static void sig_handler(int sig __maybe_unused)
}

/*
 * perf_evlist__prepare_workload will send a SIGUSR1 if the fork fails, since
 * evlist__prepare_workload will send a SIGUSR1 if the fork fails, since
 * we asked by setting its exec_error to the function below,
 * ftrace__workload_exec_failed_signal.
 *
@@ -600,8 +600,7 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
	if (write_tracing_file("trace", "0") < 0)
		goto out;

	if (argc && perf_evlist__prepare_workload(ftrace->evlist,
				&ftrace->target, argv, false,
	if (argc && evlist__prepare_workload(ftrace->evlist, &ftrace->target, argv, false,
					     ftrace__workload_exec_failed_signal) < 0) {
		goto out;
	}
@@ -644,7 +643,7 @@ static int __cmd_ftrace(struct perf_ftrace *ftrace, int argc, const char **argv)
		}
	}

	perf_evlist__start_workload(ftrace->evlist);
	evlist__start_workload(ftrace->evlist);

	if (ftrace->initial_delay) {
		usleep(ftrace->initial_delay * 1000);
+5 −6
Original line number Diff line number Diff line
@@ -1333,7 +1333,7 @@ record__switch_output(struct record *rec, bool at_exit)
static volatile int workload_exec_errno;

/*
 * perf_evlist__prepare_workload will send a SIGUSR1
 * evlist__prepare_workload will send a SIGUSR1
 * if the fork fails, since we asked by setting its
 * want_signal to true.
 */
@@ -1689,8 +1689,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
	record__init_features(rec);

	if (forks) {
		err = perf_evlist__prepare_workload(rec->evlist, &opts->target,
						    argv, data->is_pipe,
		err = evlist__prepare_workload(rec->evlist, &opts->target, argv, data->is_pipe,
					       workload_exec_failed_signal);
		if (err < 0) {
			pr_err("Couldn't run the workload!\n");
@@ -1835,7 +1834,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
						  machine);
		free(event);

		perf_evlist__start_workload(rec->evlist);
		evlist__start_workload(rec->evlist);
	}

	if (evlist__initialize_ctlfd(rec->evlist, opts->ctl_fd, opts->ctl_fd_ack))
@@ -2413,7 +2412,7 @@ static bool dry_run;
 * XXX Will stay a global variable till we fix builtin-script.c to stop messing
 * with it and switch to use the library functions in perf_evlist that came
 * from builtin-record.c, i.e. use record_opts,
 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
 * evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
 * using pipes, etc.
 */
static struct option __record_options[] = {
+3 −4
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ static void disable_counters(void)
static volatile int workload_exec_errno;

/*
 * perf_evlist__prepare_workload will send a SIGUSR1
 * evlist__prepare_workload will send a SIGUSR1
 * if the fork fails, since we asked by setting its
 * want_signal to true.
 */
@@ -724,8 +724,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
	bool second_pass = false;

	if (forks) {
		if (perf_evlist__prepare_workload(evsel_list, &target, argv, is_pipe,
						  workload_exec_failed_signal) < 0) {
		if (evlist__prepare_workload(evsel_list, &target, argv, is_pipe, workload_exec_failed_signal) < 0) {
			perror("failed to prepare workload");
			return -1;
		}
@@ -876,7 +875,7 @@ static int __run_perf_stat(int argc, const char **argv, int run_idx)
	clock_gettime(CLOCK_MONOTONIC, &ref_time);

	if (forks) {
		perf_evlist__start_workload(evsel_list);
		evlist__start_workload(evsel_list);
		enable_counters();

		if (interval || timeout || evlist__ctlfd_initialized(evsel_list))
+3 −4
Original line number Diff line number Diff line
@@ -3680,7 +3680,7 @@ static int trace__set_filter_pids(struct trace *trace)
	 * Better not use !target__has_task() here because we need to cover the
	 * case where no threads were specified in the command line, but a
	 * workload was, and in that case we will fill in the thread_map when
	 * we fork the workload in perf_evlist__prepare_workload.
	 * we fork the workload in evlist__prepare_workload.
	 */
	if (trace->filter_pids.nr > 0) {
		err = perf_evlist__append_tp_filter_pids(trace->evlist, trace->filter_pids.nr,
@@ -3969,8 +3969,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
	signal(SIGINT, sig_handler);

	if (forks) {
		err = perf_evlist__prepare_workload(evlist, &trace->opts.target,
						    argv, false, NULL);
		err = evlist__prepare_workload(evlist, &trace->opts.target, argv, false, NULL);
		if (err < 0) {
			fprintf(trace->output, "Couldn't run the workload!\n");
			goto out_delete_evlist;
@@ -4043,7 +4042,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
		evlist__enable(evlist);

	if (forks)
		perf_evlist__start_workload(evlist);
		evlist__start_workload(evlist);

	if (trace->opts.initial_delay) {
		usleep(trace->opts.initial_delay * 1000);
+2 −2
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ static int attach__enable_on_exec(struct evlist *evlist)
		return err;
	}

	err = perf_evlist__prepare_workload(evlist, &target, argv, false, NULL);
	err = evlist__prepare_workload(evlist, &target, argv, false, NULL);
	if (err < 0) {
		pr_debug("Couldn't run the workload!\n");
		return err;
@@ -47,7 +47,7 @@ static int attach__enable_on_exec(struct evlist *evlist)
		return err;
	}

	return perf_evlist__start_workload(evlist) == 1 ? TEST_OK : TEST_FAIL;
	return evlist__start_workload(evlist) == 1 ? TEST_OK : TEST_FAIL;
}

static int detach__enable_on_exec(struct evlist *evlist)
Loading