diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-05-07 19:04:01 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-10-17 22:09:06 -0400 |
commit | 2b54d58d30007168f60b2396de346182b09530dd (patch) | |
tree | b2a9c97476314c806f46a8f9441129674bd68a1e | |
parent | 72e40f59470acd81092f89cacb065d911d1fcec8 (diff) |
parse-events: Modify header to work in C++ programs
Replace keywords "private" and "bool" from parse-events.h to allow
it to be used in C++ programs.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | parse-events.h | 6 | ||||
-rw-r--r-- | parse-filter.c | 32 | ||||
-rw-r--r-- | trace-input.c | 6 |
3 files changed, 22 insertions, 22 deletions
diff --git a/parse-events.h b/parse-events.h index f5cab15..67e7886 100644 --- a/parse-events.h +++ b/parse-events.h | |||
@@ -49,7 +49,7 @@ struct record { | |||
49 | int cpu; | 49 | int cpu; |
50 | int ref_count; | 50 | int ref_count; |
51 | int locked; /* Do not free, even if ref_count is zero */ | 51 | int locked; /* Do not free, even if ref_count is zero */ |
52 | void *private; | 52 | void *r_private; |
53 | #if DEBUG_RECORD | 53 | #if DEBUG_RECORD |
54 | struct record *prev; | 54 | struct record *prev; |
55 | struct record *next; | 55 | struct record *next; |
@@ -106,7 +106,7 @@ struct plugin_option { | |||
106 | char *plugin_alias; | 106 | char *plugin_alias; |
107 | char *description; | 107 | char *description; |
108 | char *value; | 108 | char *value; |
109 | void *private; | 109 | void *p_private; |
110 | int set; | 110 | int set; |
111 | }; | 111 | }; |
112 | 112 | ||
@@ -736,7 +736,7 @@ struct filter_arg_str { | |||
736 | struct filter_arg { | 736 | struct filter_arg { |
737 | enum filter_arg_type type; | 737 | enum filter_arg_type type; |
738 | union { | 738 | union { |
739 | struct filter_arg_boolean bool; | 739 | struct filter_arg_boolean boolean; |
740 | struct filter_arg_field field; | 740 | struct filter_arg_field field; |
741 | struct filter_arg_value value; | 741 | struct filter_arg_value value; |
742 | struct filter_arg_op op; | 742 | struct filter_arg_op op; |
diff --git a/parse-filter.c b/parse-filter.c index 8bef91a..fce0694 100644 --- a/parse-filter.c +++ b/parse-filter.c | |||
@@ -359,7 +359,7 @@ create_arg_item(struct event_format *event, | |||
359 | if (strcmp(token, COMM) != 0) { | 359 | if (strcmp(token, COMM) != 0) { |
360 | /* not a field, Make it false */ | 360 | /* not a field, Make it false */ |
361 | arg->type = FILTER_ARG_BOOLEAN; | 361 | arg->type = FILTER_ARG_BOOLEAN; |
362 | arg->bool.value = FILTER_FALSE; | 362 | arg->boolean.value = FILTER_FALSE; |
363 | break; | 363 | break; |
364 | } | 364 | } |
365 | /* If token is 'COMM' then it is special */ | 365 | /* If token is 'COMM' then it is special */ |
@@ -487,7 +487,7 @@ static int add_right(struct filter_arg *op, struct filter_arg *arg, | |||
487 | free_arg(left); | 487 | free_arg(left); |
488 | free_arg(arg); | 488 | free_arg(arg); |
489 | op->type = FILTER_ARG_BOOLEAN; | 489 | op->type = FILTER_ARG_BOOLEAN; |
490 | op->bool.value = FILTER_FALSE; | 490 | op->boolean.value = FILTER_FALSE; |
491 | break; | 491 | break; |
492 | } | 492 | } |
493 | 493 | ||
@@ -772,7 +772,7 @@ enum filter_vals test_arg(struct filter_arg *parent, struct filter_arg *arg) | |||
772 | 772 | ||
773 | /* bad case */ | 773 | /* bad case */ |
774 | case FILTER_ARG_BOOLEAN: | 774 | case FILTER_ARG_BOOLEAN: |
775 | return FILTER_VAL_FALSE + arg->bool.value; | 775 | return FILTER_VAL_FALSE + arg->boolean.value; |
776 | 776 | ||
777 | /* good cases: */ | 777 | /* good cases: */ |
778 | case FILTER_ARG_STR: | 778 | case FILTER_ARG_STR: |
@@ -871,7 +871,7 @@ static struct filter_arg *collapse_tree(struct filter_arg *arg) | |||
871 | free_arg(arg); | 871 | free_arg(arg); |
872 | arg = allocate_arg(); | 872 | arg = allocate_arg(); |
873 | arg->type = FILTER_ARG_BOOLEAN; | 873 | arg->type = FILTER_ARG_BOOLEAN; |
874 | arg->bool.value = ret == FILTER_VAL_TRUE; | 874 | arg->boolean.value = ret == FILTER_VAL_TRUE; |
875 | } | 875 | } |
876 | 876 | ||
877 | return arg; | 877 | return arg; |
@@ -1116,7 +1116,7 @@ process_event(struct event_format *event, const char *filter_str, | |||
1116 | if (!*parg) { | 1116 | if (!*parg) { |
1117 | *parg = allocate_arg(); | 1117 | *parg = allocate_arg(); |
1118 | (*parg)->type = FILTER_ARG_BOOLEAN; | 1118 | (*parg)->type = FILTER_ARG_BOOLEAN; |
1119 | (*parg)->bool.value = FILTER_FALSE; | 1119 | (*parg)->boolean.value = FILTER_FALSE; |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | return 0; | 1122 | return 0; |
@@ -1139,7 +1139,7 @@ static int filter_event(struct event_filter *filter, | |||
1139 | /* just add a TRUE arg */ | 1139 | /* just add a TRUE arg */ |
1140 | arg = allocate_arg(); | 1140 | arg = allocate_arg(); |
1141 | arg->type = FILTER_ARG_BOOLEAN; | 1141 | arg->type = FILTER_ARG_BOOLEAN; |
1142 | arg->bool.value = FILTER_TRUE; | 1142 | arg->boolean.value = FILTER_TRUE; |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | filter_type = add_filter_type(filter, event->id); | 1145 | filter_type = add_filter_type(filter, event->id); |
@@ -1369,9 +1369,9 @@ static int copy_filter_type(struct event_filter *filter, | |||
1369 | arg = allocate_arg(); | 1369 | arg = allocate_arg(); |
1370 | arg->type = FILTER_ARG_BOOLEAN; | 1370 | arg->type = FILTER_ARG_BOOLEAN; |
1371 | if (strcmp(str, "TRUE") == 0) | 1371 | if (strcmp(str, "TRUE") == 0) |
1372 | arg->bool.value = 1; | 1372 | arg->boolean.value = 1; |
1373 | else | 1373 | else |
1374 | arg->bool.value = 0; | 1374 | arg->boolean.value = 0; |
1375 | 1375 | ||
1376 | filter_type = add_filter_type(filter, event->id); | 1376 | filter_type = add_filter_type(filter, event->id); |
1377 | filter_type->filter = arg; | 1377 | filter_type->filter = arg; |
@@ -1442,8 +1442,8 @@ int pevent_update_trivial(struct event_filter *dest, struct event_filter *source | |||
1442 | arg = filter_type->filter; | 1442 | arg = filter_type->filter; |
1443 | if (arg->type != FILTER_ARG_BOOLEAN) | 1443 | if (arg->type != FILTER_ARG_BOOLEAN) |
1444 | continue; | 1444 | continue; |
1445 | if ((arg->bool.value && type == FILTER_TRIVIAL_FALSE) || | 1445 | if ((arg->boolean.value && type == FILTER_TRIVIAL_FALSE) || |
1446 | (!arg->bool.value && type == FILTER_TRIVIAL_TRUE)) | 1446 | (!arg->boolean.value && type == FILTER_TRIVIAL_TRUE)) |
1447 | continue; | 1447 | continue; |
1448 | 1448 | ||
1449 | event = filter_type->event; | 1449 | event = filter_type->event; |
@@ -1497,10 +1497,10 @@ void pevent_filter_clear_trivial(struct event_filter *filter, | |||
1497 | continue; | 1497 | continue; |
1498 | switch (type) { | 1498 | switch (type) { |
1499 | case FILTER_TRIVIAL_FALSE: | 1499 | case FILTER_TRIVIAL_FALSE: |
1500 | if (filter_type->filter->bool.value) | 1500 | if (filter_type->filter->boolean.value) |
1501 | continue; | 1501 | continue; |
1502 | case FILTER_TRIVIAL_TRUE: | 1502 | case FILTER_TRIVIAL_TRUE: |
1503 | if (!filter_type->filter->bool.value) | 1503 | if (!filter_type->filter->boolean.value) |
1504 | continue; | 1504 | continue; |
1505 | default: | 1505 | default: |
1506 | break; | 1506 | break; |
@@ -1551,10 +1551,10 @@ int pevent_filter_event_has_trivial(struct event_filter *filter, | |||
1551 | 1551 | ||
1552 | switch (type) { | 1552 | switch (type) { |
1553 | case FILTER_TRIVIAL_FALSE: | 1553 | case FILTER_TRIVIAL_FALSE: |
1554 | return !filter_type->filter->bool.value; | 1554 | return !filter_type->filter->boolean.value; |
1555 | 1555 | ||
1556 | case FILTER_TRIVIAL_TRUE: | 1556 | case FILTER_TRIVIAL_TRUE: |
1557 | return filter_type->filter->bool.value; | 1557 | return filter_type->filter->boolean.value; |
1558 | default: | 1558 | default: |
1559 | return 1; | 1559 | return 1; |
1560 | } | 1560 | } |
@@ -1783,7 +1783,7 @@ static int test_filter(struct event_format *event, | |||
1783 | switch (arg->type) { | 1783 | switch (arg->type) { |
1784 | case FILTER_ARG_BOOLEAN: | 1784 | case FILTER_ARG_BOOLEAN: |
1785 | /* easy case */ | 1785 | /* easy case */ |
1786 | return arg->bool.value; | 1786 | return arg->boolean.value; |
1787 | 1787 | ||
1788 | case FILTER_ARG_OP: | 1788 | case FILTER_ARG_OP: |
1789 | return test_op(event, arg, record); | 1789 | return test_op(event, arg, record); |
@@ -2147,7 +2147,7 @@ static char *arg_to_str(struct event_filter *filter, struct filter_arg *arg) | |||
2147 | switch (arg->type) { | 2147 | switch (arg->type) { |
2148 | case FILTER_ARG_BOOLEAN: | 2148 | case FILTER_ARG_BOOLEAN: |
2149 | str = malloc_or_die(6); | 2149 | str = malloc_or_die(6); |
2150 | if (arg->bool.value) | 2150 | if (arg->boolean.value) |
2151 | strcpy(str, "TRUE"); | 2151 | strcpy(str, "TRUE"); |
2152 | else | 2152 | else |
2153 | strcpy(str, "FALSE"); | 2153 | strcpy(str, "FALSE"); |
diff --git a/trace-input.c b/trace-input.c index a567754..e3157a7 100644 --- a/trace-input.c +++ b/trace-input.c | |||
@@ -705,8 +705,8 @@ static void free_page(struct tracecmd_input *handle, int cpu) | |||
705 | 705 | ||
706 | static void __free_record(struct record *record) | 706 | static void __free_record(struct record *record) |
707 | { | 707 | { |
708 | if (record->private) { | 708 | if (record->r_private) { |
709 | struct page *page = record->private; | 709 | struct page *page = record->r_private; |
710 | remove_record(page, record); | 710 | remove_record(page, record); |
711 | __free_page(page->handle, page); | 711 | __free_page(page->handle, page); |
712 | } | 712 | } |
@@ -1753,7 +1753,7 @@ read_again: | |||
1753 | handle->cpu_data[cpu].next = record; | 1753 | handle->cpu_data[cpu].next = record; |
1754 | 1754 | ||
1755 | record->record_size = handle->cpu_data[cpu].index - index; | 1755 | record->record_size = handle->cpu_data[cpu].index - index; |
1756 | record->private = page; | 1756 | record->r_private = page; |
1757 | add_record(page, record); | 1757 | add_record(page, record); |
1758 | page->ref_count++; | 1758 | page->ref_count++; |
1759 | 1759 | ||