Lines Matching refs:term
215 struct parse_events_term *term; in get_config_str() local
220 list_for_each_entry(term, head_terms, list) in get_config_str()
221 if (term->type_term == type_term) in get_config_str()
222 return term->val.str; in get_config_str()
347 struct parse_events_term *term,
350 struct parse_events_term *term,
709 struct parse_events_term *term; in parse_events_config_bpf() local
715 list_for_each_entry(term, head_config, list) { in parse_events_config_bpf()
718 if (term->type_term != PARSE_EVENTS__TERM_TYPE_USER) { in parse_events_config_bpf()
719 parse_events_error__handle(parse_state->error, term->err_term, in parse_events_config_bpf()
725 err = bpf__config_obj(obj, term, parse_state->evlist, &error_pos); in parse_events_config_bpf()
730 bpf__strerror_config_obj(obj, term, parse_state->evlist, in parse_events_config_bpf()
735 idx = term->err_val; in parse_events_config_bpf()
737 idx = term->err_term + error_pos; in parse_events_config_bpf()
768 struct parse_events_term *term, *temp; in split_bpf_config_terms() local
778 list_for_each_entry_safe(term, temp, evt_head_config, list) in split_bpf_config_terms()
779 if (!parse_events__is_hardcoded_term(term)) in split_bpf_config_terms()
780 list_move_tail(&term->list, obj_head_config); in split_bpf_config_terms()
922 static int check_type_val(struct parse_events_term *term, in check_type_val() argument
926 if (type == term->type_val) in check_type_val()
930 parse_events_error__handle(err, term->err_val, in check_type_val()
1009 struct parse_events_term *term, in config_term_common() argument
1014 if (check_type_val(term, err, PARSE_EVENTS__TERM_TYPE_ ## type)) \ in config_term_common()
1018 switch (term->type_term) { in config_term_common()
1021 attr->config = term->val.num; in config_term_common()
1025 attr->config1 = term->val.num; in config_term_common()
1029 attr->config2 = term->val.num; in config_term_common()
1039 if (strcmp(term->val.str, "no") && in config_term_common()
1040 parse_branch_str(term->val.str, in config_term_common()
1042 parse_events_error__handle(err, term->err_val, in config_term_common()
1050 if (term->val.num > 1) { in config_term_common()
1051 parse_events_error__handle(err, term->err_val, in config_term_common()
1089 if ((unsigned int)term->val.num > 1) { in config_term_common()
1090 parse_events_error__handle(err, term->err_val, in config_term_common()
1101 if (term->val.num > UINT_MAX) { in config_term_common()
1102 parse_events_error__handle(err, term->err_val, in config_term_common()
1109 parse_events_error__handle(err, term->err_term, in config_term_common()
1124 if (!config_term_avail(term->type_term, err)) in config_term_common()
1131 struct parse_events_term *term, in config_term_pmu() argument
1134 if (term->type_term == PARSE_EVENTS__TERM_TYPE_USER || in config_term_pmu()
1135 term->type_term == PARSE_EVENTS__TERM_TYPE_DRV_CFG) in config_term_pmu()
1142 return config_term_common(attr, term, err); in config_term_pmu()
1146 struct parse_events_term *term, in config_term_tracepoint() argument
1149 switch (term->type_term) { in config_term_tracepoint()
1160 return config_term_common(attr, term, err); in config_term_tracepoint()
1163 parse_events_error__handle(err, term->err_term, in config_term_tracepoint()
1178 struct parse_events_term *term; in config_attr() local
1180 list_for_each_entry(term, head, list) in config_attr()
1181 if (config_term(attr, term, err)) in config_attr()
1219 struct parse_events_term *term; in get_config_terms() local
1221 list_for_each_entry(term, head_config, list) { in get_config_terms()
1222 switch (term->type_term) { in get_config_terms()
1224 ADD_CONFIG_TERM_VAL(PERIOD, period, term->val.num, term->weak); in get_config_terms()
1227 ADD_CONFIG_TERM_VAL(FREQ, freq, term->val.num, term->weak); in get_config_terms()
1230 ADD_CONFIG_TERM_VAL(TIME, time, term->val.num, term->weak); in get_config_terms()
1233 ADD_CONFIG_TERM_STR(CALLGRAPH, term->val.str, term->weak); in get_config_terms()
1236 ADD_CONFIG_TERM_STR(BRANCH, term->val.str, term->weak); in get_config_terms()
1240 term->val.num, term->weak); in get_config_terms()
1244 term->val.num ? 1 : 0, term->weak); in get_config_terms()
1248 term->val.num ? 0 : 1, term->weak); in get_config_terms()
1252 term->val.num, term->weak); in get_config_terms()
1256 term->val.num, term->weak); in get_config_terms()
1260 term->val.num ? 1 : 0, term->weak); in get_config_terms()
1264 term->val.num ? 0 : 1, term->weak); in get_config_terms()
1267 ADD_CONFIG_TERM_STR(DRV_CFG, term->val.str, term->weak); in get_config_terms()
1271 term->val.num ? true : false, term->weak); in get_config_terms()
1275 term->val.num ? 1 : 0, term->weak); in get_config_terms()
1279 term->val.num, term->weak); in get_config_terms()
1295 struct parse_events_term *term; in get_config_chgs() local
1299 list_for_each_entry(term, head_config, list) { in get_config_chgs()
1300 switch (term->type_term) { in get_config_chgs()
1302 type = perf_pmu__format_type(&pmu->format, term->config); in get_config_chgs()
1305 bits |= perf_pmu__format_bits(&pmu->format, term->config); in get_config_chgs()
1391 struct evsel_config_term *term; in config_term_percore() local
1393 list_for_each_entry(term, config_terms, list) { in config_term_percore()
1394 if (term->type == EVSEL__CONFIG_TERM_PERCORE) in config_term_percore()
1395 return term->val.percore; in config_term_percore()
1405 struct parse_events_term *term; in parse_events__inside_hybrid_pmu() local
1419 term = list_first_entry(head_config, struct parse_events_term, list); in parse_events__inside_hybrid_pmu()
1420 if (term && term->config && strcmp(term->config, "event")) { in parse_events__inside_hybrid_pmu()
1421 ret = parse_events__with_hybrid_pmu(parse_state, term->config, in parse_events__inside_hybrid_pmu()
1448 struct parse_events_term *term; in parse_events_add_pmu() local
1450 list_for_each_entry(term, head_config, list) { in parse_events_add_pmu()
1451 fprintf(stderr, "%s,", term->config); in parse_events_add_pmu()
1499 struct parse_events_term *term; in parse_events_add_pmu() local
1501 list_for_each_entry(term, head_config, list) { in parse_events_add_pmu()
1502 fprintf(stderr, "%s,", term->config); in parse_events_add_pmu()
1566 struct parse_events_term *term; in parse_events_multi_pmu_add() local
1586 if (parse_events_term__num(&term, in parse_events_multi_pmu_add()
1593 list_add_tail(&term->list, head); in parse_events_multi_pmu_add()
2582 int parse_events__is_hardcoded_term(struct parse_events_term *term) in parse_events__is_hardcoded_term() argument
2584 return term->type_term != PARSE_EVENTS__TERM_TYPE_USER; in parse_events__is_hardcoded_term()
2591 struct parse_events_term *term; in new_term() local
2593 term = malloc(sizeof(*term)); in new_term()
2594 if (!term) in new_term()
2597 *term = *temp; in new_term()
2598 INIT_LIST_HEAD(&term->list); in new_term()
2599 term->weak = false; in new_term()
2601 switch (term->type_val) { in new_term()
2603 term->val.num = num; in new_term()
2606 term->val.str = str; in new_term()
2609 free(term); in new_term()
2613 *_term = term; in new_term()
2617 int parse_events_term__num(struct parse_events_term **term, in parse_events_term__num() argument
2634 return new_term(term, &temp, NULL, num); in parse_events_term__num()
2637 int parse_events_term__str(struct parse_events_term **term, in parse_events_term__str() argument
2652 return new_term(term, &temp, str, 0); in parse_events_term__str()
2655 int parse_events_term__sym_hw(struct parse_events_term **term, in parse_events_term__sym_hw() argument
2677 return new_term(term, &temp, str, 0); in parse_events_term__sym_hw()
2681 struct parse_events_term *term) in parse_events_term__clone() argument
2685 .type_val = term->type_val, in parse_events_term__clone()
2686 .type_term = term->type_term, in parse_events_term__clone()
2688 .err_term = term->err_term, in parse_events_term__clone()
2689 .err_val = term->err_val, in parse_events_term__clone()
2692 if (term->config) { in parse_events_term__clone()
2693 temp.config = strdup(term->config); in parse_events_term__clone()
2697 if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM) in parse_events_term__clone()
2698 return new_term(new, &temp, NULL, term->val.num); in parse_events_term__clone()
2700 str = strdup(term->val.str); in parse_events_term__clone()
2706 void parse_events_term__delete(struct parse_events_term *term) in parse_events_term__delete() argument
2708 if (term->array.nr_ranges) in parse_events_term__delete()
2709 zfree(&term->array.ranges); in parse_events_term__delete()
2711 if (term->type_val != PARSE_EVENTS__TERM_TYPE_NUM) in parse_events_term__delete()
2712 zfree(&term->val.str); in parse_events_term__delete()
2714 zfree(&term->config); in parse_events_term__delete()
2715 free(term); in parse_events_term__delete()
2721 struct parse_events_term *term, *n; in parse_events_copy_term_list() local
2734 list_for_each_entry (term, old, list) { in parse_events_copy_term_list()
2735 ret = parse_events_term__clone(&n, term); in parse_events_copy_term_list()
2745 struct parse_events_term *term, *h; in parse_events_terms__purge() local
2747 list_for_each_entry_safe(term, h, terms, list) { in parse_events_terms__purge()
2748 list_del_init(&term->list); in parse_events_terms__purge()
2749 parse_events_term__delete(term); in parse_events_terms__purge()