[ltt-dev] [PATCH] Fix match between state dump and quark
Mathieu Desnoyers
compudj at krystal.dyndns.org
Wed Dec 22 14:33:27 EST 2010
* francis.giraldeau at usherbrooke.ca (francis.giraldeau at usherbrooke.ca) wrote:
> From: Francis Giraldeau <francis.giraldeau at usherbrooke.ca>
>
> This patch fixes the association between lttng state dump enum values and the
> right lttv state quark.
>
> The patch adds string tables that matches the enums sequence in lttng-modules,
> to convert enum value in the state dump to quark.
>
> Update :
> * static inline replaces macro (take two)
> * more specific function name ltt_enum_quark
> * move static string tables to state.c
> * copy corresponding state dump enum from lttng-modules
> * remove strings duplication in module_init
> * revert double state change
> ---
> lttv/lttv/state.c | 88 ++++++++++++++++++++++++++++++++++++++--------------
> lttv/lttv/state.h | 31 ++++++++++++++++++
> 2 files changed, 95 insertions(+), 24 deletions(-)
>
[...]
> diff --git a/lttv/lttv/state.h b/lttv/lttv/state.h
> index 0ae7e5c..9450c7c 100644
> --- a/lttv/lttv/state.h
> +++ b/lttv/lttv/state.h
> @@ -53,6 +53,37 @@
>
> #define LTTV_STATE_SAVE_INTERVAL 50000
>
> +/* lttng module enums from ltt-statedump.c */
> +enum lttng_thread_type {
> + LTTNG_USER_THREAD = 0,
> + LTTNG_KERNEL_THREAD = 1,
> +};
> +
> +enum lttng_execution_mode {
> + LTTNG_USER_MODE = 0,
> + LTTNG_SYSCALL = 1,
> + LTTNG_TRAP = 2,
> + LTTNG_IRQ = 3,
> + LTTNG_SOFTIRQ = 4,
> + LTTNG_MODE_UNKNOWN = 5,
> +};
> +
> +enum lttng_execution_submode {
> + LTTNG_NONE = 0,
> + LTTNG_UNKNOWN = 1,
> +};
> +
> +enum lttng_process_status {
> + LTTNG_UNNAMED = 0,
> + LTTNG_WAIT_FORK = 1,
> + LTTNG_WAIT_CPU = 2,
> + LTTNG_EXIT = 3,
> + LTTNG_ZOMBIE = 4,
> + LTTNG_WAIT = 5,
> + LTTNG_RUN = 6,
> + LTTNG_DEAD = 7,
> +};
Hrm, I prefer not to hardcode the enumerations in lttv. With the
upcoming CTF (Common Trace Format), I will export the enumerations
within the trace, into the metadata. Therefore, the mapping between
values and strings (and thus quarks) will be available by querying
libltttraceread. So I prefer not to go the way of hardcoding these
enumerations just to revert that work back soon.
Thanks,
Mathieu
> +
> /* Channel Quarks */
>
> extern GQuark
> --
> 1.7.1
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list