diff options
| -rw-r--r-- | tools/lib/traceevent/event-parse.h | 46 | ||||
| -rw-r--r-- | tools/lib/traceevent/parse-filter.c | 144 |
2 files changed, 95 insertions, 95 deletions
diff --git a/tools/lib/traceevent/event-parse.h b/tools/lib/traceevent/event-parse.h index 7c4bf915d09a..c9d7c5376fc2 100644 --- a/tools/lib/traceevent/event-parse.h +++ b/tools/lib/traceevent/event-parse.h | |||
| @@ -768,29 +768,29 @@ void tep_print_printk(struct tep_handle *pevent); | |||
| 768 | 768 | ||
| 769 | /* ----------------------- filtering ----------------------- */ | 769 | /* ----------------------- filtering ----------------------- */ |
| 770 | 770 | ||
| 771 | enum filter_boolean_type { | 771 | enum tep_filter_boolean_type { |
| 772 | FILTER_FALSE, | 772 | TEP_FILTER_FALSE, |
| 773 | FILTER_TRUE, | 773 | TEP_FILTER_TRUE, |
| 774 | }; | 774 | }; |
| 775 | 775 | ||
| 776 | enum filter_op_type { | 776 | enum tep_filter_op_type { |
| 777 | FILTER_OP_AND = 1, | 777 | TEP_FILTER_OP_AND = 1, |
| 778 | FILTER_OP_OR, | 778 | TEP_FILTER_OP_OR, |
| 779 | FILTER_OP_NOT, | 779 | TEP_FILTER_OP_NOT, |
| 780 | }; | 780 | }; |
| 781 | 781 | ||
| 782 | enum filter_cmp_type { | 782 | enum tep_filter_cmp_type { |
| 783 | FILTER_CMP_NONE, | 783 | TEP_FILTER_CMP_NONE, |
| 784 | FILTER_CMP_EQ, | 784 | TEP_FILTER_CMP_EQ, |
| 785 | FILTER_CMP_NE, | 785 | TEP_FILTER_CMP_NE, |
| 786 | FILTER_CMP_GT, | 786 | TEP_FILTER_CMP_GT, |
| 787 | FILTER_CMP_LT, | 787 | TEP_FILTER_CMP_LT, |
| 788 | FILTER_CMP_GE, | 788 | TEP_FILTER_CMP_GE, |
| 789 | FILTER_CMP_LE, | 789 | TEP_FILTER_CMP_LE, |
| 790 | FILTER_CMP_MATCH, | 790 | TEP_FILTER_CMP_MATCH, |
| 791 | FILTER_CMP_NOT_MATCH, | 791 | TEP_FILTER_CMP_NOT_MATCH, |
| 792 | FILTER_CMP_REGEX, | 792 | TEP_FILTER_CMP_REGEX, |
| 793 | FILTER_CMP_NOT_REGEX, | 793 | TEP_FILTER_CMP_NOT_REGEX, |
| 794 | }; | 794 | }; |
| 795 | 795 | ||
| 796 | enum filter_exp_type { | 796 | enum filter_exp_type { |
| @@ -828,7 +828,7 @@ enum filter_value_type { | |||
| 828 | struct fliter_arg; | 828 | struct fliter_arg; |
| 829 | 829 | ||
| 830 | struct filter_arg_boolean { | 830 | struct filter_arg_boolean { |
| 831 | enum filter_boolean_type value; | 831 | enum tep_filter_boolean_type value; |
| 832 | }; | 832 | }; |
| 833 | 833 | ||
| 834 | struct filter_arg_field { | 834 | struct filter_arg_field { |
| @@ -844,7 +844,7 @@ struct filter_arg_value { | |||
| 844 | }; | 844 | }; |
| 845 | 845 | ||
| 846 | struct filter_arg_op { | 846 | struct filter_arg_op { |
| 847 | enum filter_op_type type; | 847 | enum tep_filter_op_type type; |
| 848 | struct filter_arg *left; | 848 | struct filter_arg *left; |
| 849 | struct filter_arg *right; | 849 | struct filter_arg *right; |
| 850 | }; | 850 | }; |
| @@ -856,13 +856,13 @@ struct filter_arg_exp { | |||
| 856 | }; | 856 | }; |
| 857 | 857 | ||
| 858 | struct filter_arg_num { | 858 | struct filter_arg_num { |
| 859 | enum filter_cmp_type type; | 859 | enum tep_filter_cmp_type type; |
| 860 | struct filter_arg *left; | 860 | struct filter_arg *left; |
| 861 | struct filter_arg *right; | 861 | struct filter_arg *right; |
| 862 | }; | 862 | }; |
| 863 | 863 | ||
| 864 | struct filter_arg_str { | 864 | struct filter_arg_str { |
| 865 | enum filter_cmp_type type; | 865 | enum tep_filter_cmp_type type; |
| 866 | struct tep_format_field *field; | 866 | struct tep_format_field *field; |
| 867 | char *val; | 867 | char *val; |
| 868 | char *buffer; | 868 | char *buffer; |
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c index 153e248de75b..55ce8e603485 100644 --- a/tools/lib/traceevent/parse-filter.c +++ b/tools/lib/traceevent/parse-filter.c | |||
| @@ -378,7 +378,7 @@ create_arg_item(struct tep_event_format *event, const char *token, | |||
| 378 | } else { | 378 | } else { |
| 379 | /* not a field, Make it false */ | 379 | /* not a field, Make it false */ |
| 380 | arg->type = FILTER_ARG_BOOLEAN; | 380 | arg->type = FILTER_ARG_BOOLEAN; |
| 381 | arg->boolean.value = FILTER_FALSE; | 381 | arg->boolean.value = TEP_FILTER_FALSE; |
| 382 | break; | 382 | break; |
| 383 | } | 383 | } |
| 384 | } | 384 | } |
| @@ -395,7 +395,7 @@ create_arg_item(struct tep_event_format *event, const char *token, | |||
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | static struct filter_arg * | 397 | static struct filter_arg * |
| 398 | create_arg_op(enum filter_op_type btype) | 398 | create_arg_op(enum tep_filter_op_type btype) |
| 399 | { | 399 | { |
| 400 | struct filter_arg *arg; | 400 | struct filter_arg *arg; |
| 401 | 401 | ||
| @@ -425,7 +425,7 @@ create_arg_exp(enum filter_exp_type etype) | |||
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | static struct filter_arg * | 427 | static struct filter_arg * |
| 428 | create_arg_cmp(enum filter_cmp_type ctype) | 428 | create_arg_cmp(enum tep_filter_cmp_type ctype) |
| 429 | { | 429 | { |
| 430 | struct filter_arg *arg; | 430 | struct filter_arg *arg; |
| 431 | 431 | ||
| @@ -488,8 +488,8 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str) | |||
| 488 | * is not a REGEX. | 488 | * is not a REGEX. |
| 489 | */ | 489 | */ |
| 490 | if (strlen(arg->value.str) == 1 && | 490 | if (strlen(arg->value.str) == 1 && |
| 491 | op->num.type != FILTER_CMP_REGEX && | 491 | op->num.type != TEP_FILTER_CMP_REGEX && |
| 492 | op->num.type != FILTER_CMP_NOT_REGEX) { | 492 | op->num.type != TEP_FILTER_CMP_NOT_REGEX) { |
| 493 | arg->value.type = FILTER_NUMBER; | 493 | arg->value.type = FILTER_NUMBER; |
| 494 | goto do_int; | 494 | goto do_int; |
| 495 | } | 495 | } |
| @@ -512,7 +512,7 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str) | |||
| 512 | free_arg(left); | 512 | free_arg(left); |
| 513 | free_arg(arg); | 513 | free_arg(arg); |
| 514 | op->type = FILTER_ARG_BOOLEAN; | 514 | op->type = FILTER_ARG_BOOLEAN; |
| 515 | op->boolean.value = FILTER_FALSE; | 515 | op->boolean.value = TEP_FILTER_FALSE; |
| 516 | break; | 516 | break; |
| 517 | } | 517 | } |
| 518 | 518 | ||
| @@ -525,15 +525,15 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str) | |||
| 525 | 525 | ||
| 526 | /* Make sure this is a valid string compare */ | 526 | /* Make sure this is a valid string compare */ |
| 527 | switch (op_type) { | 527 | switch (op_type) { |
| 528 | case FILTER_CMP_EQ: | 528 | case TEP_FILTER_CMP_EQ: |
| 529 | op_type = FILTER_CMP_MATCH; | 529 | op_type = TEP_FILTER_CMP_MATCH; |
| 530 | break; | 530 | break; |
| 531 | case FILTER_CMP_NE: | 531 | case TEP_FILTER_CMP_NE: |
| 532 | op_type = FILTER_CMP_NOT_MATCH; | 532 | op_type = TEP_FILTER_CMP_NOT_MATCH; |
| 533 | break; | 533 | break; |
| 534 | 534 | ||
| 535 | case FILTER_CMP_REGEX: | 535 | case TEP_FILTER_CMP_REGEX: |
| 536 | case FILTER_CMP_NOT_REGEX: | 536 | case TEP_FILTER_CMP_NOT_REGEX: |
| 537 | ret = regcomp(&op->str.reg, str, REG_ICASE|REG_NOSUB); | 537 | ret = regcomp(&op->str.reg, str, REG_ICASE|REG_NOSUB); |
| 538 | if (ret) { | 538 | if (ret) { |
| 539 | show_error(error_str, | 539 | show_error(error_str, |
| @@ -577,8 +577,8 @@ add_right(struct filter_arg *op, struct filter_arg *arg, char *error_str) | |||
| 577 | 577 | ||
| 578 | do_int: | 578 | do_int: |
| 579 | switch (op->num.type) { | 579 | switch (op->num.type) { |
| 580 | case FILTER_CMP_REGEX: | 580 | case TEP_FILTER_CMP_REGEX: |
| 581 | case FILTER_CMP_NOT_REGEX: | 581 | case TEP_FILTER_CMP_NOT_REGEX: |
| 582 | show_error(error_str, | 582 | show_error(error_str, |
| 583 | "Op not allowed with integers"); | 583 | "Op not allowed with integers"); |
| 584 | return TEP_ERRNO__ILLEGAL_INTEGER_CMP; | 584 | return TEP_ERRNO__ILLEGAL_INTEGER_CMP; |
| @@ -652,22 +652,22 @@ enum op_type { | |||
| 652 | }; | 652 | }; |
| 653 | 653 | ||
| 654 | static enum op_type process_op(const char *token, | 654 | static enum op_type process_op(const char *token, |
| 655 | enum filter_op_type *btype, | 655 | enum tep_filter_op_type *btype, |
| 656 | enum filter_cmp_type *ctype, | 656 | enum tep_filter_cmp_type *ctype, |
| 657 | enum filter_exp_type *etype) | 657 | enum filter_exp_type *etype) |
| 658 | { | 658 | { |
| 659 | *btype = FILTER_OP_NOT; | 659 | *btype = TEP_FILTER_OP_NOT; |
| 660 | *etype = FILTER_EXP_NONE; | 660 | *etype = FILTER_EXP_NONE; |
| 661 | *ctype = FILTER_CMP_NONE; | 661 | *ctype = TEP_FILTER_CMP_NONE; |
| 662 | 662 | ||
| 663 | if (strcmp(token, "&&") == 0) | 663 | if (strcmp(token, "&&") == 0) |
| 664 | *btype = FILTER_OP_AND; | 664 | *btype = TEP_FILTER_OP_AND; |
| 665 | else if (strcmp(token, "||") == 0) | 665 | else if (strcmp(token, "||") == 0) |
| 666 | *btype = FILTER_OP_OR; | 666 | *btype = TEP_FILTER_OP_OR; |
| 667 | else if (strcmp(token, "!") == 0) | 667 | else if (strcmp(token, "!") == 0) |
| 668 | return OP_NOT; | 668 | return OP_NOT; |
| 669 | 669 | ||
| 670 | if (*btype != FILTER_OP_NOT) | 670 | if (*btype != TEP_FILTER_OP_NOT) |
| 671 | return OP_BOOL; | 671 | return OP_BOOL; |
| 672 | 672 | ||
| 673 | /* Check for value expressions */ | 673 | /* Check for value expressions */ |
| @@ -699,21 +699,21 @@ static enum op_type process_op(const char *token, | |||
| 699 | 699 | ||
| 700 | /* Check for compares */ | 700 | /* Check for compares */ |
| 701 | if (strcmp(token, "==") == 0) | 701 | if (strcmp(token, "==") == 0) |
| 702 | *ctype = FILTER_CMP_EQ; | 702 | *ctype = TEP_FILTER_CMP_EQ; |
| 703 | else if (strcmp(token, "!=") == 0) | 703 | else if (strcmp(token, "!=") == 0) |
| 704 | *ctype = FILTER_CMP_NE; | 704 | *ctype = TEP_FILTER_CMP_NE; |
| 705 | else if (strcmp(token, "<") == 0) | 705 | else if (strcmp(token, "<") == 0) |
| 706 | *ctype = FILTER_CMP_LT; | 706 | *ctype = TEP_FILTER_CMP_LT; |
| 707 | else if (strcmp(token, ">") == 0) | 707 | else if (strcmp(token, ">") == 0) |
| 708 | *ctype = FILTER_CMP_GT; | 708 | *ctype = TEP_FILTER_CMP_GT; |
| 709 | else if (strcmp(token, "<=") == 0) | 709 | else if (strcmp(token, "<=") == 0) |
| 710 | *ctype = FILTER_CMP_LE; | 710 | *ctype = TEP_FILTER_CMP_LE; |
| 711 | else if (strcmp(token, ">=") == 0) | 711 | else if (strcmp(token, ">=") == 0) |
| 712 | *ctype = FILTER_CMP_GE; | 712 | *ctype = TEP_FILTER_CMP_GE; |
| 713 | else if (strcmp(token, "=~") == 0) | 713 | else if (strcmp(token, "=~") == 0) |
| 714 | *ctype = FILTER_CMP_REGEX; | 714 | *ctype = TEP_FILTER_CMP_REGEX; |
| 715 | else if (strcmp(token, "!~") == 0) | 715 | else if (strcmp(token, "!~") == 0) |
| 716 | *ctype = FILTER_CMP_NOT_REGEX; | 716 | *ctype = TEP_FILTER_CMP_NOT_REGEX; |
| 717 | else | 717 | else |
| 718 | return OP_NONE; | 718 | return OP_NONE; |
| 719 | 719 | ||
| @@ -840,13 +840,13 @@ static int test_arg(struct filter_arg *parent, struct filter_arg *arg, | |||
| 840 | return FILTER_VAL_NORM; | 840 | return FILTER_VAL_NORM; |
| 841 | 841 | ||
| 842 | case FILTER_ARG_OP: | 842 | case FILTER_ARG_OP: |
| 843 | if (arg->op.type != FILTER_OP_NOT) { | 843 | if (arg->op.type != TEP_FILTER_OP_NOT) { |
| 844 | lval = test_arg(arg, arg->op.left, error_str); | 844 | lval = test_arg(arg, arg->op.left, error_str); |
| 845 | switch (lval) { | 845 | switch (lval) { |
| 846 | case FILTER_VAL_NORM: | 846 | case FILTER_VAL_NORM: |
| 847 | break; | 847 | break; |
| 848 | case FILTER_VAL_TRUE: | 848 | case FILTER_VAL_TRUE: |
| 849 | if (arg->op.type == FILTER_OP_OR) | 849 | if (arg->op.type == TEP_FILTER_OP_OR) |
| 850 | return FILTER_VAL_TRUE; | 850 | return FILTER_VAL_TRUE; |
| 851 | rval = test_arg(arg, arg->op.right, error_str); | 851 | rval = test_arg(arg, arg->op.right, error_str); |
| 852 | if (rval != FILTER_VAL_NORM) | 852 | if (rval != FILTER_VAL_NORM) |
| @@ -856,7 +856,7 @@ static int test_arg(struct filter_arg *parent, struct filter_arg *arg, | |||
| 856 | error_str); | 856 | error_str); |
| 857 | 857 | ||
| 858 | case FILTER_VAL_FALSE: | 858 | case FILTER_VAL_FALSE: |
| 859 | if (arg->op.type == FILTER_OP_AND) | 859 | if (arg->op.type == TEP_FILTER_OP_AND) |
| 860 | return FILTER_VAL_FALSE; | 860 | return FILTER_VAL_FALSE; |
| 861 | rval = test_arg(arg, arg->op.right, error_str); | 861 | rval = test_arg(arg, arg->op.right, error_str); |
| 862 | if (rval != FILTER_VAL_NORM) | 862 | if (rval != FILTER_VAL_NORM) |
| @@ -877,18 +877,18 @@ static int test_arg(struct filter_arg *parent, struct filter_arg *arg, | |||
| 877 | break; | 877 | break; |
| 878 | 878 | ||
| 879 | case FILTER_VAL_TRUE: | 879 | case FILTER_VAL_TRUE: |
| 880 | if (arg->op.type == FILTER_OP_OR) | 880 | if (arg->op.type == TEP_FILTER_OP_OR) |
| 881 | return FILTER_VAL_TRUE; | 881 | return FILTER_VAL_TRUE; |
| 882 | if (arg->op.type == FILTER_OP_NOT) | 882 | if (arg->op.type == TEP_FILTER_OP_NOT) |
| 883 | return FILTER_VAL_FALSE; | 883 | return FILTER_VAL_FALSE; |
| 884 | 884 | ||
| 885 | return reparent_op_arg(parent, arg, arg->op.left, | 885 | return reparent_op_arg(parent, arg, arg->op.left, |
| 886 | error_str); | 886 | error_str); |
| 887 | 887 | ||
| 888 | case FILTER_VAL_FALSE: | 888 | case FILTER_VAL_FALSE: |
| 889 | if (arg->op.type == FILTER_OP_AND) | 889 | if (arg->op.type == TEP_FILTER_OP_AND) |
| 890 | return FILTER_VAL_FALSE; | 890 | return FILTER_VAL_FALSE; |
| 891 | if (arg->op.type == FILTER_OP_NOT) | 891 | if (arg->op.type == TEP_FILTER_OP_NOT) |
| 892 | return FILTER_VAL_TRUE; | 892 | return FILTER_VAL_TRUE; |
| 893 | 893 | ||
| 894 | return reparent_op_arg(parent, arg, arg->op.left, | 894 | return reparent_op_arg(parent, arg, arg->op.left, |
| @@ -949,9 +949,9 @@ process_filter(struct tep_event_format *event, struct filter_arg **parg, | |||
| 949 | struct filter_arg *left_item = NULL; | 949 | struct filter_arg *left_item = NULL; |
| 950 | struct filter_arg *arg = NULL; | 950 | struct filter_arg *arg = NULL; |
| 951 | enum op_type op_type; | 951 | enum op_type op_type; |
| 952 | enum filter_op_type btype; | 952 | enum tep_filter_op_type btype; |
| 953 | enum filter_exp_type etype; | 953 | enum filter_exp_type etype; |
| 954 | enum filter_cmp_type ctype; | 954 | enum tep_filter_cmp_type ctype; |
| 955 | enum tep_errno ret; | 955 | enum tep_errno ret; |
| 956 | 956 | ||
| 957 | *parg = NULL; | 957 | *parg = NULL; |
| @@ -1197,7 +1197,7 @@ process_event(struct tep_event_format *event, const char *filter_str, | |||
| 1197 | return TEP_ERRNO__MEM_ALLOC_FAILED; | 1197 | return TEP_ERRNO__MEM_ALLOC_FAILED; |
| 1198 | 1198 | ||
| 1199 | (*parg)->type = FILTER_ARG_BOOLEAN; | 1199 | (*parg)->type = FILTER_ARG_BOOLEAN; |
| 1200 | (*parg)->boolean.value = FILTER_FALSE; | 1200 | (*parg)->boolean.value = TEP_FILTER_FALSE; |
| 1201 | } | 1201 | } |
| 1202 | 1202 | ||
| 1203 | return 0; | 1203 | return 0; |
| @@ -1223,7 +1223,7 @@ filter_event(struct event_filter *filter, struct tep_event_format *event, | |||
| 1223 | return TEP_ERRNO__MEM_ALLOC_FAILED; | 1223 | return TEP_ERRNO__MEM_ALLOC_FAILED; |
| 1224 | 1224 | ||
| 1225 | arg->type = FILTER_ARG_BOOLEAN; | 1225 | arg->type = FILTER_ARG_BOOLEAN; |
| 1226 | arg->boolean.value = FILTER_TRUE; | 1226 | arg->boolean.value = TEP_FILTER_TRUE; |
| 1227 | } | 1227 | } |
| 1228 | 1228 | ||
| 1229 | filter_type = add_filter_type(filter, event->id); | 1229 | filter_type = add_filter_type(filter, event->id); |
| @@ -1832,22 +1832,22 @@ static int test_num(struct tep_event_format *event, struct filter_arg *arg, | |||
| 1832 | } | 1832 | } |
| 1833 | 1833 | ||
| 1834 | switch (arg->num.type) { | 1834 | switch (arg->num.type) { |
| 1835 | case FILTER_CMP_EQ: | 1835 | case TEP_FILTER_CMP_EQ: |
| 1836 | return lval == rval; | 1836 | return lval == rval; |
| 1837 | 1837 | ||
| 1838 | case FILTER_CMP_NE: | 1838 | case TEP_FILTER_CMP_NE: |
| 1839 | return lval != rval; | 1839 | return lval != rval; |
| 1840 | 1840 | ||
| 1841 | case FILTER_CMP_GT: | 1841 | case TEP_FILTER_CMP_GT: |
| 1842 | return lval > rval; | 1842 | return lval > rval; |
| 1843 | 1843 | ||
| 1844 | case FILTER_CMP_LT: | 1844 | case TEP_FILTER_CMP_LT: |
| 1845 | return lval < rval; | 1845 | return lval < rval; |
| 1846 | 1846 | ||
| 1847 | case FILTER_CMP_GE: | 1847 | case TEP_FILTER_CMP_GE: |
| 1848 | return lval >= rval; | 1848 | return lval >= rval; |
| 1849 | 1849 | ||
| 1850 | case FILTER_CMP_LE: | 1850 | case TEP_FILTER_CMP_LE: |
| 1851 | return lval <= rval; | 1851 | return lval <= rval; |
| 1852 | 1852 | ||
| 1853 | default: | 1853 | default: |
| @@ -1918,17 +1918,17 @@ static int test_str(struct tep_event_format *event, struct filter_arg *arg, | |||
| 1918 | val = get_field_str(arg, record); | 1918 | val = get_field_str(arg, record); |
| 1919 | 1919 | ||
| 1920 | switch (arg->str.type) { | 1920 | switch (arg->str.type) { |
| 1921 | case FILTER_CMP_MATCH: | 1921 | case TEP_FILTER_CMP_MATCH: |
| 1922 | return strcmp(val, arg->str.val) == 0; | 1922 | return strcmp(val, arg->str.val) == 0; |
| 1923 | 1923 | ||
| 1924 | case FILTER_CMP_NOT_MATCH: | 1924 | case TEP_FILTER_CMP_NOT_MATCH: |
| 1925 | return strcmp(val, arg->str.val) != 0; | 1925 | return strcmp(val, arg->str.val) != 0; |
| 1926 | 1926 | ||
| 1927 | case FILTER_CMP_REGEX: | 1927 | case TEP_FILTER_CMP_REGEX: |
| 1928 | /* Returns zero on match */ | 1928 | /* Returns zero on match */ |
| 1929 | return !regexec(&arg->str.reg, val, 0, NULL, 0); | 1929 | return !regexec(&arg->str.reg, val, 0, NULL, 0); |
| 1930 | 1930 | ||
| 1931 | case FILTER_CMP_NOT_REGEX: | 1931 | case TEP_FILTER_CMP_NOT_REGEX: |
| 1932 | return regexec(&arg->str.reg, val, 0, NULL, 0); | 1932 | return regexec(&arg->str.reg, val, 0, NULL, 0); |
| 1933 | 1933 | ||
| 1934 | default: | 1934 | default: |
| @@ -1942,15 +1942,15 @@ static int test_op(struct tep_event_format *event, struct filter_arg *arg, | |||
| 1942 | struct tep_record *record, enum tep_errno *err) | 1942 | struct tep_record *record, enum tep_errno *err) |
| 1943 | { | 1943 | { |
| 1944 | switch (arg->op.type) { | 1944 | switch (arg->op.type) { |
| 1945 | case FILTER_OP_AND: | 1945 | case TEP_FILTER_OP_AND: |
| 1946 | return test_filter(event, arg->op.left, record, err) && | 1946 | return test_filter(event, arg->op.left, record, err) && |
| 1947 | test_filter(event, arg->op.right, record, err); | 1947 | test_filter(event, arg->op.right, record, err); |
| 1948 | 1948 | ||
| 1949 | case FILTER_OP_OR: | 1949 | case TEP_FILTER_OP_OR: |
| 1950 | return test_filter(event, arg->op.left, record, err) || | 1950 | return test_filter(event, arg->op.left, record, err) || |
| 1951 | test_filter(event, arg->op.right, record, err); | 1951 | test_filter(event, arg->op.right, record, err); |
| 1952 | 1952 | ||
| 1953 | case FILTER_OP_NOT: | 1953 | case TEP_FILTER_OP_NOT: |
| 1954 | return !test_filter(event, arg->op.right, record, err); | 1954 | return !test_filter(event, arg->op.right, record, err); |
| 1955 | 1955 | ||
| 1956 | default: | 1956 | default: |
| @@ -2070,10 +2070,10 @@ static char *op_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2070 | int val; | 2070 | int val; |
| 2071 | 2071 | ||
| 2072 | switch (arg->op.type) { | 2072 | switch (arg->op.type) { |
| 2073 | case FILTER_OP_AND: | 2073 | case TEP_FILTER_OP_AND: |
| 2074 | op = "&&"; | 2074 | op = "&&"; |
| 2075 | /* fall through */ | 2075 | /* fall through */ |
| 2076 | case FILTER_OP_OR: | 2076 | case TEP_FILTER_OP_OR: |
| 2077 | if (!op) | 2077 | if (!op) |
| 2078 | op = "||"; | 2078 | op = "||"; |
| 2079 | 2079 | ||
| @@ -2094,8 +2094,8 @@ static char *op_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2094 | right_val = 0; | 2094 | right_val = 0; |
| 2095 | 2095 | ||
| 2096 | if (left_val >= 0) { | 2096 | if (left_val >= 0) { |
| 2097 | if ((arg->op.type == FILTER_OP_AND && !left_val) || | 2097 | if ((arg->op.type == TEP_FILTER_OP_AND && !left_val) || |
| 2098 | (arg->op.type == FILTER_OP_OR && left_val)) { | 2098 | (arg->op.type == TEP_FILTER_OP_OR && left_val)) { |
| 2099 | /* Just return left value */ | 2099 | /* Just return left value */ |
| 2100 | str = left; | 2100 | str = left; |
| 2101 | left = NULL; | 2101 | left = NULL; |
| @@ -2105,10 +2105,10 @@ static char *op_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2105 | /* just evaluate this. */ | 2105 | /* just evaluate this. */ |
| 2106 | val = 0; | 2106 | val = 0; |
| 2107 | switch (arg->op.type) { | 2107 | switch (arg->op.type) { |
| 2108 | case FILTER_OP_AND: | 2108 | case TEP_FILTER_OP_AND: |
| 2109 | val = left_val && right_val; | 2109 | val = left_val && right_val; |
| 2110 | break; | 2110 | break; |
| 2111 | case FILTER_OP_OR: | 2111 | case TEP_FILTER_OP_OR: |
| 2112 | val = left_val || right_val; | 2112 | val = left_val || right_val; |
| 2113 | break; | 2113 | break; |
| 2114 | default: | 2114 | default: |
| @@ -2119,8 +2119,8 @@ static char *op_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2119 | } | 2119 | } |
| 2120 | } | 2120 | } |
| 2121 | if (right_val >= 0) { | 2121 | if (right_val >= 0) { |
| 2122 | if ((arg->op.type == FILTER_OP_AND && !right_val) || | 2122 | if ((arg->op.type == TEP_FILTER_OP_AND && !right_val) || |
| 2123 | (arg->op.type == FILTER_OP_OR && right_val)) { | 2123 | (arg->op.type == TEP_FILTER_OP_OR && right_val)) { |
| 2124 | /* Just return right value */ | 2124 | /* Just return right value */ |
| 2125 | str = right; | 2125 | str = right; |
| 2126 | right = NULL; | 2126 | right = NULL; |
| @@ -2135,7 +2135,7 @@ static char *op_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2135 | asprintf(&str, "(%s) %s (%s)", left, op, right); | 2135 | asprintf(&str, "(%s) %s (%s)", left, op, right); |
| 2136 | break; | 2136 | break; |
| 2137 | 2137 | ||
| 2138 | case FILTER_OP_NOT: | 2138 | case TEP_FILTER_OP_NOT: |
| 2139 | op = "!"; | 2139 | op = "!"; |
| 2140 | right = arg_to_str(filter, arg->op.right); | 2140 | right = arg_to_str(filter, arg->op.right); |
| 2141 | if (!right) | 2141 | if (!right) |
| @@ -2246,26 +2246,26 @@ static char *num_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2246 | goto out; | 2246 | goto out; |
| 2247 | 2247 | ||
| 2248 | switch (arg->num.type) { | 2248 | switch (arg->num.type) { |
| 2249 | case FILTER_CMP_EQ: | 2249 | case TEP_FILTER_CMP_EQ: |
| 2250 | op = "=="; | 2250 | op = "=="; |
| 2251 | /* fall through */ | 2251 | /* fall through */ |
| 2252 | case FILTER_CMP_NE: | 2252 | case TEP_FILTER_CMP_NE: |
| 2253 | if (!op) | 2253 | if (!op) |
| 2254 | op = "!="; | 2254 | op = "!="; |
| 2255 | /* fall through */ | 2255 | /* fall through */ |
| 2256 | case FILTER_CMP_GT: | 2256 | case TEP_FILTER_CMP_GT: |
| 2257 | if (!op) | 2257 | if (!op) |
| 2258 | op = ">"; | 2258 | op = ">"; |
| 2259 | /* fall through */ | 2259 | /* fall through */ |
| 2260 | case FILTER_CMP_LT: | 2260 | case TEP_FILTER_CMP_LT: |
| 2261 | if (!op) | 2261 | if (!op) |
| 2262 | op = "<"; | 2262 | op = "<"; |
| 2263 | /* fall through */ | 2263 | /* fall through */ |
| 2264 | case FILTER_CMP_GE: | 2264 | case TEP_FILTER_CMP_GE: |
| 2265 | if (!op) | 2265 | if (!op) |
| 2266 | op = ">="; | 2266 | op = ">="; |
| 2267 | /* fall through */ | 2267 | /* fall through */ |
| 2268 | case FILTER_CMP_LE: | 2268 | case TEP_FILTER_CMP_LE: |
| 2269 | if (!op) | 2269 | if (!op) |
| 2270 | op = "<="; | 2270 | op = "<="; |
| 2271 | 2271 | ||
| @@ -2289,18 +2289,18 @@ static char *str_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
| 2289 | char *op = NULL; | 2289 | char *op = NULL; |
| 2290 | 2290 | ||
| 2291 | switch (arg->str.type) { | 2291 | switch (arg->str.type) { |
| 2292 | case FILTER_CMP_MATCH: | 2292 | case TEP_FILTER_CMP_MATCH: |
| 2293 | op = "=="; | 2293 | op = "=="; |
| 2294 | /* fall through */ | 2294 | /* fall through */ |
| 2295 | case FILTER_CMP_NOT_MATCH: | 2295 | case TEP_FILTER_CMP_NOT_MATCH: |
| 2296 | if (!op) | 2296 | if (!op) |
| 2297 | op = "!="; | 2297 | op = "!="; |
| 2298 | /* fall through */ | 2298 | /* fall through */ |
| 2299 | case FILTER_CMP_REGEX: | 2299 | case TEP_FILTER_CMP_REGEX: |
| 2300 | if (!op) | 2300 | if (!op) |
| 2301 | op = "=~"; | 2301 | op = "=~"; |
| 2302 | /* fall through */ | 2302 | /* fall through */ |
| 2303 | case FILTER_CMP_NOT_REGEX: | 2303 | case TEP_FILTER_CMP_NOT_REGEX: |
| 2304 | if (!op) | 2304 | if (!op) |
| 2305 | op = "!~"; | 2305 | op = "!~"; |
| 2306 | 2306 | ||
