aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-11 12:12:56 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:36:27 -0500
commited80f5813fd6ecc6d74250681910a4214f699d4e (patch)
tree83ca3cfb0742849533de1da4ad66ef4456e1ba64 /tools/perf/builtin-record.c
parentb424eba27160dd19577896d4520b8eebabed919f (diff)
perf record: Move 'group' to perf_event_ops
Will be used in other tools to share the command line parsing code. 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-8x0yr77r6lrd2t699s499m8n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index ffb627d40210..ba6777a147ca 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -48,7 +48,6 @@ struct perf_record_opts record_opts = {
48static unsigned int page_size; 48static unsigned int page_size;
49static int output; 49static int output;
50static const char *output_name = NULL; 50static const char *output_name = NULL;
51static bool group = false;
52static int realtime_prio = 0; 51static int realtime_prio = 0;
53static enum write_mode_t write_mode = WRITE_FORCE; 52static enum write_mode_t write_mode = WRITE_FORCE;
54static bool no_buildid = false; 53static bool no_buildid = false;
@@ -202,13 +201,13 @@ static void open_counters(struct perf_evlist *evlist)
202 */ 201 */
203 bool time_needed = attr->sample_type & PERF_SAMPLE_TIME; 202 bool time_needed = attr->sample_type & PERF_SAMPLE_TIME;
204 203
205 if (group && pos != first) 204 if (record_opts.group && pos != first)
206 group_fd = first->fd; 205 group_fd = first->fd;
207retry_sample_id: 206retry_sample_id:
208 attr->sample_id_all = record_opts.sample_id_all_avail ? 1 : 0; 207 attr->sample_id_all = record_opts.sample_id_all_avail ? 1 : 0;
209try_again: 208try_again:
210 if (perf_evsel__open(pos, evlist->cpus, evlist->threads, group, 209 if (perf_evsel__open(pos, evlist->cpus, evlist->threads,
211 group_fd) < 0) { 210 record_opts.group, group_fd) < 0) {
212 int err = errno; 211 int err = errno;
213 212
214 if (err == EPERM || err == EACCES) { 213 if (err == EPERM || err == EACCES) {
@@ -649,7 +648,7 @@ const struct option record_options[] = {
649 OPT_UINTEGER('F', "freq", &record_opts.user_freq, "profile at this frequency"), 648 OPT_UINTEGER('F', "freq", &record_opts.user_freq, "profile at this frequency"),
650 OPT_UINTEGER('m', "mmap-pages", &record_opts.mmap_pages, 649 OPT_UINTEGER('m', "mmap-pages", &record_opts.mmap_pages,
651 "number of mmap data pages"), 650 "number of mmap data pages"),
652 OPT_BOOLEAN(0, "group", &group, 651 OPT_BOOLEAN(0, "group", &record_opts.group,
653 "put the counters into a counter group"), 652 "put the counters into a counter group"),
654 OPT_BOOLEAN('g', "call-graph", &record_opts.call_graph, 653 OPT_BOOLEAN('g', "call-graph", &record_opts.call_graph,
655 "do call-graph (stack chain/backtrace) recording"), 654 "do call-graph (stack chain/backtrace) recording"),