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

Configure Feed

Select the types of activity you want to include in your feed.

perf evsel: Constify option arguments to config functions

The options are used to configure the evsel but are not themselves
configured. Make the arguments const to better capture this.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
443556be 8ebb69e5

+14 -14
+10 -10
tools/perf/util/evsel.c
··· 1015 1015 return perf_session__e_machine(session, e_flags); 1016 1016 } 1017 1017 1018 - static void __evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, 1019 - struct callchain_param *param) 1018 + static void __evsel__config_callchain(struct evsel *evsel, const struct record_opts *opts, 1019 + const struct callchain_param *param) 1020 1020 { 1021 1021 bool function = evsel__is_function_event(evsel); 1022 1022 struct perf_event_attr *attr = &evsel->core.attr; ··· 1080 1080 attr->defer_callchain = 1; 1081 1081 } 1082 1082 1083 - void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, 1084 - struct callchain_param *param) 1083 + void evsel__config_callchain(struct evsel *evsel, const struct record_opts *opts, 1084 + const struct callchain_param *param) 1085 1085 { 1086 1086 if (param->enabled) 1087 1087 return __evsel__config_callchain(evsel, opts, param); 1088 1088 } 1089 1089 1090 - static void evsel__reset_callgraph(struct evsel *evsel, struct callchain_param *param) 1090 + static void evsel__reset_callgraph(struct evsel *evsel, const struct callchain_param *param) 1091 1091 { 1092 1092 struct perf_event_attr *attr = &evsel->core.attr; 1093 1093 ··· 1106 1106 1107 1107 static void evsel__apply_ratio_to_prev(struct evsel *evsel, 1108 1108 struct perf_event_attr *attr, 1109 - struct record_opts *opts, 1109 + const struct record_opts *opts, 1110 1110 const char *buf) 1111 1111 { 1112 1112 struct perf_event_attr *prev_attr = NULL; ··· 1170 1170 } 1171 1171 1172 1172 static void evsel__apply_config_terms(struct evsel *evsel, 1173 - struct record_opts *opts, bool track) 1173 + const struct record_opts *opts, bool track) 1174 1174 { 1175 1175 struct evsel_config_term *term; 1176 1176 struct list_head *config_terms = &evsel->config_terms; ··· 1445 1445 { 1446 1446 } 1447 1447 1448 - static void evsel__set_default_freq_period(struct record_opts *opts, 1448 + static void evsel__set_default_freq_period(const struct record_opts *opts, 1449 1449 struct perf_event_attr *attr) 1450 1450 { 1451 1451 if (opts->freq) { ··· 1490 1490 * enable/disable events specifically, as there's no 1491 1491 * initial traced exec call. 1492 1492 */ 1493 - void evsel__config(struct evsel *evsel, struct record_opts *opts, 1494 - struct callchain_param *callchain) 1493 + void evsel__config(struct evsel *evsel, const struct record_opts *opts, 1494 + const struct callchain_param *callchain) 1495 1495 { 1496 1496 struct evsel *leader = evsel__leader(evsel); 1497 1497 struct perf_event_attr *attr = &evsel->core.attr;
+4 -4
tools/perf/util/evsel.h
··· 287 287 288 288 struct callchain_param; 289 289 290 - void evsel__config(struct evsel *evsel, struct record_opts *opts, 291 - struct callchain_param *callchain); 292 - void evsel__config_callchain(struct evsel *evsel, struct record_opts *opts, 293 - struct callchain_param *callchain); 290 + void evsel__config(struct evsel *evsel, const struct record_opts *opts, 291 + const struct callchain_param *callchain); 292 + void evsel__config_callchain(struct evsel *evsel, const struct record_opts *opts, 293 + const struct callchain_param *callchain); 294 294 295 295 int __evsel__sample_size(u64 sample_type); 296 296 void evsel__calc_id_pos(struct evsel *evsel);