X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Fmodules%2Ftext%2FtextFilter.c;h=2fbd670391409fe97f74a4ac8a00916c00efe680;hb=b9ce0bad7daf7c0a2333c91fdb1e35d602afe17f;hp=27425201dd9a246741031655165dc34a990adbbf;hpb=f61f4dca50e13aa52b1ca3941c8f420848f4353f;p=lttv.git diff --git a/lttv/modules/text/textFilter.c b/lttv/modules/text/textFilter.c index 27425201..2fbd6703 100644 --- a/lttv/modules/text/textFilter.c +++ b/lttv/modules/text/textFilter.c @@ -12,8 +12,8 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, - * MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. */ /*! \file lttv/modules/text/textFilter.c @@ -67,6 +67,7 @@ void filter_analyze_file(void *hook_data) { LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); + gboolean retval; /* * User may specify filtering options through static file @@ -82,15 +83,15 @@ void filter_analyze_file(void *hook_data) { g_file_get_contents(a_file_name,&a_file_content,NULL,NULL); - g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression", - LTTV_POINTER, &value)); - - if(((GString*)*(value.v_pointer))->len != 0) - g_string_append_c((GString*)*(value.v_pointer),'&'); - g_string_append_c((GString*)*(value.v_pointer),'('); - g_string_append((GString*)*(value.v_pointer),a_file_content); - g_string_append_c((GString*)*(value.v_pointer),')'); - + retval= lttv_iattribute_find_by_path(attributes, "filter/expression", + LTTV_POINTER, &value); + g_assert(retval); + + if (((GString*)*(value.v_pointer))->len != 0) + g_string_append_c((GString*)*(value.v_pointer),'&'); + g_string_append_c((GString*)*(value.v_pointer),'('); + g_string_append((GString*)*(value.v_pointer),a_file_content); + g_string_append_c((GString*)*(value.v_pointer),')'); } /** @@ -102,21 +103,22 @@ void filter_analyze_string(void *hook_data) { LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); - + gboolean retval; + /* * User may specify filtering options through static file * and/or command line string. From these sources, an * option string is rebuilded and sent to the filter core */ - g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression", - LTTV_POINTER, &value)); - - if(((GString*)*(value.v_pointer))->len != 0) - g_string_append_c((GString*)*(value.v_pointer),'&'); - g_string_append_c((GString*)*(value.v_pointer),'('); - g_string_append((GString*)*(value.v_pointer),a_string); - g_string_append_c((GString*)*(value.v_pointer),')'); - + retval= lttv_iattribute_find_by_path(attributes, "filter/expression", + LTTV_POINTER, &value); + g_assert(retval); + + if (((GString*)*(value.v_pointer))->len != 0) + g_string_append_c((GString*)*(value.v_pointer),'&'); + g_string_append_c((GString*)*(value.v_pointer),'('); + g_string_append((GString*)*(value.v_pointer),a_string); + g_string_append_c((GString*)*(value.v_pointer),')'); } /** @@ -142,7 +144,6 @@ void filter_list_commands(void *hook_data) { 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"); @@ -168,9 +169,11 @@ static void init() { LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); + gboolean retval; - g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "filter/expression", + LTTV_POINTER, &value); + g_assert(retval); *(value.v_pointer) = g_string_new(""); @@ -200,6 +203,8 @@ static void init() { * Destroy the current module */ static void destroy() { + gboolean retval; + g_info("Destroy textFilter"); lttv_option_remove("expression"); @@ -212,8 +217,9 @@ static void destroy() { LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); - g_assert(lttv_iattribute_find_by_path(attributes, "filter/expression", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "filter/expression", + LTTV_POINTER, &value); + g_assert(retval); g_string_free((GString*)*(value.v_pointer),TRUE);