Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: zhaolei@cn.fujitsu.com (Zhaolei)
Subject: [ltt-dev] [PATCH] Separate ltt_trace_create() intoltt_trace_create() and ltt_trace_alloc()
Date: Wed, 29 Oct 2008 12:04:30 +0800	[thread overview]
Message-ID: <FA1FF8365FF74896B2A8A02C5F199FB9@zhaoleiwin> (raw)
In-Reply-To: <20081028142532.GA1136@Krystal>

* Mathieu Desnoyers <compudj at krystal.dyndns.org> wrote:
>* Zhaolei (zhaolei at cn.fujitsu.com) wrote:
>> This is step1 of:
>> "switch marker list and marker activation (currently in /proc/ltt) to debugfs"
>> 
> 
> Excellent start ! :)
> 
> I think you are in the right direction. See below,
Hello, Mathieu

Thanks for your suggestion.
We will fix step1 on your suggestion and continue to do step2.

But I have some question below:

>>  struct ltt_traces {
>> - struct list_head head; /* Traces list */
>> + struct list_head prealloc_head; /* Pre-allocated traces list */
> 
> pre-allocated sounds like "let's allocate 10 entries before the user
> asks for the first one". I think "setup_head" would be a better name.
Thanks, I agree.

>> @@ -218,6 +235,12 @@ struct ltt_trace_struct {
>>  struct ltt_channel_struct *modules;
>>  struct ltt_channel_struct *metadata;
>>  } channel;
>> + struct {
>> + struct {
>> + unsigned subbuf_size;
>> + unsigned subbuf_cnt;
>> + } channels[NR_LTT_CHANNELS];
> 
> You could probably put the
>   struct ltt_channel_struct       *channel;
> 
>   in there.
> 
>> + } setting;
> 
> setting seems not really useful here.
> 
>  struct ltt_channel_struct channel[NR_LTT_CHANNELS];
>   
> And adding subbuf_size and nr_subbufs fields to struct
> ltt_channel_struct seems better.   
But channel is allocated in other function as ltt_relay_create_channel:
static int ltt_relay_create_channel(char *trace_name,
 struct ltt_trace_struct *trace, struct dentry *dir,
 char *channel_name, struct ltt_channel_struct **ltt_chan,
 unsigned int subbuf_size, unsigned int n_subbufs,
 int overwrite)
{
 ...
 *ltt_chan = kzalloc(sizeof(struct ltt_channel_struct), GFP_KERNEL);
 ...

If we define struct ltt_channel_struct channel[NR_LTT_CHANNELS](now is pointer)
We need to modify ltt_relay_create_channel and other functions and make
 things complex.

So, IMHO, we can use current struct at present, and select to impl your idea
 after "switch marker list and marker activation to debugfs" finished.

>> +/*
>> + * Todo:
>> + * Make similar function in channel.c,
>> + * so it will be useful for both ltt-tracer.c and ltt-marker-control.c
>> + */
>> +/*
>> + * Its order is MUST be same with enum ltt_channels
>> + */
>> +static char *chan_names[] = {
>> + LTT_CPU_CHANNEL,
>> + LTT_PROCESSES_CHANNEL,
>> + LTT_INTERRUPTS_CHANNEL,
>> + LTT_NETWORK_CHANNEL,
>> + LTT_MODULES_CHANNEL,
>> + LTT_METADATA_CHANNEL,
>> +};
>> +
> 
> If you add a const char *name field into struct ltt_channel_struct, you won't
> need this.
It have relation with prev qusetion.
If we don't define struct ltt_channel_struct channel[NR_LTT_CHANNELS]
 in ltt_trace_struct, we need to get channel-name from channel-id by this struct.
But it is a temp struct, because it is better to use a unifed struct for both
 ltt-tracer.c and ltt-marker-control.c

> > Those below should really be turned into a loop once you can simply
> iterate on the channel [] elements in the trace setup structure.
Thanks, I agree.

> 
> 
> Mathieu
> 


  reply	other threads:[~2008-10-29  4:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <48F733E6.9010007@cn.fujitsu.com>
2008-10-17  3:56 ` [ltt-dev] TODO list before releasing LTTng-buffering to LKML] Zhaolei
2008-10-17  3:56   ` Zhaolei
2008-10-17  3:56   ` Zhaolei
     [not found]   ` <20081017042045.GB5067@Krystal>
2008-10-17  6:31     ` Zhaolei
     [not found]       ` <20081017161429.GA5696@Krystal>
2008-10-20  3:03         ` Zhaolei
     [not found]           ` <20081020031634.GA14209@Krystal>
2008-10-27  3:47             ` [ltt-dev] [PATCH] Separate ltt_trace_create() into ltt_trace_create() and ltt_trace_alloc() Zhaolei
2008-10-28 14:25               ` Mathieu Desnoyers
2008-10-29  4:04                 ` Zhaolei [this message]
     [not found] <B42BD3DB473F4EA5AC9BE686AEF2338E@zhaoleiwin>
2008-10-30 14:49 ` [ltt-dev] [PATCH] Separate ltt_trace_create()intoltt_trace_create() " 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=FA1FF8365FF74896B2A8A02C5F199FB9@zhaoleiwin \
    --to=zhaolei@cn.fujitsu.com \
    /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