Lines Matching refs:token
1247 static int test_type_token(enum tep_event_type type, const char *token, in test_type_token() argument
1256 if (strcmp(token, expect_tok) != 0) { in test_type_token()
1258 expect_tok, token); in test_type_token()
1284 char *token; in __read_expected() local
1288 type = read_token(&token); in __read_expected()
1290 type = read_token_item(&token); in __read_expected()
1292 ret = test_type_token(type, token, expect, str); in __read_expected()
1294 free_token(token); in __read_expected()
1311 char *token; in event_read_name() local
1319 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in event_read_name()
1322 return token; in event_read_name()
1325 free_token(token); in event_read_name()
1331 char *token; in event_read_id() local
1340 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in event_read_id()
1343 id = strtoul(token, NULL, 0); in event_read_id()
1344 free_token(token); in event_read_id()
1348 free_token(token); in event_read_id()
1432 char *token; in event_read_fields() local
1441 type = read_token(&token); in event_read_fields()
1443 free_token(token); in event_read_fields()
1449 if (test_type_token(type, token, TEP_EVENT_ITEM, "field")) in event_read_fields()
1451 free_token(token); in event_read_fields()
1453 type = read_token(&token); in event_read_fields()
1459 type == TEP_EVENT_ITEM && strcmp(token, "special") == 0) { in event_read_fields()
1460 free_token(token); in event_read_fields()
1461 type = read_token(&token); in event_read_fields()
1464 if (test_type_token(type, token, TEP_EVENT_OP, ":") < 0) in event_read_fields()
1467 free_token(token); in event_read_fields()
1468 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in event_read_fields()
1471 last_token = token; in event_read_fields()
1481 type = read_token(&token); in event_read_fields()
1483 (type == TEP_EVENT_OP && strcmp(token, "*") == 0) || in event_read_fields()
1489 type == TEP_EVENT_OP && strcmp(token, ".") == 0)) { in event_read_fields()
1491 if (strcmp(token, "*") == 0) in event_read_fields()
1501 last_token = token; in event_read_fields()
1509 token[0] == '(') { in event_read_fields()
1519 while ((type = read_token(&token)) != TEP_EVENT_NONE) { in event_read_fields()
1521 if (token[0] == '(') in event_read_fields()
1523 else if (token[0] == ')') in event_read_fields()
1527 ret = append(&field->type, "", token); in event_read_fields()
1530 ret = append(&field->type, delim, token); in event_read_fields()
1536 last_token = token; in event_read_fields()
1552 if (strcmp(token, "[") == 0) { in event_read_fields()
1554 char *brackets = token; in event_read_fields()
1558 type = read_token(&token); in event_read_fields()
1561 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1565 while (strcmp(token, "]") != 0) { in event_read_fields()
1576 ret = append(&brackets, delim, token); in event_read_fields()
1582 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1583 free_token(token); in event_read_fields()
1584 type = read_token(&token); in event_read_fields()
1592 free_token(token); in event_read_fields()
1602 type = read_token(&token); in event_read_fields()
1617 field->name = field->alias = token; in event_read_fields()
1618 type = read_token(&token); in event_read_fields()
1638 if (test_type_token(type, token, TEP_EVENT_OP, ";")) in event_read_fields()
1640 free_token(token); in event_read_fields()
1648 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1650 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1651 free_token(token); in event_read_fields()
1662 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1664 field->size = strtoul(token, NULL, 0); in event_read_fields()
1665 free_token(token); in event_read_fields()
1670 type = read_token(&token); in event_read_fields()
1673 if (test_type_token(type, token, TEP_EVENT_ITEM, "signed")) in event_read_fields()
1676 free_token(token); in event_read_fields()
1681 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1684 if (strtoul(token, NULL, 0)) in event_read_fields()
1687 free_token(token); in event_read_fields()
1691 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in event_read_fields()
1695 free_token(token); in event_read_fields()
1719 free_token(token); in event_read_fields()
1731 char *token; in event_read_format() local
1740 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in event_read_format()
1742 free_token(token); in event_read_format()
1757 free_token(token); in event_read_format()
1769 char *token; in process_arg() local
1771 type = read_token(&token); in process_arg()
1772 *tok = token; in process_arg()
1803 char *token = NULL; in process_cond() local
1822 type = process_arg(event, left, &token); in process_cond()
1829 if (type == TEP_EVENT_OP && strcmp(token, ":") != 0) { in process_cond()
1830 type = process_op(event, left, &token); in process_cond()
1834 if (test_type_token(type, token, TEP_EVENT_OP, ":")) in process_cond()
1837 arg->op.op = token; in process_cond()
1839 type = process_arg(event, right, &token); in process_cond()
1843 *tok = token; in process_cond()
1849 free_token(token); in process_cond()
1859 char *token = NULL; in process_array() local
1870 type = process_arg(event, arg, &token); in process_array()
1871 if (test_type_token(type, token, TEP_EVENT_OP, "]")) in process_array()
1876 free_token(token); in process_array()
1877 type = read_token_item(&token); in process_array()
1878 *tok = token; in process_array()
1883 free_token(token); in process_array()
1961 char *token; in process_op() local
1964 token = *tok; in process_op()
1968 if (token[1]) { in process_op()
1969 do_warning_event(event, "bad op token %s", token); in process_op()
1972 switch (token[0]) { in process_op()
1979 do_warning_event(event, "bad op token %s", token); in process_op()
2002 } else if (strcmp(token, "?") == 0) { in process_op()
2012 arg->op.op = token; in process_op()
2019 } else if (strcmp(token, ">>") == 0 || in process_op()
2020 strcmp(token, "<<") == 0 || in process_op()
2021 strcmp(token, "&") == 0 || in process_op()
2022 strcmp(token, "|") == 0 || in process_op()
2023 strcmp(token, "&&") == 0 || in process_op()
2024 strcmp(token, "||") == 0 || in process_op()
2025 strcmp(token, "-") == 0 || in process_op()
2026 strcmp(token, "+") == 0 || in process_op()
2027 strcmp(token, "*") == 0 || in process_op()
2028 strcmp(token, "^") == 0 || in process_op()
2029 strcmp(token, "/") == 0 || in process_op()
2030 strcmp(token, "%") == 0 || in process_op()
2031 strcmp(token, "<") == 0 || in process_op()
2032 strcmp(token, ">") == 0 || in process_op()
2033 strcmp(token, "<=") == 0 || in process_op()
2034 strcmp(token, ">=") == 0 || in process_op()
2035 strcmp(token, "==") == 0 || in process_op()
2036 strcmp(token, "!=") == 0) { in process_op()
2046 arg->op.op = token; in process_op()
2057 type = read_token_item(&token); in process_op()
2058 *tok = token; in process_op()
2062 type == TEP_EVENT_DELIM && (strcmp(token, ")") == 0)) { in process_op()
2088 token = NULL; in process_op()
2108 } else if (strcmp(token, "[") == 0) { in process_op()
2117 arg->op.op = token; in process_op()
2126 do_warning_event(event, "unknown op '%s'", token); in process_op()
2149 free_token(token); in process_op()
2160 char *token; in process_entry() local
2165 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_entry()
2167 field = token; in process_entry()
2182 type = read_token(&token); in process_entry()
2183 *tok = token; in process_entry()
2188 free_token(token); in process_entry()
2199 char *token; in alloc_and_process_delim() local
2209 type = process_arg(event, field, &token); in alloc_and_process_delim()
2211 if (test_type_token(type, token, TEP_EVENT_DELIM, next_token)) { in alloc_and_process_delim()
2221 free_token(token); in alloc_and_process_delim()
2534 char *token = *tok; in process_fields() local
2538 free_token(token); in process_fields()
2539 type = read_token_item(&token); in process_fields()
2540 if (test_type_token(type, token, TEP_EVENT_OP, "{")) in process_fields()
2547 free_token(token); in process_fields()
2548 type = process_arg(event, arg, &token); in process_fields()
2551 type = process_op(event, arg, &token); in process_fields()
2556 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_fields()
2575 free_token(token); in process_fields()
2576 type = process_arg(event, arg, &token); in process_fields()
2577 if (test_type_token(type, token, TEP_EVENT_OP, "}")) in process_fields()
2592 free_token(token); in process_fields()
2593 type = read_token_item(&token); in process_fields()
2594 } while (type == TEP_EVENT_DELIM && strcmp(token, ",") == 0); in process_fields()
2596 *tok = token; in process_fields()
2603 free_token(token); in process_fields()
2614 char *token = NULL; in process_flags() local
2625 type = process_field_arg(event, field, &token); in process_flags()
2629 type = process_op(event, field, &token); in process_flags()
2631 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_flags()
2633 free_token(token); in process_flags()
2637 type = read_token_item(&token); in process_flags()
2639 arg->flags.delim = token; in process_flags()
2640 type = read_token_item(&token); in process_flags()
2643 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_flags()
2646 type = process_fields(event, &arg->flags.flags, &token); in process_flags()
2647 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_flags()
2650 free_token(token); in process_flags()
2657 free_token(token); in process_flags()
2667 char *token = NULL; in process_symbols() local
2678 type = process_field_arg(event, field, &token); in process_symbols()
2680 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_symbols()
2685 type = process_fields(event, &arg->symbol.symbols, &token); in process_symbols()
2686 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_symbols()
2689 free_token(token); in process_symbols()
2696 free_token(token); in process_symbols()
2770 char *token; in process_dynamic_array() local
2779 type = read_token(&token); in process_dynamic_array()
2780 *tok = token; in process_dynamic_array()
2786 field = tep_find_field(event, token); in process_dynamic_array()
2796 free_token(token); in process_dynamic_array()
2797 type = read_token_item(&token); in process_dynamic_array()
2798 *tok = token; in process_dynamic_array()
2799 if (type != TEP_EVENT_OP || strcmp(token, "[") != 0) in process_dynamic_array()
2802 free_token(token); in process_dynamic_array()
2810 type = process_arg(event, arg, &token); in process_dynamic_array()
2814 if (!test_type_token(type, token, TEP_EVENT_OP, "]")) in process_dynamic_array()
2817 free_token(token); in process_dynamic_array()
2824 free_token(token); in process_dynamic_array()
2835 char *token; in process_dynamic_array_len() local
2837 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_dynamic_array_len()
2843 field = tep_find_field(event, token); in process_dynamic_array_len()
2853 free_token(token); in process_dynamic_array_len()
2854 type = read_token(&token); in process_dynamic_array_len()
2855 *tok = token; in process_dynamic_array_len()
2860 free_token(token); in process_dynamic_array_len()
2871 char *token; in process_paren() local
2873 type = process_arg(event, arg, &token); in process_paren()
2879 type = process_op(event, arg, &token); in process_paren()
2884 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_paren()
2887 free_token(token); in process_paren()
2888 type = read_token_item(&token); in process_paren()
2895 (type == TEP_EVENT_DELIM && strcmp(token, "(") == 0)) { in process_paren()
2915 type = process_arg_token(event, item_arg, &token, type); in process_paren()
2919 *tok = token; in process_paren()
2923 free_token(token); in process_paren()
2934 char *token; in process_str() local
2936 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_str()
2940 arg->string.string = token; in process_str()
2946 type = read_token(&token); in process_str()
2947 *tok = token; in process_str()
2952 free_token(token); in process_str()
2963 char *token; in process_bitmask() local
2965 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_bitmask()
2969 arg->bitmask.bitmask = token; in process_bitmask()
2975 type = read_token(&token); in process_bitmask()
2976 *tok = token; in process_bitmask()
2981 free_token(token); in process_bitmask()
3026 char *token; in process_func_handler() local
3043 type = process_arg(event, farg, &token); in process_func_handler()
3045 if (type != TEP_EVENT_DELIM || strcmp(token, ",") != 0) { in process_func_handler()
3053 if (type != TEP_EVENT_DELIM || strcmp(token, ")") != 0) { in process_func_handler()
3063 free_token(token); in process_func_handler()
3066 type = read_token(&token); in process_func_handler()
3067 *tok = token; in process_func_handler()
3073 free_token(token); in process_func_handler()
3081 char *token = NULL; in process_builtin_expect() local
3084 type = process_arg(event, arg, &token); in process_builtin_expect()
3086 if (type != TEP_EVENT_DELIM || token[0] != ',') in process_builtin_expect()
3089 free_token(token); in process_builtin_expect()
3092 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_builtin_expect()
3098 free_token(token); in process_builtin_expect()
3103 free_token(token); in process_builtin_expect()
3110 char *token, char **tok) in process_function() argument
3114 if (strcmp(token, "__print_flags") == 0) { in process_function()
3115 free_token(token); in process_function()
3119 if (strcmp(token, "__print_symbolic") == 0) { in process_function()
3120 free_token(token); in process_function()
3124 if (strcmp(token, "__print_hex") == 0) { in process_function()
3125 free_token(token); in process_function()
3128 if (strcmp(token, "__print_hex_str") == 0) { in process_function()
3129 free_token(token); in process_function()
3132 if (strcmp(token, "__print_array") == 0) { in process_function()
3133 free_token(token); in process_function()
3136 if (strcmp(token, "__get_str") == 0 || in process_function()
3137 strcmp(token, "__get_rel_str") == 0) { in process_function()
3138 free_token(token); in process_function()
3141 if (strcmp(token, "__get_bitmask") == 0 || in process_function()
3142 strcmp(token, "__get_rel_bitmask") == 0) { in process_function()
3143 free_token(token); in process_function()
3146 if (strcmp(token, "__get_dynamic_array") == 0 || in process_function()
3147 strcmp(token, "__get_rel_dynamic_array") == 0) { in process_function()
3148 free_token(token); in process_function()
3151 if (strcmp(token, "__get_dynamic_array_len") == 0 || in process_function()
3152 strcmp(token, "__get_rel_dynamic_array_len") == 0) { in process_function()
3153 free_token(token); in process_function()
3156 if (strcmp(token, "__builtin_expect") == 0) { in process_function()
3157 free_token(token); in process_function()
3161 func = find_func_handler(event->tep, token); in process_function()
3163 free_token(token); in process_function()
3167 do_warning_event(event, "function %s not defined", token); in process_function()
3168 free_token(token); in process_function()
3176 char *token; in process_arg_token() local
3179 token = *tok; in process_arg_token()
3183 if (strcmp(token, "REC") == 0) { in process_arg_token()
3184 free_token(token); in process_arg_token()
3185 type = process_entry(event, arg, &token); in process_arg_token()
3188 atom = token; in process_arg_token()
3190 type = read_token_item(&token); in process_arg_token()
3196 if (type == TEP_EVENT_DELIM && strcmp(token, "(") == 0) { in process_arg_token()
3197 free_token(token); in process_arg_token()
3198 token = NULL; in process_arg_token()
3200 type = process_function(event, arg, atom, &token); in process_arg_token()
3207 ret = append(&atom, " ", token); in process_arg_token()
3211 free_token(token); in process_arg_token()
3214 free_token(token); in process_arg_token()
3215 type = read_token_item(&token); in process_arg_token()
3225 arg->atom.atom = token; in process_arg_token()
3226 type = read_token_item(&token); in process_arg_token()
3229 if (strcmp(token, "(") == 0) { in process_arg_token()
3230 free_token(token); in process_arg_token()
3231 type = process_paren(event, arg, &token); in process_arg_token()
3237 arg->op.op = token; in process_arg_token()
3239 type = process_op(event, arg, &token); in process_arg_token()
3253 *tok = token; in process_arg_token()
3262 char *token; in event_read_print_args() local
3267 type = read_token_item(&token); in event_read_print_args()
3278 type = process_arg(event, arg, &token); in event_read_print_args()
3281 free_token(token); in event_read_print_args()
3290 type = process_op(event, arg, &token); in event_read_print_args()
3291 free_token(token); in event_read_print_args()
3301 if (type == TEP_EVENT_DELIM && strcmp(token, ",") == 0) { in event_read_print_args()
3302 free_token(token); in event_read_print_args()
3311 free_token(token); in event_read_print_args()
3319 char *token; in event_read_print() local
3331 if (read_expect_type(TEP_EVENT_DQUOTE, &token) < 0) in event_read_print()
3335 event->print_fmt.format = token; in event_read_print()
3339 type = read_token_item(&token); in event_read_print()
3348 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0) in event_read_print()
3350 free_token(token); in event_read_print()
3353 token = cat; in event_read_print()
3357 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in event_read_print()
3360 free_token(token); in event_read_print()
3369 free_token(token); in event_read_print()
6569 char *token; in parse_header_field() local
6581 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6583 free_token(token); in parse_header_field()
6592 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6594 if (strcmp(token, field) != 0) in parse_header_field()
6596 free_token(token); in parse_header_field()
6605 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6607 *offset = atoi(token); in parse_header_field()
6608 free_token(token); in parse_header_field()
6615 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6617 *size = atoi(token); in parse_header_field()
6618 free_token(token); in parse_header_field()
6621 type = read_token(&token); in parse_header_field()
6627 if (strcmp(token, "signed") != 0) in parse_header_field()
6630 free_token(token); in parse_header_field()
6635 if (read_expect_type(TEP_EVENT_ITEM, &token)) in parse_header_field()
6638 free_token(token); in parse_header_field()
6642 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in parse_header_field()
6646 free_token(token); in parse_header_field()
6654 free_token(token); in parse_header_field()