From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH] Fix initial state bug
Date: Thu, 25 Nov 2010 11:00:30 -0500 [thread overview]
Message-ID: <20101125160030.GA10538@Krystal> (raw)
In-Reply-To: <4CEE8348.3070800@gmail.com>
* Yannick Brosseau (yannick.brosseau at gmail.com) wrote:
> On 11/25/2010 10:29 AM, Francis Giraldeau wrote:
>> This patch fixes a bug with the initial state in the control flow
>> viewer. When
>> a process was started before starting the trace, in some situation all
>> the
>> states of this process was wrong, because of a unknown initial state.
>
> +/* get a given quark from lttng module enum value */
> +#define enum_quark(e, f, names) (g_quark_from_string(names[ltt_event_get_unsigned(e, f)]))
> +
> /* Channel Quarks */
>
> The enum_quark function name sounds too generic to me. Maybe ltt_event_enum_quark or ltt_enum_quark
>
>
> +/*
> + * Quark strings that matches lttng module enums found in statedump
> + * Matching enums are from lttng-modules/ltt-statedump.c
> + */
> +static const char *const lttng_thread_type_names[] = {
> + "USER_THREAD", // LTTNG_USER_THREAD
> + "KERNEL_THREAD" // LTTNG_KERNEL_THREAD
> +};
>
> Maybe these should be in their own header file to ease the maintenance
> of the list ?
Defining a static const in a header file is wrong. It should be declared
in state.c. Also, shouldn't we declare enums in state.h to match those
in ltt-statedump.c ?
Also, we should change the occurences of e.g. "USER_THREAD" in state.c
for:
LTTV_STATE_USER_THREAD =
g_quark_from_static_string(lttng_thread_type_names[ENUM_USER_THREAD]);
and do the same for all these duplicated strings.
Thanks,
Mathieu
>
>
> Yannick
>
>
> _______________________________________________
> 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
next prev parent reply other threads:[~2010-11-25 16:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-25 15:29 Francis Giraldeau
2010-11-25 15:29 ` Francis Giraldeau
2010-11-25 15:29 ` Francis Giraldeau
2010-11-25 15:39 ` Yannick Brosseau
2010-11-25 16:00 ` Mathieu Desnoyers [this message]
2010-11-25 16:00 francis.giraldeau
2010-11-25 16:16 ` Mathieu Desnoyers
2010-11-25 19:49 ` Francis Giraldeau
2010-11-26 1:07 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101125160030.GA10538@Krystal \
--to=compudj@krystal.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox