X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Fmodules%2Ftext%2FprecomputeState.c;h=718dd4c54a847e00382f44eb0310ef2bdd3faded;hb=b9ce0bad7daf7c0a2333c91fdb1e35d602afe17f;hp=f23937b97544db3f9a1a75767158c34de7e3d91b;hpb=f61f4dca50e13aa52b1ca3941c8f420848f4353f;p=lttv.git diff --git a/lttv/modules/text/precomputeState.c b/lttv/modules/text/precomputeState.c index f23937b9..718dd4c5 100644 --- a/lttv/modules/text/precomputeState.c +++ b/lttv/modules/text/precomputeState.c @@ -13,8 +13,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. */ /* The text dump facility needs to print headers before the trace set and @@ -40,10 +40,6 @@ #include static gboolean - a_field_names, - a_state, - a_cpu_stats, - a_process_stats, a_raw; static char @@ -91,7 +87,6 @@ static gboolean write_traceset_header(void *hook_data, void *call_data) static gboolean write_traceset_footer(void *hook_data, void *call_data) { - LttvTracesetContext *tc = (LttvTracesetContext *)call_data; GQuark q; const gchar *string; @@ -149,7 +144,6 @@ static gboolean write_trace_header(void *hook_data, void *call_data) static gboolean write_trace_footer(void *hook_data, void *call_data) { - LttvTraceContext *tc = (LttvTraceContext *)call_data; if(a_raw) { @@ -165,27 +159,17 @@ static int for_each_event(void *hook_data, void *call_data) { guint *event_count = (guint*)hook_data; - LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); - LttvTracefileContext *tfc = (LttvTracefileContext *)call_data; LttvTracefileState *tfs = (LttvTracefileState *)call_data; - LttEvent *e; - - LttvAttributeValue value_filter; - /* Only save at LTTV_STATE_SAVE_INTERVAL */ if(likely((*event_count)++ < LTTV_STATE_SAVE_INTERVAL)) return FALSE; else *event_count = 0; - guint cpu = tfs->cpu; LttvTraceState *ts = (LttvTraceState*)tfc->t_context; - LttvProcessState *process = ts->running_process[cpu]; - - e = ltt_tracefile_get_event(tfc->tf); if(a_raw) { lttv_state_write_raw(ts, tfs->parent.timestamp, a_file); @@ -202,6 +186,7 @@ static void init() LttvAttributeValue value; LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); + gboolean retval; g_info("Init precomputeState.c"); @@ -224,29 +209,34 @@ static void init() "Raw binary", LTTV_OPT_NONE, &a_raw, NULL, NULL); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/event", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "hooks/event", + LTTV_POINTER, &value); + g_assert(retval); g_assert((event_hook = *(value.v_pointer)) != NULL); lttv_hooks_add(event_hook, for_each_event, &a_event_count, LTTV_PRIO_DEFAULT); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/before", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/before", + LTTV_POINTER, &value); + g_assert(retval); g_assert((before_trace = *(value.v_pointer)) != NULL); lttv_hooks_add(before_trace, write_trace_header, NULL, LTTV_PRIO_DEFAULT); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/trace/after", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "hooks/trace/after", + LTTV_POINTER, &value); + g_assert(retval); g_assert((after_trace = *(value.v_pointer)) != NULL); lttv_hooks_add(after_trace, write_trace_footer, NULL, LTTV_PRIO_DEFAULT); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/before", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/before", + LTTV_POINTER, &value); + g_assert(retval); g_assert((before_traceset = *(value.v_pointer)) != NULL); lttv_hooks_add(before_traceset, write_traceset_header, NULL, LTTV_PRIO_DEFAULT); - g_assert(lttv_iattribute_find_by_path(attributes, "hooks/traceset/after", - LTTV_POINTER, &value)); + retval= lttv_iattribute_find_by_path(attributes, "hooks/traceset/after", + LTTV_POINTER, &value); + g_assert(retval); g_assert((after_traceset = *(value.v_pointer)) != NULL); lttv_hooks_add(after_traceset, write_traceset_footer, NULL, LTTV_PRIO_DEFAULT);