From: Pierre-Marc Fournier Date: Fri, 24 Jul 2009 20:45:52 +0000 (-0400) Subject: depanalysis: fix segfault, remove some warnings X-Git-Tag: v0.12.20~62^2 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b1d180419ba4a3dffce59a559d0750eac9aa9261;p=lttv.git depanalysis: fix segfault, remove some warnings --- diff --git a/lttv/modules/text/depanalysis.c b/lttv/modules/text/depanalysis.c index ca926174..0c984711 100644 --- a/lttv/modules/text/depanalysis.c +++ b/lttv/modules/text/depanalysis.c @@ -297,6 +297,14 @@ static void delete_data_val(struct process_with_state *pwstate) // g_free(pwstate); } +inline void print_time(LttTime t) +{ + //printf("%lu.%lu", t.tv_sec, t.tv_nsec); + double f; + f = (double)t.tv_sec + ((double)t.tv_nsec)/1000000000.0; + printf("%.9f", f); +} + static struct sstack_item *prepare_push_item(struct process *p, enum llev_state st, LttTime t) { struct process_with_state *pwstate = g_malloc(sizeof(struct process_with_state)); @@ -322,7 +330,9 @@ static struct sstack_item *prepare_push_item(struct process *p, enum llev_state pwstate->state.private = g_malloc(llev_state_infos[st].size_priv); item->data_val = pwstate; - item->delete_data_val = delete_data_val; + item->delete_data_val = (void (*)(void*))delete_data_val; + + return item; } static void *item_private(struct sstack_item *item) @@ -504,20 +514,12 @@ static gboolean write_traceset_header(void *hook_data, void *call_data) return FALSE; } -inline void print_time(LttTime t) -{ - //printf("%lu.%lu", t.tv_sec, t.tv_nsec); - double f; - f = (double)t.tv_sec + ((double)t.tv_nsec)/1000000000.0; - printf("%.9f", f); -} - -GArray *oldstyle_stack_to_garray(struct process_state_stack **oldstyle_stack, int current) +GArray *oldstyle_stack_to_garray(struct process_state **oldstyle_stack, int current) { GArray *retval; int i; - retval = g_array_new(FALSE, FALSE, sizeof(struct process_state_stack *)); + retval = g_array_new(FALSE, FALSE, sizeof(struct process_state *)); for(i=0; idata_val = se; - item->delete_data_val = delete_data_val; + item->delete_data_val = (void (*)(void *))delete_data_val; sstack_add_item(target_pinfo->stack, item); diff --git a/lttv/modules/text/sstack.c b/lttv/modules/text/sstack.c index 532bab33..a87a76a5 100644 --- a/lttv/modules/text/sstack.c +++ b/lttv/modules/text/sstack.c @@ -1,4 +1,5 @@ #include +#include #include "sstack.h" diff --git a/lttv/modules/text/sstack.h b/lttv/modules/text/sstack.h index 4ff713b1..24aaf2a5 100644 --- a/lttv/modules/text/sstack.h +++ b/lttv/modules/text/sstack.h @@ -69,4 +69,6 @@ struct sstack_item *sstack_item_new_push(unsigned char finished); struct sstack_item *sstack_item_new_pop(void); struct sstack_item *sstack_item_new_evt(void); +extern void print_stack(struct sstack *stack); + #endif /* SSTACK_H */