X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Ftext%2FtextFilter.c;h=7dcca632ae7c53701cf17ee4c5433e90c8d05d57;hb=6da3640c5dfff6319edcb000391cb2fdfa5abe56;hp=00fed5407c136d592e4bc36ea5ac02c9c320f62a;hpb=852f16bbf89d5b2dea6bf887d5f2652cad07bd75;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/text/textFilter.c b/ltt/branches/poly/lttv/modules/text/textFilter.c index 00fed540..7dcca632 100644 --- a/ltt/branches/poly/lttv/modules/text/textFilter.c +++ b/ltt/branches/poly/lttv/modules/text/textFilter.c @@ -16,11 +16,19 @@ * MA 02111-1307, USA. */ -/* - * The text filter facility will prompt for user filter option - * and transmit them to the lttv core +/*! \file lttv/modules/text/textFilter.c + * \brief Textual prompt for user filtering expression. + * + * The text filter facility will prompt for user filter option + * and transmit them to the lttv core. User can either specify + * a filtering string with the command line or/and specify a + * file containing filtering expressions. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -59,13 +67,10 @@ 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) { -// g_print("textFilter::filter_analyze_file\n"); - LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); @@ -96,13 +101,10 @@ 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) { -// g_print("textFilter::filter_analyze_string\n"); - LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); @@ -122,13 +124,49 @@ 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("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 */ static void init() { -// g_print("textFilter::init()\n"); /* debug */ - LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); @@ -153,6 +191,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); + } /** @@ -165,6 +208,8 @@ static void destroy() { lttv_option_remove("filename"); + lttv_option_remove("list"); + LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes());