From bd523c6f56ce1d9cdf97ac6334f6d68d44822a7d Mon Sep 17 00:00:00 2001 From: siboud Date: Mon, 11 Apr 2005 13:35:38 +0000 Subject: [PATCH] textFilter: added option to list filter commands git-svn-id: http://ltt.polymtl.ca/svn@925 04897980-b3bd-0310-b5e0-8ef037075253 --- .../poly/lttv/modules/text/textFilter.c | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/ltt/branches/poly/lttv/modules/text/textFilter.c b/ltt/branches/poly/lttv/modules/text/textFilter.c index 488635ca..20b769cf 100644 --- a/ltt/branches/poly/lttv/modules/text/textFilter.c +++ b/ltt/branches/poly/lttv/modules/text/textFilter.c @@ -63,8 +63,7 @@ static LttvHooks /** * 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) { @@ -98,8 +97,7 @@ 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) { @@ -122,6 +120,43 @@ 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.category (string)\n"); + g_print("event.time (double)\n"); + g_print("event.tsc (integer)\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("trace.insertion_time (double)\n"); + g_print("trace.process_name (string)\n"); + g_print("trace.execution_mode (string)\n"); + g_print("trace.execution_submode (string)\n"); + g_print("trace.process_status (string)\n"); + g_print("trace.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 */ @@ -151,6 +186,11 @@ static void init() { "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); + } /** @@ -163,6 +203,8 @@ static void destroy() { lttv_option_remove("filename"); + lttv_option_remove("list"); + LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); -- 2.34.1