* file containing filtering expressions.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <lttv/lttv.h>
#include <lttv/option.h>
#include <lttv/module.h>
/* 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
/**
* filters the file input from user
- * @param hook_data the hook data
- * @return success/failure of operation
+ * @param hook_data the hook data, unused
*/
void filter_analyze_file(void *hook_data) {
/**
* filters the string input from user
- * @param hook_data the hook data
- * @return success/failure of operation
+ * @param hook_data the hook data, unused
*/
void filter_analyze_string(void *hook_data) {
}
+/**
+ * Output all filter commands on console
+ * @param hook_data the hook data
+ */
+void filter_list_commands(void *hook_data) {
+
+ g_print("[field] [op] [value]\n\n");
+
+ g_print("*** Possible fields ***\n");
+ g_print("event.name (string)\n");
+ g_print("event.facility (string)\n");
+ 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");
+ g_print("state.ppid (integer)\n");
+ g_print("state.creation_time (double)\n");
+ g_print("state.insertion_time (double)\n");
+ g_print("state.process_name (string)\n");
+ g_print("state.thread_brand (string)\n");
+ g_print("state.execution_mode (string)\n");
+ g_print("state.execution_submode (string)\n");
+ g_print("state.process_status (string)\n");
+ g_print("state.cpu (string)\n\n");
+
+ g_print("*** Possible operators ***\n");
+ g_print("equal '='\n");
+ g_print("not equal '!='\n");
+ g_print("greater '>'\n");
+ g_print("greater or equal '>='\n");
+ g_print("lower '<'\n");
+ g_print("lower or equal '<='\n");
+
+ g_print("*** Possible values ***\n");
+ g_print("string, integer, double");
+}
+
/**
* initialize the new module
*/
"file name",
LTTV_OPT_STRING, &a_file_name, filter_analyze_file, NULL);
+ lttv_option_add("list", 'l',
+ "list all possible filter commands for module",
+ "list commands",
+ LTTV_OPT_NONE, NULL, filter_list_commands, NULL);
+
}
/**
lttv_option_remove("filename");
+ lttv_option_remove("list");
+
LttvAttributeValue value;
LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());