X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Flttvwindowtraces.c;h=caa84cee813fe146f03e45f6433118f794f46ddf;hb=ec7a5af61127aa50a1839eee5be99ce53494c57b;hp=eb449f03f964daf94242d0ab39a2caa41c4122a1;hpb=f9240312451df4ff9fc7b0d4cfb159a03d7dc2c3;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c index eb449f03..caa84cee 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/lttvwindowtraces.c @@ -106,9 +106,10 @@ __EXPORT LttvTrace *lttvwindowtraces_get_trace(guint num) LttvAttributeValue value; gboolean is_named; - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), - LTTV_TRACES))); + LTTV_TRACES)); + g_assert(attribute); type = lttv_iattribute_get(LTTV_IATTRIBUTE(attribute), num, &name, &value, &is_named); @@ -126,11 +127,11 @@ __EXPORT guint lttvwindowtraces_get_number() { LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *attribute; - LttvAttributeValue value; - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), - LTTV_TRACES))); + LTTV_TRACES)); + g_assert(attribute); return ( lttv_iattribute_get_number(LTTV_IATTRIBUTE(attribute)) ); } @@ -142,21 +143,23 @@ void lttvwindowtraces_add_trace(LttvTrace *trace) LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *attribute; LttvAttributeValue value; - guint num; struct stat buf; gchar attribute_path[PATH_MAX]; + int result; + gboolean result_b; if(stat(g_quark_to_string(ltt_trace_name(lttv_trace(trace))), &buf)) { g_warning("lttvwindowtraces_add_trace: Trace %s not found", g_quark_to_string(ltt_trace_name(lttv_trace(trace)))); return; } - g_assert( - snprintf(attribute_path, PATH_MAX, "%llu:%llu", buf.st_dev, buf.st_ino) >= 0); + result = snprintf(attribute_path, PATH_MAX, "%llu:%llu", buf.st_dev, buf.st_ino); + g_assert(result >= 0); - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), - LTTV_TRACES))); + LTTV_TRACES)); + g_assert(attribute); value = lttv_attribute_add(attribute, g_quark_from_string(attribute_path), @@ -170,28 +173,33 @@ void lttvwindowtraces_add_trace(LttvTrace *trace) //LttvTracesetContextPosition *sync_position; attribute = lttv_trace_attribute(trace); - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result_b = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_COMPUTATION_TRACESET, LTTV_POINTER, - &value)); + &value); + g_assert(result_b); + ts = lttv_traceset_new(); *(value.v_pointer) = ts; lttv_traceset_add(ts,trace); - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result_b = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_COMPUTATION_TRACESET_CONTEXT, LTTV_POINTER, - &value)); + &value); + g_assert(result_b); + tss = g_object_new(LTTV_TRACESET_STATS_TYPE, NULL); *(value.v_pointer) = tss; lttv_context_init(LTTV_TRACESET_CONTEXT(tss), ts); #if 0 - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result_b = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_COMPUTATION_SYNC_POSITION, LTTV_POINTER, - &value)); + &value); + g_assert(result_b); sync_position = lttv_traceset_context_position_new(); *(value.v_pointer) = sync_position; @@ -221,10 +229,12 @@ void lttvwindowtraces_remove_trace(LttvTrace *trace) LttvAttribute *attribute; LttvAttributeValue value; guint i; + gboolean result; - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), - LTTV_TRACES))); + LTTV_TRACES)); + g_assert(attribute); for(i=0;imodule_name))); + bg_req->module_name)); + g_assert(module_attribute); type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute), LTTV_BEFORE_REQUEST, @@ -1297,15 +1352,17 @@ gboolean lttvwindowtraces_process_pending_requests(LttvTrace *trace) /* Get after request hook */ LttvAttribute *module_attribute; - g_assert(module_attribute = + module_attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir( LTTV_IATTRIBUTE(g_attribute), - LTTV_COMPUTATION))); + LTTV_COMPUTATION)); + g_assert(module_attribute); - g_assert(module_attribute = + module_attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir( LTTV_IATTRIBUTE(module_attribute), - bg_req->module_name))); + bg_req->module_name)); + g_assert(module_attribute); type = lttv_iattribute_get_by_name(LTTV_IATTRIBUTE(module_attribute), LTTV_AFTER_REQUEST, @@ -1459,92 +1516,108 @@ void lttvwindowtraces_register_computation_hooks(LttvAttributeName module_name, LttvAttribute *g_attribute = lttv_global_attributes(); LttvAttribute *attribute; LttvAttributeValue value; + gboolean result; - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(g_attribute), - LTTV_COMPUTATION))); + LTTV_COMPUTATION)); + g_assert(attribute); - g_assert(attribute = + attribute = LTTV_ATTRIBUTE(lttv_iattribute_find_subdir(LTTV_IATTRIBUTE(attribute), - module_name))); + module_name)); + g_assert(attribute); - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_BEFORE_CHUNK_TRACESET, LTTV_POINTER, - &value)); + &value); + g_assert(result); + *(value.v_pointer) = before_chunk_traceset; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_BEFORE_CHUNK_TRACE, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = before_chunk_trace; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_BEFORE_CHUNK_TRACEFILE, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = before_chunk_tracefile; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_AFTER_CHUNK_TRACESET, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = after_chunk_traceset; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_AFTER_CHUNK_TRACE, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = after_chunk_trace; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_AFTER_CHUNK_TRACEFILE, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = after_chunk_tracefile; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_BEFORE_REQUEST, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = before_request; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_AFTER_REQUEST, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = after_request; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_EVENT_HOOK, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = event_hook; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_EVENT_HOOK_BY_ID, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = event_hook_by_id; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_HOOK_ADDER, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = hook_adder; - g_assert(lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), + result = lttv_iattribute_find(LTTV_IATTRIBUTE(attribute), LTTV_HOOK_REMOVER, LTTV_POINTER, - &value)); + &value); + g_assert(result); *(value.v_pointer) = hook_remover; } /** - * It removes all the requests than can be currently processed by the + * It removes all the requests that can be currently processed by the * background computation algorithm for all the traces (list_in and list_out). * * Leaves the flag to in_progress or none.. depending if current or queue @@ -1555,20 +1628,22 @@ void lttvwindowtraces_register_computation_hooks(LttvAttributeName module_name, void lttvwindowtraces_unregister_requests(LttvAttributeName module_name) { guint i; + gboolean result; for(i=0;i