update tracecontrol
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 14 Mar 2006 15:11:58 +0000 (15:11 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 14 Mar 2006 15:11:58 +0000 (15:11 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1707 04897980-b3bd-0310-b5e0-8ef037075253

ltt/branches/poly/lttv/lttv/filter.c
ltt/branches/poly/lttv/lttv/filter.h
ltt/branches/poly/lttv/modules/gui/tracecontrol/tracecontrol.c
ltt/branches/poly/lttv/modules/text/textFilter.c

index 567b54f0a797d7094f7e8a614e48fe2997848540..4025e4da5d8494d024228ac343e7016445c5410d 100644 (file)
  *  | |->time (LttTime)
  *  | |->tsc (LttCycleCount --> uint64)
  *  | |->fields
- *  |   |->"event name"
- *  |     |->"field name"
- *  |       |->"sub-field name"
- *  |         |->...
- *  |           |->"leaf-field name" (field type)
+ *  |   |->"facility_name
+ *  |     |->"event name"
+ *  |       |->"field name"
+ *  |         |->"sub-field name"
+ *  |           |->...
+ *  |             |->"leaf-field name" (field type)
  *  |->tracefile
  *  | |->name (String, converted to GQuark)
  *  |->trace
@@ -204,6 +205,7 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) {
      *  event.category
      *  event.time
      *  event.tsc
+     *  event.field
      */
     g_string_free(f,TRUE);
     f=g_ptr_array_remove_index(fp,0);
@@ -225,8 +227,11 @@ lttv_simple_expression_assign_field(GPtrArray* fp, LttvSimpleExpression* se) {
     else if(!g_strcasecmp(f->str,"tsc") ) {
       se->field = LTTV_FILTER_EVENT_TSC;
     }
-    else {  /* core.xml specified options */
+    else if(!g_strcasecmp(f->str,"field") ) {
       se->field = LTTV_FILTER_EVENT_FIELD;
+
+    } else {
+      g_warning("Unknown event filter subtype %s", f->str);
     }
   } else {
     g_string_free(f,TRUE);
@@ -433,7 +438,7 @@ lttv_simple_expression_assign_value(LttvSimpleExpression* se, char* value) {
      case LTTV_FILTER_STATE_EX_SUBMODE:
      case LTTV_FILTER_STATE_P_STATUS:
       // se->value.v_string = value;
-       se->value.v_uint32 = g_quark_from_string(value);
+       se->value.v_quark = g_quark_from_string(value);
        g_free(value);
        break;
      /* 
@@ -657,8 +662,7 @@ gboolean lttv_apply_op_eq_string(const gpointer v1, LttvFieldValue v2) {
  */
 gboolean lttv_apply_op_eq_quark(const gpointer v1, LttvFieldValue v2) {
   GQuark* r = (GQuark*) v1;
-//  g_print("v1:%i v2:%i\n",*r,v2.v_uint32);
-  return (*r == v2.v_uint32);
+  return (*r == v2.v_quark);
 }
 
 /**
@@ -770,7 +774,7 @@ gboolean lttv_apply_op_ne_string(const gpointer v1, LttvFieldValue v2) {
  */
 gboolean lttv_apply_op_ne_quark(const gpointer v1, LttvFieldValue v2) {
   GQuark* r = (GQuark*) v1;
-  return (*r != v2.v_uint32);
+  return (*r != v2.v_quark);
 }
 
 
@@ -1952,9 +1956,6 @@ lttv_filter_tree_parse_branch(
         case LTTV_FILTER_STATE_CPU:
             if(context == NULL) return TRUE;
             else {
-              /* FIXME: not sure of that one  Mathieu : fixed.*/
- //             GQuark quark = ((LttvTracefileState*)context)->cpu_name;
- //                return se->op((gpointer)&quark,v);
               if(state == NULL) return TRUE;
               else return se->op((gpointer)&state->cpu,v);
             }
index fcc2d78c005c635fe7d85290e7c7fa6109b59547..d93a15512fd213045060ad5d0c940d8c371e6e03 100644 (file)
@@ -113,7 +113,7 @@ enum _LttvFieldType {
   LTTV_FILTER_EVENT_CATEGORY,         /**< FIXME: not implemented */
   LTTV_FILTER_EVENT_TIME,             /**< event.time (double) */
   LTTV_FILTER_EVENT_TSC,              /**< event.tsc (double) */
-  LTTV_FILTER_EVENT_FIELD,            /**< dynamic field, specified in core.xml */
+  LTTV_FILTER_EVENT_FIELD,            /**< dynamic field, specified in facility */
   LTTV_FILTER_UNDEFINED               /**< undefined field */
 };
   
@@ -147,6 +147,7 @@ enum _LttvExpressionOp
  *  'operators' functions
  */
 union _LttvFieldValue {
+  GQuark  v_quark;                    /**< GQuark */
   guint64 v_uint64;                   /**< unsigned int of 64 bytes */
   guint32 v_uint32;                   /**< unsigned int of 32 bytes */
   guint16 v_uint16;                   /**< unsigned int of 16 bytes */
index e3f1ff8565f5d54ce40f2804cacc93ebda12acbb..148a452b8b03d3edd70764556dbc799a53e795b4 100644 (file)
@@ -342,7 +342,7 @@ gui_control(Tab *tab)
   tcd->fac_path_label = gtk_label_new("path to facilities:");
   gtk_widget_show (tcd->fac_path_label);
   tcd->fac_path_entry = gtk_entry_new();
-  gtk_entry_set_text(GTK_ENTRY(tcd->fac_path_entry),PACKAGE_DATA_DIR "/" PACKAGE "/facilities");
+  gtk_entry_set_text(GTK_ENTRY(tcd->fac_path_entry),PACKAGE_DATA_DIR "/" "ltt-control" "/facilities");
   gtk_widget_set_size_request(tcd->fac_path_entry, 250, -1);
   gtk_widget_show (tcd->fac_path_entry);
   gtk_table_attach( GTK_TABLE(tcd->main_box),tcd->fac_path_label,0,2,14,15,GTK_FILL,GTK_FILL,2,2);
index 7dcca632ae7c53701cf17ee4c5433e90c8d05d57..41e478d2d330cc632ae443d7ad41e57eed39681f 100644 (file)
 /* Insert the hooks before and after each trace and tracefile, and for each
    event. Print a global header. */
 
-/*
- *  YET TO BE ANSWERED !
- *  - why does this module need dependency with batchAnalysis ?
- */
-
 /*
  *  TODO
  *  - specify wich hook function will be used to call the core filter
@@ -138,6 +133,7 @@ void filter_list_commands(void *hook_data) {
   g_print("event.category (string)\n");
   g_print("event.time (double)\n");
   g_print("event.tsc (integer)\n");
+  g_print("event.field.facility_name.event_name.field_name.subfield_name (field_type)\n");
   g_print("tracefile.name (string)\n");
   g_print("trace.name (string)\n");
   g_print("state.pid (integer)\n");
This page took 0.0274 seconds and 4 git commands to generate.