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()
1424 char *token; in event_read_fields() local
1433 type = read_token(&token); in event_read_fields()
1435 free_token(token); in event_read_fields()
1441 if (test_type_token(type, token, TEP_EVENT_ITEM, "field")) in event_read_fields()
1443 free_token(token); in event_read_fields()
1445 type = read_token(&token); in event_read_fields()
1451 type == TEP_EVENT_ITEM && strcmp(token, "special") == 0) { in event_read_fields()
1452 free_token(token); in event_read_fields()
1453 type = read_token(&token); in event_read_fields()
1456 if (test_type_token(type, token, TEP_EVENT_OP, ":") < 0) in event_read_fields()
1459 free_token(token); in event_read_fields()
1460 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in event_read_fields()
1463 last_token = token; in event_read_fields()
1473 type = read_token(&token); in event_read_fields()
1475 (type == TEP_EVENT_OP && strcmp(token, "*") == 0) || in event_read_fields()
1481 type == TEP_EVENT_OP && strcmp(token, ".") == 0)) { in event_read_fields()
1483 if (strcmp(token, "*") == 0) in event_read_fields()
1493 last_token = token; in event_read_fields()
1501 token[0] == '(') { in event_read_fields()
1511 while ((type = read_token(&token)) != TEP_EVENT_NONE) { in event_read_fields()
1513 if (token[0] == '(') in event_read_fields()
1515 else if (token[0] == ')') in event_read_fields()
1519 ret = append(&field->type, "", token); in event_read_fields()
1522 ret = append(&field->type, delim, token); in event_read_fields()
1528 last_token = token; in event_read_fields()
1544 if (strcmp(token, "[") == 0) { in event_read_fields()
1546 char *brackets = token; in event_read_fields()
1550 type = read_token(&token); in event_read_fields()
1553 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1557 while (strcmp(token, "]") != 0) { in event_read_fields()
1568 ret = append(&brackets, delim, token); in event_read_fields()
1574 field->arraylen = strtoul(token, NULL, 0); in event_read_fields()
1575 free_token(token); in event_read_fields()
1576 type = read_token(&token); in event_read_fields()
1584 free_token(token); in event_read_fields()
1594 type = read_token(&token); in event_read_fields()
1609 field->name = field->alias = token; in event_read_fields()
1610 type = read_token(&token); in event_read_fields()
1628 if (test_type_token(type, token, TEP_EVENT_OP, ";")) in event_read_fields()
1630 free_token(token); in event_read_fields()
1638 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1640 field->offset = strtoul(token, NULL, 0); in event_read_fields()
1641 free_token(token); in event_read_fields()
1652 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1654 field->size = strtoul(token, NULL, 0); in event_read_fields()
1655 free_token(token); in event_read_fields()
1660 type = read_token(&token); in event_read_fields()
1663 if (test_type_token(type, token, TEP_EVENT_ITEM, "signed")) in event_read_fields()
1666 free_token(token); in event_read_fields()
1671 if (read_expect_type(TEP_EVENT_ITEM, &token)) in event_read_fields()
1674 if (strtoul(token, NULL, 0)) in event_read_fields()
1677 free_token(token); in event_read_fields()
1681 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in event_read_fields()
1685 free_token(token); in event_read_fields()
1709 free_token(token); in event_read_fields()
1721 char *token; in event_read_format() local
1730 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in event_read_format()
1732 free_token(token); in event_read_format()
1747 free_token(token); in event_read_format()
1759 char *token; in process_arg() local
1761 type = read_token(&token); in process_arg()
1762 *tok = token; in process_arg()
1793 char *token = NULL; in process_cond() local
1812 type = process_arg(event, left, &token); in process_cond()
1819 if (type == TEP_EVENT_OP && strcmp(token, ":") != 0) { in process_cond()
1820 type = process_op(event, left, &token); in process_cond()
1824 if (test_type_token(type, token, TEP_EVENT_OP, ":")) in process_cond()
1827 arg->op.op = token; in process_cond()
1829 type = process_arg(event, right, &token); in process_cond()
1833 *tok = token; in process_cond()
1839 free_token(token); in process_cond()
1849 char *token = NULL; in process_array() local
1860 type = process_arg(event, arg, &token); in process_array()
1861 if (test_type_token(type, token, TEP_EVENT_OP, "]")) in process_array()
1866 free_token(token); in process_array()
1867 type = read_token_item(&token); in process_array()
1868 *tok = token; in process_array()
1873 free_token(token); in process_array()
1951 char *token; in process_op() local
1954 token = *tok; in process_op()
1958 if (token[1]) { in process_op()
1959 do_warning_event(event, "bad op token %s", token); in process_op()
1962 switch (token[0]) { in process_op()
1969 do_warning_event(event, "bad op token %s", token); in process_op()
1992 } else if (strcmp(token, "?") == 0) { in process_op()
2002 arg->op.op = token; in process_op()
2009 } else if (strcmp(token, ">>") == 0 || in process_op()
2010 strcmp(token, "<<") == 0 || in process_op()
2011 strcmp(token, "&") == 0 || in process_op()
2012 strcmp(token, "|") == 0 || in process_op()
2013 strcmp(token, "&&") == 0 || in process_op()
2014 strcmp(token, "||") == 0 || in process_op()
2015 strcmp(token, "-") == 0 || in process_op()
2016 strcmp(token, "+") == 0 || in process_op()
2017 strcmp(token, "*") == 0 || in process_op()
2018 strcmp(token, "^") == 0 || in process_op()
2019 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()
2036 arg->op.op = token; in process_op()
2047 type = read_token_item(&token); in process_op()
2048 *tok = token; in process_op()
2052 type == TEP_EVENT_DELIM && (strcmp(token, ")") == 0)) { in process_op()
2078 token = NULL; in process_op()
2098 } else if (strcmp(token, "[") == 0) { in process_op()
2107 arg->op.op = token; in process_op()
2116 do_warning_event(event, "unknown op '%s'", token); in process_op()
2139 free_token(token); in process_op()
2150 char *token; in process_entry() local
2155 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_entry()
2157 field = token; in process_entry()
2172 type = read_token(&token); in process_entry()
2173 *tok = token; in process_entry()
2178 free_token(token); in process_entry()
2189 char *token; in alloc_and_process_delim() local
2199 type = process_arg(event, field, &token); in alloc_and_process_delim()
2201 if (test_type_token(type, token, TEP_EVENT_DELIM, next_token)) { in alloc_and_process_delim()
2211 free_token(token); in alloc_and_process_delim()
2524 char *token = *tok; in process_fields() local
2528 free_token(token); in process_fields()
2529 type = read_token_item(&token); in process_fields()
2530 if (test_type_token(type, token, TEP_EVENT_OP, "{")) in process_fields()
2537 free_token(token); in process_fields()
2538 type = process_arg(event, arg, &token); in process_fields()
2541 type = process_op(event, arg, &token); in process_fields()
2546 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_fields()
2565 free_token(token); in process_fields()
2566 type = process_arg(event, arg, &token); in process_fields()
2567 if (test_type_token(type, token, TEP_EVENT_OP, "}")) in process_fields()
2582 free_token(token); in process_fields()
2583 type = read_token_item(&token); in process_fields()
2584 } while (type == TEP_EVENT_DELIM && strcmp(token, ",") == 0); in process_fields()
2586 *tok = token; in process_fields()
2593 free_token(token); in process_fields()
2604 char *token = NULL; in process_flags() local
2615 type = process_field_arg(event, field, &token); in process_flags()
2619 type = process_op(event, field, &token); in process_flags()
2621 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_flags()
2623 free_token(token); in process_flags()
2627 type = read_token_item(&token); in process_flags()
2629 arg->flags.delim = token; in process_flags()
2630 type = read_token_item(&token); in process_flags()
2633 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_flags()
2636 type = process_fields(event, &arg->flags.flags, &token); in process_flags()
2637 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_flags()
2640 free_token(token); in process_flags()
2647 free_token(token); in process_flags()
2657 char *token = NULL; in process_symbols() local
2668 type = process_field_arg(event, field, &token); in process_symbols()
2670 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in process_symbols()
2675 type = process_fields(event, &arg->symbol.symbols, &token); in process_symbols()
2676 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_symbols()
2679 free_token(token); in process_symbols()
2686 free_token(token); in process_symbols()
2760 char *token; in process_dynamic_array() local
2769 type = read_token(&token); in process_dynamic_array()
2770 *tok = token; in process_dynamic_array()
2776 field = tep_find_field(event, token); in process_dynamic_array()
2786 free_token(token); in process_dynamic_array()
2787 type = read_token_item(&token); in process_dynamic_array()
2788 *tok = token; in process_dynamic_array()
2789 if (type != TEP_EVENT_OP || strcmp(token, "[") != 0) in process_dynamic_array()
2792 free_token(token); in process_dynamic_array()
2800 type = process_arg(event, arg, &token); in process_dynamic_array()
2804 if (!test_type_token(type, token, TEP_EVENT_OP, "]")) in process_dynamic_array()
2807 free_token(token); in process_dynamic_array()
2814 free_token(token); in process_dynamic_array()
2825 char *token; in process_dynamic_array_len() local
2827 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_dynamic_array_len()
2833 field = tep_find_field(event, token); in process_dynamic_array_len()
2843 free_token(token); in process_dynamic_array_len()
2844 type = read_token(&token); in process_dynamic_array_len()
2845 *tok = token; in process_dynamic_array_len()
2850 free_token(token); in process_dynamic_array_len()
2861 char *token; in process_paren() local
2863 type = process_arg(event, arg, &token); in process_paren()
2869 type = process_op(event, arg, &token); in process_paren()
2874 if (test_type_token(type, token, TEP_EVENT_DELIM, ")")) in process_paren()
2877 free_token(token); in process_paren()
2878 type = read_token_item(&token); in process_paren()
2885 (type == TEP_EVENT_DELIM && strcmp(token, "(") == 0)) { in process_paren()
2905 type = process_arg_token(event, item_arg, &token, type); in process_paren()
2909 *tok = token; in process_paren()
2913 free_token(token); in process_paren()
2924 char *token; in process_str() local
2926 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_str()
2930 arg->string.string = token; in process_str()
2936 type = read_token(&token); in process_str()
2937 *tok = token; in process_str()
2942 free_token(token); in process_str()
2953 char *token; in process_bitmask() local
2955 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_bitmask()
2959 arg->bitmask.bitmask = token; in process_bitmask()
2965 type = read_token(&token); in process_bitmask()
2966 *tok = token; in process_bitmask()
2971 free_token(token); in process_bitmask()
3016 char *token; in process_func_handler() local
3033 type = process_arg(event, farg, &token); in process_func_handler()
3035 if (type != TEP_EVENT_DELIM || strcmp(token, ",") != 0) { in process_func_handler()
3043 if (type != TEP_EVENT_DELIM || strcmp(token, ")") != 0) { in process_func_handler()
3053 free_token(token); in process_func_handler()
3056 type = read_token(&token); in process_func_handler()
3057 *tok = token; in process_func_handler()
3063 free_token(token); in process_func_handler()
3071 char *token = NULL; in process_builtin_expect() local
3074 type = process_arg(event, arg, &token); in process_builtin_expect()
3076 if (type != TEP_EVENT_DELIM || token[0] != ',') in process_builtin_expect()
3079 free_token(token); in process_builtin_expect()
3082 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in process_builtin_expect()
3088 free_token(token); in process_builtin_expect()
3093 free_token(token); in process_builtin_expect()
3100 char *token, char **tok) in process_function() argument
3104 if (strcmp(token, "__print_flags") == 0) { in process_function()
3105 free_token(token); in process_function()
3109 if (strcmp(token, "__print_symbolic") == 0) { in process_function()
3110 free_token(token); in process_function()
3114 if (strcmp(token, "__print_hex") == 0) { in process_function()
3115 free_token(token); in process_function()
3118 if (strcmp(token, "__print_hex_str") == 0) { in process_function()
3119 free_token(token); in process_function()
3122 if (strcmp(token, "__print_array") == 0) { in process_function()
3123 free_token(token); in process_function()
3126 if (strcmp(token, "__get_str") == 0) { in process_function()
3127 free_token(token); in process_function()
3130 if (strcmp(token, "__get_bitmask") == 0) { in process_function()
3131 free_token(token); in process_function()
3134 if (strcmp(token, "__get_dynamic_array") == 0) { in process_function()
3135 free_token(token); in process_function()
3138 if (strcmp(token, "__get_dynamic_array_len") == 0) { in process_function()
3139 free_token(token); in process_function()
3142 if (strcmp(token, "__builtin_expect") == 0) { in process_function()
3143 free_token(token); in process_function()
3147 func = find_func_handler(event->tep, token); in process_function()
3149 free_token(token); in process_function()
3153 do_warning_event(event, "function %s not defined", token); in process_function()
3154 free_token(token); in process_function()
3162 char *token; in process_arg_token() local
3165 token = *tok; in process_arg_token()
3169 if (strcmp(token, "REC") == 0) { in process_arg_token()
3170 free_token(token); in process_arg_token()
3171 type = process_entry(event, arg, &token); in process_arg_token()
3174 atom = token; in process_arg_token()
3176 type = read_token_item(&token); in process_arg_token()
3182 if (type == TEP_EVENT_DELIM && strcmp(token, "(") == 0) { in process_arg_token()
3183 free_token(token); in process_arg_token()
3184 token = NULL; in process_arg_token()
3186 type = process_function(event, arg, atom, &token); in process_arg_token()
3193 ret = append(&atom, " ", token); in process_arg_token()
3197 free_token(token); in process_arg_token()
3200 free_token(token); in process_arg_token()
3201 type = read_token_item(&token); in process_arg_token()
3211 arg->atom.atom = token; in process_arg_token()
3212 type = read_token_item(&token); in process_arg_token()
3215 if (strcmp(token, "(") == 0) { in process_arg_token()
3216 free_token(token); in process_arg_token()
3217 type = process_paren(event, arg, &token); in process_arg_token()
3223 arg->op.op = token; in process_arg_token()
3225 type = process_op(event, arg, &token); in process_arg_token()
3239 *tok = token; in process_arg_token()
3248 char *token; in event_read_print_args() local
3253 type = read_token_item(&token); in event_read_print_args()
3264 type = process_arg(event, arg, &token); in event_read_print_args()
3267 free_token(token); in event_read_print_args()
3276 type = process_op(event, arg, &token); in event_read_print_args()
3277 free_token(token); in event_read_print_args()
3287 if (type == TEP_EVENT_DELIM && strcmp(token, ",") == 0) { in event_read_print_args()
3288 free_token(token); in event_read_print_args()
3297 free_token(token); in event_read_print_args()
3305 char *token; in event_read_print() local
3317 if (read_expect_type(TEP_EVENT_DQUOTE, &token) < 0) in event_read_print()
3321 event->print_fmt.format = token; in event_read_print()
3325 type = read_token_item(&token); in event_read_print()
3334 if (asprintf(&cat, "%s%s", event->print_fmt.format, token) < 0) in event_read_print()
3336 free_token(token); in event_read_print()
3339 token = cat; in event_read_print()
3343 if (test_type_token(type, token, TEP_EVENT_DELIM, ",")) in event_read_print()
3346 free_token(token); in event_read_print()
3355 free_token(token); in event_read_print()
6550 char *token; in parse_header_field() local
6562 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6564 free_token(token); in parse_header_field()
6573 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6575 if (strcmp(token, field) != 0) in parse_header_field()
6577 free_token(token); in parse_header_field()
6586 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6588 *offset = atoi(token); in parse_header_field()
6589 free_token(token); in parse_header_field()
6596 if (read_expect_type(TEP_EVENT_ITEM, &token) < 0) in parse_header_field()
6598 *size = atoi(token); in parse_header_field()
6599 free_token(token); in parse_header_field()
6602 type = read_token(&token); in parse_header_field()
6608 if (strcmp(token, "signed") != 0) in parse_header_field()
6611 free_token(token); in parse_header_field()
6616 if (read_expect_type(TEP_EVENT_ITEM, &token)) in parse_header_field()
6619 free_token(token); in parse_header_field()
6623 if (read_expect_type(TEP_EVENT_NEWLINE, &token)) in parse_header_field()
6627 free_token(token); in parse_header_field()
6635 free_token(token); in parse_header_field()