Skip to content

Commit b400679

Browse files
committed
perf tools: Rename 'perf_record_opts' to 'record_opts
Reduce typing, functions use class__method convention, so unlikely to clash with other libraries. This actually was discussed in the "Link:" referenced message below. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/20131112113427.GA4053@ghostprotocols.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 8c6f45a commit b400679

17 files changed

Lines changed: 34 additions & 37 deletions

‎tools/perf/builtin-kvm.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ struct exit_reasons_table {
8989

9090
struct perf_kvm_stat {
9191
struct perf_tool tool;
92-
struct perf_record_opts opts;
92+
struct record_opts opts;
9393
struct perf_evlist *evlist;
9494
struct perf_session *session;
9595

‎tools/perf/builtin-record.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void __handle_on_exit_funcs(void)
6464

6565
struct record {
6666
struct perf_tool tool;
67-
struct perf_record_opts opts;
67+
struct record_opts opts;
6868
u64 bytes_written;
6969
struct perf_data_file file;
7070
struct perf_evlist *evlist;
@@ -178,7 +178,7 @@ static int record__open(struct record *rec)
178178
struct perf_evsel *pos;
179179
struct perf_evlist *evlist = rec->evlist;
180180
struct perf_session *session = rec->session;
181-
struct perf_record_opts *opts = &rec->opts;
181+
struct record_opts *opts = &rec->opts;
182182
int rc = 0;
183183

184184
perf_evlist__config(evlist, opts);
@@ -348,7 +348,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
348348
const bool forks = argc > 0;
349349
struct machine *machine;
350350
struct perf_tool *tool = &rec->tool;
351-
struct perf_record_opts *opts = &rec->opts;
351+
struct record_opts *opts = &rec->opts;
352352
struct perf_evlist *evsel_list = rec->evlist;
353353
struct perf_data_file *file = &rec->file;
354354
struct perf_session *session;
@@ -657,7 +657,7 @@ static int get_stack_size(char *str, unsigned long *_size)
657657
}
658658
#endif /* HAVE_LIBUNWIND_SUPPORT */
659659

660-
int record_parse_callchain(const char *arg, struct perf_record_opts *opts)
660+
int record_parse_callchain(const char *arg, struct record_opts *opts)
661661
{
662662
char *tok, *name, *saveptr = NULL;
663663
char *buf;
@@ -713,7 +713,7 @@ int record_parse_callchain(const char *arg, struct perf_record_opts *opts)
713713
return ret;
714714
}
715715

716-
static void callchain_debug(struct perf_record_opts *opts)
716+
static void callchain_debug(struct record_opts *opts)
717717
{
718718
pr_debug("callchain: type %d\n", opts->call_graph);
719719

@@ -726,7 +726,7 @@ int record_parse_callchain_opt(const struct option *opt,
726726
const char *arg,
727727
int unset)
728728
{
729-
struct perf_record_opts *opts = opt->value;
729+
struct record_opts *opts = opt->value;
730730
int ret;
731731

732732
/* --no-call-graph */
@@ -747,7 +747,7 @@ int record_callchain_opt(const struct option *opt,
747747
const char *arg __maybe_unused,
748748
int unset __maybe_unused)
749749
{
750-
struct perf_record_opts *opts = opt->value;
750+
struct record_opts *opts = opt->value;
751751

752752
if (opts->call_graph == CALLCHAIN_NONE)
753753
opts->call_graph = CALLCHAIN_FP;
@@ -796,7 +796,7 @@ const char record_callchain_help[] = CALLCHAIN_HELP "fp";
796796
/*
797797
* XXX Will stay a global variable till we fix builtin-script.c to stop messing
798798
* with it and switch to use the library functions in perf_evlist that came
799-
* from builtin-record.c, i.e. use perf_record_opts,
799+
* from builtin-record.c, i.e. use record_opts,
800800
* perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
801801
* using pipes, etc.
802802
*/
@@ -944,7 +944,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
944944
if (perf_evlist__create_maps(evsel_list, &rec->opts.target) < 0)
945945
usage_with_options(record_usage, record_options);
946946

947-
if (perf_record_opts__config(&rec->opts)) {
947+
if (record_opts__config(&rec->opts)) {
948948
err = -EINVAL;
949949
goto out_free_fd;
950950
}

‎tools/perf/builtin-top.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static int perf_top__start_counters(struct perf_top *top)
854854
char msg[512];
855855
struct perf_evsel *counter;
856856
struct perf_evlist *evlist = top->evlist;
857-
struct perf_record_opts *opts = &top->record_opts;
857+
struct record_opts *opts = &top->record_opts;
858858

859859
perf_evlist__config(evlist, opts);
860860

@@ -906,7 +906,7 @@ static int perf_top__setup_sample_type(struct perf_top *top __maybe_unused)
906906

907907
static int __cmd_top(struct perf_top *top)
908908
{
909-
struct perf_record_opts *opts = &top->record_opts;
909+
struct record_opts *opts = &top->record_opts;
910910
pthread_t thread;
911911
int ret;
912912

@@ -1028,7 +1028,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
10281028
.max_stack = PERF_MAX_STACK_DEPTH,
10291029
.sym_pcnt_filter = 5,
10301030
};
1031-
struct perf_record_opts *opts = &top.record_opts;
1031+
struct record_opts *opts = &top.record_opts;
10321032
struct target *target = &opts->target;
10331033
const struct option options[] = {
10341034
OPT_CALLBACK('e', "event", &top.evlist, "event",
@@ -1179,7 +1179,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
11791179
if (top.delay_secs < 1)
11801180
top.delay_secs = 1;
11811181

1182-
if (perf_record_opts__config(opts)) {
1182+
if (record_opts__config(opts)) {
11831183
status = -EINVAL;
11841184
goto out_delete_maps;
11851185
}

‎tools/perf/builtin-trace.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ struct trace {
11591159
int max;
11601160
struct syscall *table;
11611161
} syscalls;
1162-
struct perf_record_opts opts;
1162+
struct record_opts opts;
11631163
struct machine *host;
11641164
u64 base_time;
11651165
bool full_time;

‎tools/perf/perf.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ enum perf_call_graph_mode {
247247
CALLCHAIN_DWARF
248248
};
249249

250-
struct perf_record_opts {
250+
struct record_opts {
251251
struct target target;
252252
int call_graph;
253253
bool group;

‎tools/perf/tests/code-reading.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ static int do_test_code_reading(bool try_kcore)
391391
struct machines machines;
392392
struct machine *machine;
393393
struct thread *thread;
394-
struct perf_record_opts opts = {
394+
struct record_opts opts = {
395395
.mmap_pages = UINT_MAX,
396396
.user_freq = UINT_MAX,
397397
.user_interval = ULLONG_MAX,

‎tools/perf/tests/keep-tracking.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int find_comm(struct perf_evlist *evlist, const char *comm)
5151
*/
5252
int test__keep_tracking(void)
5353
{
54-
struct perf_record_opts opts = {
54+
struct record_opts opts = {
5555
.mmap_pages = UINT_MAX,
5656
.user_freq = UINT_MAX,
5757
.user_interval = ULLONG_MAX,

‎tools/perf/tests/open-syscall-tp-fields.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
int test__syscall_open_tp_fields(void)
88
{
9-
struct perf_record_opts opts = {
9+
struct record_opts opts = {
1010
.target = {
1111
.uid = UINT_MAX,
1212
.uses_mmap = true,

‎tools/perf/tests/perf-record.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
3434

3535
int test__PERF_RECORD(void)
3636
{
37-
struct perf_record_opts opts = {
37+
struct record_opts opts = {
3838
.target = {
3939
.uid = UINT_MAX,
4040
.uses_mmap = true,

‎tools/perf/tests/perf-time-to-tsc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static u64 rdtsc(void)
4646
*/
4747
int test__perf_time_to_tsc(void)
4848
{
49-
struct perf_record_opts opts = {
49+
struct record_opts opts = {
5050
.mmap_pages = UINT_MAX,
5151
.user_freq = UINT_MAX,
5252
.user_interval = ULLONG_MAX,

0 commit comments

Comments
 (0)