aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f1a939ebc19c..cdf58ecc04b1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -5,8 +5,6 @@
5 * (or a CPU, or a PID) into the perf.data output file - for 5 * (or a CPU, or a PID) into the perf.data output file - for
6 * later analysis via perf report. 6 * later analysis via perf report.
7 */ 7 */
8#define _FILE_OFFSET_BITS 64
9
10#include "builtin.h" 8#include "builtin.h"
11 9
12#include "perf.h" 10#include "perf.h"
@@ -474,7 +472,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
474 } 472 }
475 473
476 if (forks) { 474 if (forks) {
477 err = perf_evlist__prepare_workload(evsel_list, opts, argv); 475 err = perf_evlist__prepare_workload(evsel_list, &opts->target,
476 argv, opts->pipe_output,
477 true);
478 if (err < 0) { 478 if (err < 0) {
479 pr_err("Couldn't run the workload!\n"); 479 pr_err("Couldn't run the workload!\n");
480 goto out_delete_session; 480 goto out_delete_session;
@@ -953,6 +953,8 @@ const struct option record_options[] = {
953 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack, 953 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,
954 "branch filter mask", "branch stack filter modes", 954 "branch filter mask", "branch stack filter modes",
955 parse_branch_stack), 955 parse_branch_stack),
956 OPT_BOOLEAN('W', "weight", &record.opts.sample_weight,
957 "sample by weight (on special events only)"),
956 OPT_END() 958 OPT_END()
957}; 959};
958 960
@@ -964,7 +966,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
964 struct perf_record *rec = &record; 966 struct perf_record *rec = &record;
965 char errbuf[BUFSIZ]; 967 char errbuf[BUFSIZ];
966 968
967 evsel_list = perf_evlist__new(NULL, NULL); 969 evsel_list = perf_evlist__new();
968 if (evsel_list == NULL) 970 if (evsel_list == NULL)
969 return -ENOMEM; 971 return -ENOMEM;
970 972
@@ -1026,7 +1028,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
1026 ui__error("%s", errbuf); 1028 ui__error("%s", errbuf);
1027 1029
1028 err = -saved_errno; 1030 err = -saved_errno;
1029 goto out_free_fd; 1031 goto out_symbol_exit;
1030 } 1032 }
1031 1033
1032 err = -ENOMEM; 1034 err = -ENOMEM;
@@ -1057,6 +1059,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
1057 } 1059 }
1058 1060
1059 err = __cmd_record(&record, argc, argv); 1061 err = __cmd_record(&record, argc, argv);
1062
1063 perf_evlist__munmap(evsel_list);
1064 perf_evlist__close(evsel_list);
1060out_free_fd: 1065out_free_fd:
1061 perf_evlist__delete_maps(evsel_list); 1066 perf_evlist__delete_maps(evsel_list);
1062out_symbol_exit: 1067out_symbol_exit: