Skip to content

Commit 01c2d99

Browse files
committed
perf record: Move mmap_pages to perf_record_opts
Tools being developed will need this to allow the user to override this value. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> 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-zydc1yhxfm0z35fuy95bsn1l@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 50a682c commit 01c2d99

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎tools/perf/builtin-record.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ enum write_mode_t {
3535
WRITE_APPEND
3636
};
3737

38-
static struct perf_record_opts record_opts = {
38+
struct perf_record_opts record_opts = {
3939
.target_pid = -1,
4040
.target_tid = -1,
41+
.mmap_pages = UINT_MAX,
4142
.user_freq = UINT_MAX,
4243
.user_interval = ULLONG_MAX,
4344
.freq = 1000,
4445
.sample_id_all_avail = true,
4546
};
4647

4748
static unsigned int page_size;
48-
static unsigned int mmap_pages = UINT_MAX;
4949
static int output;
5050
static const char *output_name = NULL;
5151
static bool group = false;
@@ -272,7 +272,7 @@ static void open_counters(struct perf_evlist *evlist)
272272
exit(-1);
273273
}
274274

275-
if (perf_evlist__mmap(evlist, mmap_pages, false) < 0)
275+
if (perf_evlist__mmap(evlist, record_opts.mmap_pages, false) < 0)
276276
die("failed to mmap with %d (%s)\n", errno, strerror(errno));
277277

278278
if (file_new)
@@ -647,7 +647,8 @@ const struct option record_options[] = {
647647
OPT_BOOLEAN('i', "no-inherit", &record_opts.no_inherit,
648648
"child tasks do not inherit counters"),
649649
OPT_UINTEGER('F', "freq", &record_opts.user_freq, "profile at this frequency"),
650-
OPT_UINTEGER('m', "mmap-pages", &mmap_pages, "number of mmap data pages"),
650+
OPT_UINTEGER('m', "mmap-pages", &record_opts.mmap_pages,
651+
"number of mmap data pages"),
651652
OPT_BOOLEAN(0, "group", &group,
652653
"put the counters into a counter group"),
653654
OPT_BOOLEAN('g', "call-graph", &record_opts.call_graph,

‎tools/perf/perf.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ struct perf_record_opts {
200200
bool sample_id_all_avail;
201201
bool system_wide;
202202
unsigned int freq;
203+
unsigned int mmap_pages;
203204
unsigned int user_freq;
204205
u64 default_interval;
205206
u64 user_interval;

0 commit comments

Comments
 (0)