X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttv%2Flttv%2Fstate.c;h=fc9bcac18083fc0f2a91ac029578d51e5eb69834;hb=b68bfc9908d2ae43256747f9eccf286a5c29af82;hp=40f95c41639fe7bdb00dfeda67746ebe545bf054;hpb=68573dd0176817ad827ed9e292faaa933f0093bc;p=lttv.git diff --git a/lttv/lttv/state.c b/lttv/lttv/state.c index 40f95c41..fc9bcac1 100644 --- a/lttv/lttv/state.c +++ b/lttv/lttv/state.c @@ -2559,7 +2559,7 @@ static gboolean soft_irq_entry(void *hook_data, void *call_data) event = (LttvEvent *) call_data; if (strcmp(lttv_traceset_get_name_from_event(event), - "softirq_exit") != 0) + "softirq_entry") != 0) return FALSE; cpu = lttv_traceset_get_cpuid_from_event(event); @@ -2782,6 +2782,8 @@ static gboolean schedchange(void *hook_data, void *call_data) guint pid_in, pid_out; gint64 state_out; + //TODO ybrosseau 2012-07-13: manage this 20 in a constact or dynamically + char next_comm[20]; LttTime timestamp; event = (LttvEvent *) call_data; if (strcmp(lttv_traceset_get_name_from_event(event), @@ -2795,6 +2797,9 @@ static gboolean schedchange(void *hook_data, void *call_data) pid_in = lttv_event_get_long_unsigned(event, "next_tid"); state_out = lttv_event_get_long(event, "prev_state"); + strncpy(next_comm, lttv_event_get_string(event, "next_comm"), 20); + next_comm[20-1] = '\0'; + timestamp = lttv_event_get_timestamp(event); if(likely(process != NULL)) { @@ -2852,6 +2857,7 @@ static gboolean schedchange(void *hook_data, void *call_data) process->cpu = cpu; // process->last_cpu_index = ltt_tracefile_num(((LttvTracefileContext*)s)->tf); process->state->change = timestamp; + process->name = g_quark_from_string(next_comm); /* update cpu status */ if(pid_in == 0) @@ -3434,11 +3440,16 @@ void lttv_state_add_event_hooks(LttvTraceset *traceset) LttvAttributeValue value; LttvHooks*event_hook; +#ifdef BABEL_CLEANUP LttvIAttribute *attributes = LTTV_IATTRIBUTE(lttv_global_attributes()); result = lttv_iattribute_find_by_path(attributes, "hooks/event", LTTV_POINTER, &value); g_assert(result); event_hook = *(value.v_pointer); +#endif + //TODO ybrosseau 2012-07-12: Validate that using traceset hooks instead of the global one is valid + //Use traceset hooks + event_hook = lttv_traceset_get_hooks(traceset); g_assert(event_hook); lttv_hooks_add(event_hook,syscall_entry , NULL, LTTV_PRIO_STATE);