From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francis.Giraldeau@USherbrooke.ca (Francis Giraldeau) Date: Thu, 25 Nov 2010 14:49:44 -0500 Subject: [ltt-dev] [PATCH] Fix initial state bug In-Reply-To: <20101125161629.GA12119@Krystal> References: <1290700810-24932-1-git-send-email-francis.giraldeau@usherbrooke.ca> <20101125161629.GA12119@Krystal> Message-ID: <20101125144944.13145zh3c6at16w4@www.usherbrooke.ca> Mathieu Desnoyers a ?crit?: >> +/* get a given quark from lttng module enum value */ >> +#define ltt_enum_quark(e, f, names) >> (g_quark_from_string(names[ltt_event_get_unsigned(e, f)])) > > Please use a static inline rather than a preprocessor macro for this. It > comes with type checking and removes odd macro corner-cases. Ok, done. >> @@ -3503,11 +3538,9 @@ static gboolean enum_process_state(void >> *hook_data, void *call_data) >> es->t = LTTV_STATE_MODE_UNKNOWN; >> es->s = LTTV_STATE_UNNAMED; >> es->n = LTTV_STATE_SUBMODE_UNKNOWN; >> -#if 0 >> es->t = LTTV_STATE_SYSCALL; >> es->s = status; >> es->n = submode; >> -#endif //0 > > Hrm ? you're leaving the unknown and then changing the state ? What for ? > > How do you know the thread is not in interrupt or trap ? (see comment > above) Double state change is obviously wrong, my mistake. I removed those changes. As I understand, we don't know for sure the initial state from the state dump. The actual initial process state is known at the first occurrence of an event in the trace, isn't? Francis