diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
| -rw-r--r-- | tools/perf/builtin-record.c | 15 | 
1 files changed, 10 insertions, 5 deletions
| diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f1a939ebc19..cdf58ecc04b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -5,8 +5,6 @@   * (or a CPU, or a PID) into the perf.data output file - for   * later analysis via perf report.   */ -#define _FILE_OFFSET_BITS 64 -  #include "builtin.h"  #include "perf.h" @@ -474,7 +472,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)  	}  	if (forks) { -		err = perf_evlist__prepare_workload(evsel_list, opts, argv); +		err = perf_evlist__prepare_workload(evsel_list, &opts->target, +						    argv, opts->pipe_output, +						    true);  		if (err < 0) {  			pr_err("Couldn't run the workload!\n");  			goto out_delete_session; @@ -953,6 +953,8 @@ const struct option record_options[] = {  	OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,  		     "branch filter mask", "branch stack filter modes",  		     parse_branch_stack), +	OPT_BOOLEAN('W', "weight", &record.opts.sample_weight, +		    "sample by weight (on special events only)"),  	OPT_END()  }; @@ -964,7 +966,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)  	struct perf_record *rec = &record;  	char errbuf[BUFSIZ]; -	evsel_list = perf_evlist__new(NULL, NULL); +	evsel_list = perf_evlist__new();  	if (evsel_list == NULL)  		return -ENOMEM; @@ -1026,7 +1028,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)  		ui__error("%s", errbuf);  		err = -saved_errno; -		goto out_free_fd; +		goto out_symbol_exit;  	}  	err = -ENOMEM; @@ -1057,6 +1059,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)  	}  	err = __cmd_record(&record, argc, argv); + +	perf_evlist__munmap(evsel_list); +	perf_evlist__close(evsel_list);  out_free_fd:  	perf_evlist__delete_maps(evsel_list);  out_symbol_exit: |