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

perf evsel: Rename *perf_evsel__get_config_term() & friends to evsel__env()

As it is a 'struct evsel' method, not part of tools/lib/perf/, aka
libperf, to whom the perf_ prefix belongs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+59 -62
+2 -2
tools/perf/arch/arm/util/cs-etm.c
··· 216 216 struct evsel *evsel) 217 217 { 218 218 char msg[BUFSIZ], path[PATH_MAX], *sink; 219 - struct perf_evsel_config_term *term; 219 + struct evsel_config_term *term; 220 220 int ret = -EINVAL; 221 221 u32 hash; 222 222 ··· 224 224 return 0; 225 225 226 226 list_for_each_entry(term, &evsel->config_terms, list) { 227 - if (term->type != PERF_EVSEL__CONFIG_TERM_DRV_CFG) 227 + if (term->type != EVSEL__CONFIG_TERM_DRV_CFG) 228 228 continue; 229 229 230 230 sink = term->val.str;
+1 -2
tools/perf/arch/x86/util/intel-pt.c
··· 556 556 static void intel_pt_config_sample_mode(struct perf_pmu *intel_pt_pmu, 557 557 struct evsel *evsel) 558 558 { 559 - struct perf_evsel_config_term *term; 560 559 u64 user_bits = 0, bits; 560 + struct evsel_config_term *term = evsel__get_config_term(evsel, CFG_CHG); 561 561 562 - term = perf_evsel__get_config_term(evsel, CFG_CHG); 563 562 if (term) 564 563 user_bits = term->val.cfg_chg; 565 564
+2 -2
tools/perf/builtin-top.c
··· 949 949 { 950 950 struct record_opts *opts = &top->record_opts; 951 951 struct evlist *evlist = top->evlist; 952 - struct perf_evsel_config_term *term; 952 + struct evsel_config_term *term; 953 953 struct list_head *config_terms; 954 954 struct evsel *evsel; 955 955 int set, overwrite = -1; ··· 958 958 set = -1; 959 959 config_terms = &evsel->config_terms; 960 960 list_for_each_entry(term, config_terms, list) { 961 - if (term->type == PERF_EVSEL__CONFIG_TERM_OVERWRITE) 961 + if (term->type == EVSEL__CONFIG_TERM_OVERWRITE) 962 962 set = term->val.overwrite ? 1 : 0; 963 963 } 964 964
+2 -2
tools/perf/util/auxtrace.c
··· 729 729 struct evlist *evlist, 730 730 struct record_opts *opts, const char *str) 731 731 { 732 - struct perf_evsel_config_term *term; 732 + struct evsel_config_term *term; 733 733 struct evsel *aux_evsel; 734 734 bool has_aux_sample_size = false; 735 735 bool has_aux_leader = false; ··· 771 771 evlist__for_each_entry(evlist, evsel) { 772 772 if (evsel__is_aux_event(evsel)) 773 773 aux_evsel = evsel; 774 - term = perf_evsel__get_config_term(evsel, AUX_SAMPLE_SIZE); 774 + term = evsel__get_config_term(evsel, AUX_SAMPLE_SIZE); 775 775 if (term) { 776 776 has_aux_sample_size = true; 777 777 evsel->core.attr.aux_sample_size = term->val.aux_sample_size;
+24 -25
tools/perf/util/evsel.c
··· 767 767 } 768 768 } 769 769 770 - static void apply_config_terms(struct evsel *evsel, 771 - struct record_opts *opts, bool track) 770 + static void evsel__apply_config_terms(struct evsel *evsel, 771 + struct record_opts *opts, bool track) 772 772 { 773 - struct perf_evsel_config_term *term; 773 + struct evsel_config_term *term; 774 774 struct list_head *config_terms = &evsel->config_terms; 775 775 struct perf_event_attr *attr = &evsel->core.attr; 776 776 /* callgraph default */ ··· 783 783 784 784 list_for_each_entry(term, config_terms, list) { 785 785 switch (term->type) { 786 - case PERF_EVSEL__CONFIG_TERM_PERIOD: 786 + case EVSEL__CONFIG_TERM_PERIOD: 787 787 if (!(term->weak && opts->user_interval != ULLONG_MAX)) { 788 788 attr->sample_period = term->val.period; 789 789 attr->freq = 0; 790 790 evsel__reset_sample_bit(evsel, PERIOD); 791 791 } 792 792 break; 793 - case PERF_EVSEL__CONFIG_TERM_FREQ: 793 + case EVSEL__CONFIG_TERM_FREQ: 794 794 if (!(term->weak && opts->user_freq != UINT_MAX)) { 795 795 attr->sample_freq = term->val.freq; 796 796 attr->freq = 1; 797 797 evsel__set_sample_bit(evsel, PERIOD); 798 798 } 799 799 break; 800 - case PERF_EVSEL__CONFIG_TERM_TIME: 800 + case EVSEL__CONFIG_TERM_TIME: 801 801 if (term->val.time) 802 802 evsel__set_sample_bit(evsel, TIME); 803 803 else 804 804 evsel__reset_sample_bit(evsel, TIME); 805 805 break; 806 - case PERF_EVSEL__CONFIG_TERM_CALLGRAPH: 806 + case EVSEL__CONFIG_TERM_CALLGRAPH: 807 807 callgraph_buf = term->val.str; 808 808 break; 809 - case PERF_EVSEL__CONFIG_TERM_BRANCH: 809 + case EVSEL__CONFIG_TERM_BRANCH: 810 810 if (term->val.str && strcmp(term->val.str, "no")) { 811 811 evsel__set_sample_bit(evsel, BRANCH_STACK); 812 812 parse_branch_str(term->val.str, ··· 814 814 } else 815 815 evsel__reset_sample_bit(evsel, BRANCH_STACK); 816 816 break; 817 - case PERF_EVSEL__CONFIG_TERM_STACK_USER: 817 + case EVSEL__CONFIG_TERM_STACK_USER: 818 818 dump_size = term->val.stack_user; 819 819 break; 820 - case PERF_EVSEL__CONFIG_TERM_MAX_STACK: 820 + case EVSEL__CONFIG_TERM_MAX_STACK: 821 821 max_stack = term->val.max_stack; 822 822 break; 823 - case PERF_EVSEL__CONFIG_TERM_MAX_EVENTS: 823 + case EVSEL__CONFIG_TERM_MAX_EVENTS: 824 824 evsel->max_events = term->val.max_events; 825 825 break; 826 - case PERF_EVSEL__CONFIG_TERM_INHERIT: 826 + case EVSEL__CONFIG_TERM_INHERIT: 827 827 /* 828 828 * attr->inherit should has already been set by 829 829 * evsel__config. If user explicitly set ··· 832 832 */ 833 833 attr->inherit = term->val.inherit ? 1 : 0; 834 834 break; 835 - case PERF_EVSEL__CONFIG_TERM_OVERWRITE: 835 + case EVSEL__CONFIG_TERM_OVERWRITE: 836 836 attr->write_backward = term->val.overwrite ? 1 : 0; 837 837 break; 838 - case PERF_EVSEL__CONFIG_TERM_DRV_CFG: 838 + case EVSEL__CONFIG_TERM_DRV_CFG: 839 839 break; 840 - case PERF_EVSEL__CONFIG_TERM_PERCORE: 840 + case EVSEL__CONFIG_TERM_PERCORE: 841 841 break; 842 - case PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT: 842 + case EVSEL__CONFIG_TERM_AUX_OUTPUT: 843 843 attr->aux_output = term->val.aux_output ? 1 : 0; 844 844 break; 845 - case PERF_EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE: 845 + case EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE: 846 846 /* Already applied by auxtrace */ 847 847 break; 848 - case PERF_EVSEL__CONFIG_TERM_CFG_CHG: 848 + case EVSEL__CONFIG_TERM_CFG_CHG: 849 849 break; 850 850 default: 851 851 break; ··· 906 906 (evsel->core.attr.config == PERF_COUNT_SW_DUMMY); 907 907 } 908 908 909 - struct perf_evsel_config_term *__perf_evsel__get_config_term(struct evsel *evsel, 910 - enum evsel_term_type type) 909 + struct evsel_config_term *__evsel__get_config_term(struct evsel *evsel, enum evsel_term_type type) 911 910 { 912 - struct perf_evsel_config_term *term, *found_term = NULL; 911 + struct evsel_config_term *term, *found_term = NULL; 913 912 914 913 list_for_each_entry(term, &evsel->config_terms, list) { 915 914 if (term->type == type) ··· 1143 1144 * Apply event specific term settings, 1144 1145 * it overloads any global configuration. 1145 1146 */ 1146 - apply_config_terms(evsel, opts, track); 1147 + evsel__apply_config_terms(evsel, opts, track); 1147 1148 1148 1149 evsel->ignore_missing_thread = opts->ignore_missing_thread; 1149 1150 ··· 1239 1240 return err; 1240 1241 } 1241 1242 1242 - static void perf_evsel__free_config_terms(struct evsel *evsel) 1243 + static void evsel__free_config_terms(struct evsel *evsel) 1243 1244 { 1244 - struct perf_evsel_config_term *term, *h; 1245 + struct evsel_config_term *term, *h; 1245 1246 1246 1247 list_for_each_entry_safe(term, h, &evsel->config_terms, list) { 1247 1248 list_del_init(&term->list); ··· 1258 1259 perf_evsel__free_counts(evsel); 1259 1260 perf_evsel__free_fd(&evsel->core); 1260 1261 perf_evsel__free_id(&evsel->core); 1261 - perf_evsel__free_config_terms(evsel); 1262 + evsel__free_config_terms(evsel); 1262 1263 cgroup__put(evsel->cgrp); 1263 1264 perf_cpu_map__put(evsel->core.cpus); 1264 1265 perf_cpu_map__put(evsel->core.own_cpus);
+21 -22
tools/perf/util/evsel_config.h
··· 6 6 #include <stdbool.h> 7 7 8 8 /* 9 - * The 'struct perf_evsel_config_term' is used to pass event 9 + * The 'struct evsel_config_term' is used to pass event 10 10 * specific configuration data to evsel__config routine. 11 11 * It is allocated within event parsing and attached to 12 - * perf_evsel::config_terms list head. 12 + * evsel::config_terms list head. 13 13 */ 14 14 enum evsel_term_type { 15 - PERF_EVSEL__CONFIG_TERM_PERIOD, 16 - PERF_EVSEL__CONFIG_TERM_FREQ, 17 - PERF_EVSEL__CONFIG_TERM_TIME, 18 - PERF_EVSEL__CONFIG_TERM_CALLGRAPH, 19 - PERF_EVSEL__CONFIG_TERM_STACK_USER, 20 - PERF_EVSEL__CONFIG_TERM_INHERIT, 21 - PERF_EVSEL__CONFIG_TERM_MAX_STACK, 22 - PERF_EVSEL__CONFIG_TERM_MAX_EVENTS, 23 - PERF_EVSEL__CONFIG_TERM_OVERWRITE, 24 - PERF_EVSEL__CONFIG_TERM_DRV_CFG, 25 - PERF_EVSEL__CONFIG_TERM_BRANCH, 26 - PERF_EVSEL__CONFIG_TERM_PERCORE, 27 - PERF_EVSEL__CONFIG_TERM_AUX_OUTPUT, 28 - PERF_EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE, 29 - PERF_EVSEL__CONFIG_TERM_CFG_CHG, 15 + EVSEL__CONFIG_TERM_PERIOD, 16 + EVSEL__CONFIG_TERM_FREQ, 17 + EVSEL__CONFIG_TERM_TIME, 18 + EVSEL__CONFIG_TERM_CALLGRAPH, 19 + EVSEL__CONFIG_TERM_STACK_USER, 20 + EVSEL__CONFIG_TERM_INHERIT, 21 + EVSEL__CONFIG_TERM_MAX_STACK, 22 + EVSEL__CONFIG_TERM_MAX_EVENTS, 23 + EVSEL__CONFIG_TERM_OVERWRITE, 24 + EVSEL__CONFIG_TERM_DRV_CFG, 25 + EVSEL__CONFIG_TERM_BRANCH, 26 + EVSEL__CONFIG_TERM_PERCORE, 27 + EVSEL__CONFIG_TERM_AUX_OUTPUT, 28 + EVSEL__CONFIG_TERM_AUX_SAMPLE_SIZE, 29 + EVSEL__CONFIG_TERM_CFG_CHG, 30 30 }; 31 31 32 - struct perf_evsel_config_term { 32 + struct evsel_config_term { 33 33 struct list_head list; 34 34 enum evsel_term_type type; 35 35 bool free_str; ··· 53 53 54 54 struct evsel; 55 55 56 - struct perf_evsel_config_term *__perf_evsel__get_config_term(struct evsel *evsel, 57 - enum evsel_term_type type); 56 + struct evsel_config_term *__evsel__get_config_term(struct evsel *evsel, enum evsel_term_type type); 58 57 59 - #define perf_evsel__get_config_term(evsel, type) \ 60 - __perf_evsel__get_config_term(evsel, PERF_EVSEL__CONFIG_TERM_ ## type) 58 + #define evsel__get_config_term(evsel, type) \ 59 + __evsel__get_config_term(evsel, EVSEL__CONFIG_TERM_ ## type) 61 60 62 61 #endif // __PERF_EVSEL_CONFIG_H
+6 -6
tools/perf/util/parse-events.c
··· 1214 1214 struct list_head *head_terms __maybe_unused) 1215 1215 { 1216 1216 #define ADD_CONFIG_TERM(__type, __weak) \ 1217 - struct perf_evsel_config_term *__t; \ 1217 + struct evsel_config_term *__t; \ 1218 1218 \ 1219 1219 __t = zalloc(sizeof(*__t)); \ 1220 1220 if (!__t) \ 1221 1221 return -ENOMEM; \ 1222 1222 \ 1223 1223 INIT_LIST_HEAD(&__t->list); \ 1224 - __t->type = PERF_EVSEL__CONFIG_TERM_ ## __type; \ 1224 + __t->type = EVSEL__CONFIG_TERM_ ## __type; \ 1225 1225 __t->weak = __weak; \ 1226 1226 list_add_tail(&__t->list, head_terms) 1227 1227 ··· 1312 1312 } 1313 1313 1314 1314 /* 1315 - * Add PERF_EVSEL__CONFIG_TERM_CFG_CHG where cfg_chg will have a bit set for 1315 + * Add EVSEL__CONFIG_TERM_CFG_CHG where cfg_chg will have a bit set for 1316 1316 * each bit of attr->config that the user has changed. 1317 1317 */ 1318 1318 static int get_config_chgs(struct perf_pmu *pmu, struct list_head *head_config, ··· 1400 1400 1401 1401 static bool config_term_percore(struct list_head *config_terms) 1402 1402 { 1403 - struct perf_evsel_config_term *term; 1403 + struct evsel_config_term *term; 1404 1404 1405 1405 list_for_each_entry(term, config_terms, list) { 1406 - if (term->type == PERF_EVSEL__CONFIG_TERM_PERCORE) 1406 + if (term->type == EVSEL__CONFIG_TERM_PERCORE) 1407 1407 return term->val.percore; 1408 1408 } 1409 1409 ··· 1478 1478 return -ENOMEM; 1479 1479 1480 1480 if (perf_pmu__config(pmu, &attr, head_config, parse_state->error)) { 1481 - struct perf_evsel_config_term *pos, *tmp; 1481 + struct evsel_config_term *pos, *tmp; 1482 1482 1483 1483 list_for_each_entry_safe(pos, tmp, &config_terms, list) { 1484 1484 list_del_init(&pos->list);
+1 -1
tools/perf/util/pmu.h
··· 9 9 #include "parse-events.h" 10 10 #include "pmu-events/pmu-events.h" 11 11 12 - struct perf_evsel_config_term; 12 + struct evsel_config_term; 13 13 14 14 enum { 15 15 PERF_PMU_FORMAT_VALUE_CONFIG,