Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+34 -37
+1 -1
tools/perf/builtin-kvm.c
··· 89 89 90 90 struct perf_kvm_stat { 91 91 struct perf_tool tool; 92 - struct perf_record_opts opts; 92 + struct record_opts opts; 93 93 struct perf_evlist *evlist; 94 94 struct perf_session *session; 95 95
+9 -9
tools/perf/builtin-record.c
··· 64 64 65 65 struct record { 66 66 struct perf_tool tool; 67 - struct perf_record_opts opts; 67 + struct record_opts opts; 68 68 u64 bytes_written; 69 69 struct perf_data_file file; 70 70 struct perf_evlist *evlist; ··· 178 178 struct perf_evsel *pos; 179 179 struct perf_evlist *evlist = rec->evlist; 180 180 struct perf_session *session = rec->session; 181 - struct perf_record_opts *opts = &rec->opts; 181 + struct record_opts *opts = &rec->opts; 182 182 int rc = 0; 183 183 184 184 perf_evlist__config(evlist, opts); ··· 348 348 const bool forks = argc > 0; 349 349 struct machine *machine; 350 350 struct perf_tool *tool = &rec->tool; 351 - struct perf_record_opts *opts = &rec->opts; 351 + struct record_opts *opts = &rec->opts; 352 352 struct perf_evlist *evsel_list = rec->evlist; 353 353 struct perf_data_file *file = &rec->file; 354 354 struct perf_session *session; ··· 657 657 } 658 658 #endif /* HAVE_LIBUNWIND_SUPPORT */ 659 659 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) 661 661 { 662 662 char *tok, *name, *saveptr = NULL; 663 663 char *buf; ··· 713 713 return ret; 714 714 } 715 715 716 - static void callchain_debug(struct perf_record_opts *opts) 716 + static void callchain_debug(struct record_opts *opts) 717 717 { 718 718 pr_debug("callchain: type %d\n", opts->call_graph); 719 719 ··· 726 726 const char *arg, 727 727 int unset) 728 728 { 729 - struct perf_record_opts *opts = opt->value; 729 + struct record_opts *opts = opt->value; 730 730 int ret; 731 731 732 732 /* --no-call-graph */ ··· 747 747 const char *arg __maybe_unused, 748 748 int unset __maybe_unused) 749 749 { 750 - struct perf_record_opts *opts = opt->value; 750 + struct record_opts *opts = opt->value; 751 751 752 752 if (opts->call_graph == CALLCHAIN_NONE) 753 753 opts->call_graph = CALLCHAIN_FP; ··· 796 796 /* 797 797 * XXX Will stay a global variable till we fix builtin-script.c to stop messing 798 798 * 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, 800 800 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record', 801 801 * using pipes, etc. 802 802 */ ··· 944 944 if (perf_evlist__create_maps(evsel_list, &rec->opts.target) < 0) 945 945 usage_with_options(record_usage, record_options); 946 946 947 - if (perf_record_opts__config(&rec->opts)) { 947 + if (record_opts__config(&rec->opts)) { 948 948 err = -EINVAL; 949 949 goto out_free_fd; 950 950 }
+4 -4
tools/perf/builtin-top.c
··· 854 854 char msg[512]; 855 855 struct perf_evsel *counter; 856 856 struct perf_evlist *evlist = top->evlist; 857 - struct perf_record_opts *opts = &top->record_opts; 857 + struct record_opts *opts = &top->record_opts; 858 858 859 859 perf_evlist__config(evlist, opts); 860 860 ··· 906 906 907 907 static int __cmd_top(struct perf_top *top) 908 908 { 909 - struct perf_record_opts *opts = &top->record_opts; 909 + struct record_opts *opts = &top->record_opts; 910 910 pthread_t thread; 911 911 int ret; 912 912 ··· 1028 1028 .max_stack = PERF_MAX_STACK_DEPTH, 1029 1029 .sym_pcnt_filter = 5, 1030 1030 }; 1031 - struct perf_record_opts *opts = &top.record_opts; 1031 + struct record_opts *opts = &top.record_opts; 1032 1032 struct target *target = &opts->target; 1033 1033 const struct option options[] = { 1034 1034 OPT_CALLBACK('e', "event", &top.evlist, "event", ··· 1179 1179 if (top.delay_secs < 1) 1180 1180 top.delay_secs = 1; 1181 1181 1182 - if (perf_record_opts__config(opts)) { 1182 + if (record_opts__config(opts)) { 1183 1183 status = -EINVAL; 1184 1184 goto out_delete_maps; 1185 1185 }
+1 -1
tools/perf/builtin-trace.c
··· 1159 1159 int max; 1160 1160 struct syscall *table; 1161 1161 } syscalls; 1162 - struct perf_record_opts opts; 1162 + struct record_opts opts; 1163 1163 struct machine *host; 1164 1164 u64 base_time; 1165 1165 bool full_time;
+1 -1
tools/perf/perf.h
··· 247 247 CALLCHAIN_DWARF 248 248 }; 249 249 250 - struct perf_record_opts { 250 + struct record_opts { 251 251 struct target target; 252 252 int call_graph; 253 253 bool group;
+1 -1
tools/perf/tests/code-reading.c
··· 391 391 struct machines machines; 392 392 struct machine *machine; 393 393 struct thread *thread; 394 - struct perf_record_opts opts = { 394 + struct record_opts opts = { 395 395 .mmap_pages = UINT_MAX, 396 396 .user_freq = UINT_MAX, 397 397 .user_interval = ULLONG_MAX,
+1 -1
tools/perf/tests/keep-tracking.c
··· 51 51 */ 52 52 int test__keep_tracking(void) 53 53 { 54 - struct perf_record_opts opts = { 54 + struct record_opts opts = { 55 55 .mmap_pages = UINT_MAX, 56 56 .user_freq = UINT_MAX, 57 57 .user_interval = ULLONG_MAX,
+1 -1
tools/perf/tests/open-syscall-tp-fields.c
··· 6 6 7 7 int test__syscall_open_tp_fields(void) 8 8 { 9 - struct perf_record_opts opts = { 9 + struct record_opts opts = { 10 10 .target = { 11 11 .uid = UINT_MAX, 12 12 .uses_mmap = true,
+1 -1
tools/perf/tests/perf-record.c
··· 34 34 35 35 int test__PERF_RECORD(void) 36 36 { 37 - struct perf_record_opts opts = { 37 + struct record_opts opts = { 38 38 .target = { 39 39 .uid = UINT_MAX, 40 40 .uses_mmap = true,
+1 -1
tools/perf/tests/perf-time-to-tsc.c
··· 46 46 */ 47 47 int test__perf_time_to_tsc(void) 48 48 { 49 - struct perf_record_opts opts = { 49 + struct record_opts opts = { 50 50 .mmap_pages = UINT_MAX, 51 51 .user_freq = UINT_MAX, 52 52 .user_interval = ULLONG_MAX,
+1 -1
tools/perf/util/callchain.h
··· 146 146 147 147 struct option; 148 148 149 - int record_parse_callchain(const char *arg, struct perf_record_opts *opts); 149 + int record_parse_callchain(const char *arg, struct record_opts *opts); 150 150 int record_parse_callchain_opt(const struct option *opt, const char *arg, int unset); 151 151 int record_callchain_opt(const struct option *opt, const char *arg, int unset); 152 152
+3 -4
tools/perf/util/evlist.h
··· 12 12 struct pollfd; 13 13 struct thread_map; 14 14 struct cpu_map; 15 - struct perf_record_opts; 15 + struct record_opts; 16 16 17 17 #define PERF_EVLIST__HLIST_BITS 8 18 18 #define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS) ··· 97 97 98 98 void perf_evlist__set_id_pos(struct perf_evlist *evlist); 99 99 bool perf_can_sample_identifier(void); 100 - void perf_evlist__config(struct perf_evlist *evlist, 101 - struct perf_record_opts *opts); 102 - int perf_record_opts__config(struct perf_record_opts *opts); 100 + void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts); 101 + int record_opts__config(struct record_opts *opts); 103 102 104 103 int perf_evlist__prepare_workload(struct perf_evlist *evlist, 105 104 struct target *target,
+1 -2
tools/perf/util/evsel.c
··· 528 528 * enable/disable events specifically, as there's no 529 529 * initial traced exec call. 530 530 */ 531 - void perf_evsel__config(struct perf_evsel *evsel, 532 - struct perf_record_opts *opts) 531 + void perf_evsel__config(struct perf_evsel *evsel, struct record_opts *opts) 533 532 { 534 533 struct perf_evsel *leader = evsel->leader; 535 534 struct perf_event_attr *attr = &evsel->attr;
+2 -2
tools/perf/util/evsel.h
··· 96 96 struct cpu_map; 97 97 struct thread_map; 98 98 struct perf_evlist; 99 - struct perf_record_opts; 99 + struct record_opts; 100 100 101 101 struct perf_evsel *perf_evsel__new_idx(struct perf_event_attr *attr, int idx); 102 102 ··· 120 120 void perf_evsel__delete(struct perf_evsel *evsel); 121 121 122 122 void perf_evsel__config(struct perf_evsel *evsel, 123 - struct perf_record_opts *opts); 123 + struct record_opts *opts); 124 124 125 125 int __perf_evsel__sample_size(u64 sample_type); 126 126 void perf_evsel__calc_id_pos(struct perf_evsel *evsel);
+4 -5
tools/perf/util/record.c
··· 74 74 return perf_probe_api(perf_probe_sample_identifier); 75 75 } 76 76 77 - void perf_evlist__config(struct perf_evlist *evlist, 78 - struct perf_record_opts *opts) 77 + void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts) 79 78 { 80 79 struct perf_evsel *evsel; 81 80 bool use_sample_identifier = false; ··· 122 123 return filename__read_int(path, (int *) rate); 123 124 } 124 125 125 - static int perf_record_opts__config_freq(struct perf_record_opts *opts) 126 + static int record_opts__config_freq(struct record_opts *opts) 126 127 { 127 128 bool user_freq = opts->user_freq != UINT_MAX; 128 129 unsigned int max_rate; ··· 172 173 return 0; 173 174 } 174 175 175 - int perf_record_opts__config(struct perf_record_opts *opts) 176 + int record_opts__config(struct record_opts *opts) 176 177 { 177 - return perf_record_opts__config_freq(opts); 178 + return record_opts__config_freq(opts); 178 179 } 179 180 180 181 bool perf_evlist__can_select_event(struct perf_evlist *evlist, const char *str)
+1 -1
tools/perf/util/top.c
··· 26 26 float samples_per_sec; 27 27 float ksamples_per_sec; 28 28 float esamples_percent; 29 - struct perf_record_opts *opts = &top->record_opts; 29 + struct record_opts *opts = &top->record_opts; 30 30 struct target *target = &opts->target; 31 31 size_t ret = 0; 32 32
+1 -1
tools/perf/util/top.h
··· 14 14 struct perf_top { 15 15 struct perf_tool tool; 16 16 struct perf_evlist *evlist; 17 - struct perf_record_opts record_opts; 17 + struct record_opts record_opts; 18 18 /* 19 19 * Symbols will be added here in perf_event__process_sample and will 20 20 * get out after decayed.