projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix hooks to return a gint instead of a gboolean : makes returning 2 possible
[lttv.git]
/
ltt
/
branches
/
poly
/
lttv
/
lttv
/
filter.c
diff --git
a/ltt/branches/poly/lttv/lttv/filter.c
b/ltt/branches/poly/lttv/lttv/filter.c
index 8ab84717ecb58e5dd7f7f80f701ffa847073ac7f..a1cfc0dcbd6dc86e6196ba891c295073e5d199a4 100644
(file)
--- a/
ltt/branches/poly/lttv/lttv/filter.c
+++ b/
ltt/branches/poly/lttv/lttv/filter.c
@@
-31,6
+31,7
@@
* LttvTracefileContext{}
* |->event\
* | |->name (String, converted to GQuark)
* LttvTracefileContext{}
* |->event\
* | |->name (String, converted to GQuark)
+ * | |->facility (String, converted to GQuark)
* | |->category (String, not yet implemented)
* | |->time (LttTime)
* | |->tsc (LttCycleCount --> uint64)
* | |->category (String, not yet implemented)
* | |->time (LttTime)
* | |->tsc (LttCycleCount --> uint64)
@@
-76,6
+77,7
@@
#include <lttv/filter.h>
#include <ltt/trace.h>
#include <ltt/type.h>
#include <lttv/filter.h>
#include <ltt/trace.h>
#include <ltt/type.h>
+#include <ltt/facility.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
@@
-207,6
+209,9
@@
lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) {
if(!g_strcasecmp(f->str,"name") ) {
se->field = LTTV_FILTER_EVENT_NAME;
}
if(!g_strcasecmp(f->str,"name") ) {
se->field = LTTV_FILTER_EVENT_NAME;
}
+ else if(!g_strcasecmp(f->str,"facility") ) {
+ se->field = LTTV_FILTER_EVENT_FACILITY;
+ }
else if(!g_strcasecmp(f->str,"category") ) {
/*
* FIXME: Category not yet functional in lttv
else if(!g_strcasecmp(f->str,"category") ) {
/*
* FIXME: Category not yet functional in lttv
@@
-259,6
+264,7
@@
lttv_simple_expression_assign_operator(LttvSimpleExpression* se, LttvExpressionO
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_EVENT_FACILITY:
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
@@
-418,6
+424,7
@@
lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
case LTTV_FILTER_TRACEFILE_NAME:
case LTTV_FILTER_STATE_P_NAME:
case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_EVENT_FACILITY:
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
case LTTV_FILTER_STATE_EX_MODE:
case LTTV_FILTER_STATE_EX_SUBMODE:
case LTTV_FILTER_STATE_P_STATUS:
@@
-535,6
+542,7
@@
lttv_struct_type(gint ft) {
return LTTV_FILTER_STATE;
break;
case LTTV_FILTER_EVENT_NAME:
return LTTV_FILTER_STATE;
break;
case LTTV_FILTER_EVENT_NAME:
+ case LTTV_FILTER_EVENT_FACILITY:
case LTTV_FILTER_EVENT_CATEGORY:
case LTTV_FILTER_EVENT_TIME:
case LTTV_FILTER_EVENT_TSC:
case LTTV_FILTER_EVENT_CATEGORY:
case LTTV_FILTER_EVENT_TIME:
case LTTV_FILTER_EVENT_TSC:
@@
-1593,9
+1601,9
@@
lttv_filter_update(LttvFilter* filter) {
#endif
/* debug */
#endif
/* debug */
- g_
print
("+++++++++++++++ BEGIN PRINT ++++++++++++++++\n");
+ g_
debug
("+++++++++++++++ BEGIN PRINT ++++++++++++++++\n");
lttv_print_tree(filter->head,0) ;
lttv_print_tree(filter->head,0) ;
- g_
print
("+++++++++++++++ END PRINT ++++++++++++++++++\n");
+ g_
debug
("+++++++++++++++ END PRINT ++++++++++++++++++\n");
/* success */
return TRUE;
/* success */
return TRUE;
@@
-1923,7
+1931,15
@@
lttv_filter_tree_parse_branch(
return se->op((gpointer)&quark,v);
}
break;
return se->op((gpointer)&quark,v);
}
break;
-
+ case LTTV_FILTER_EVENT_FACILITY:
+ if(event == NULL) return TRUE;
+ else {
+ LttFacility* fac;
+ fac = ltt_event_facility(event);
+ GQuark quark = ltt_facility_name(fac);
+ return se->op((gpointer)&quark,v);
+ }
+ break;
case LTTV_FILTER_EVENT_CATEGORY:
/*
* TODO: Not yet implemented
case LTTV_FILTER_EVENT_CATEGORY:
/*
* TODO: Not yet implemented
@@
-1975,22
+1991,22
@@
lttv_filter_tree_parse_branch(
void
lttv_print_tree(const LttvFilterTree* t, const int count) {
void
lttv_print_tree(const LttvFilterTree* t, const int count) {
- g_
print
("node:%p lchild:%p rchild:%p depth:%i\n",t, //t->l_child.t,t->r_child.t);
+ g_
debug
("node:%p lchild:%p rchild:%p depth:%i\n",t, //t->l_child.t,t->r_child.t);
(t->left==LTTV_TREE_NODE)?t->l_child.t:NULL,
(t->right==LTTV_TREE_NODE)?t->r_child.t:NULL,
count);
(t->left==LTTV_TREE_NODE)?t->l_child.t:NULL,
(t->right==LTTV_TREE_NODE)?t->r_child.t:NULL,
count);
- g_
print
("logic operator: %s\n",(t->node&1)?"OR":((t->node&2)?"AND":((t->node&4)?"NOT":((t->node&8)?"XOR":"IDLE"))));
- g_
print
("|-> left branch %p is a %s\n",t->l_child.t,(t->left==LTTV_TREE_NODE)?"NODE":((t->left==LTTV_TREE_LEAF)?"LEAF":"IDLE"));
+ g_
debug
("logic operator: %s\n",(t->node&1)?"OR":((t->node&2)?"AND":((t->node&4)?"NOT":((t->node&8)?"XOR":"IDLE"))));
+ g_
debug
("|-> left branch %p is a %s\n",t->l_child.t,(t->left==LTTV_TREE_NODE)?"NODE":((t->left==LTTV_TREE_LEAF)?"LEAF":"IDLE"));
if(t->left == LTTV_TREE_LEAF) {
if(t->left == LTTV_TREE_LEAF) {
- g_
print
("| |-> field type number: %i\n",t->l_child.leaf->field);
- g_
print
("| |-> offset is: %i\n",t->l_child.leaf->offset);
- g_
print
("| |-> operator function is: %p\n",t->l_child.leaf->op);
+ g_
debug
("| |-> field type number: %i\n",t->l_child.leaf->field);
+ g_
debug
("| |-> offset is: %i\n",t->l_child.leaf->offset);
+ g_
debug
("| |-> operator function is: %p\n",t->l_child.leaf->op);
}
}
- g_
print
("|-> right branch %p is a %s\n",t->r_child.t,(t->right==LTTV_TREE_NODE)?"NODE":((t->right==LTTV_TREE_LEAF)?"LEAF":"IDLE"));
+ g_
debug
("|-> right branch %p is a %s\n",t->r_child.t,(t->right==LTTV_TREE_NODE)?"NODE":((t->right==LTTV_TREE_LEAF)?"LEAF":"IDLE"));
if(t->right == LTTV_TREE_LEAF) {
if(t->right == LTTV_TREE_LEAF) {
- g_
print
("| |-> field type number: %i\n",t->r_child.leaf->field);
- g_
print
("| |-> offset is: %i\n",t->r_child.leaf->offset);
- g_
print
("| |-> operator function is: %p\n",t->r_child.leaf->op);
+ g_
debug
("| |-> field type number: %i\n",t->r_child.leaf->field);
+ g_
debug
("| |-> offset is: %i\n",t->r_child.leaf->offset);
+ g_
debug
("| |-> operator function is: %p\n",t->r_child.leaf->op);
}
if(t->left == LTTV_TREE_NODE) lttv_print_tree(t->l_child.t,count+1);
}
if(t->left == LTTV_TREE_NODE) lttv_print_tree(t->l_child.t,count+1);
This page took
0.024378 seconds
and
4
git commands to generate.