xfs
[Top] [All Lists]

Re: [PATCH 1/6] writeback: initial tracing support

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/6] writeback: initial tracing support
From: Li Zefan <lizf@xxxxxxxxxxxxxx>
Date: Fri, 04 Jun 2010 09:10:33 +0800
Cc: linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx
In-reply-to: <1275609328-12514-2-git-send-email-david@xxxxxxxxxxxxx>
References: <1275609328-12514-1-git-send-email-david@xxxxxxxxxxxxx> <1275609328-12514-2-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2
> +TRACE_EVENT(writeback_queue,
> +
> +     TP_PROTO(struct backing_dev_info *bdi, struct wb_writeback_args *args),
> +
> +     TP_ARGS(bdi, args),
> +
> +     TP_STRUCT__entry(
> +             __array(char,           name,           16)
> +             __field(long,           nr_pages)
> +             __field(int,            sb)
> +             __field(int,            sync_mode)
> +             __field(int,            for_kupdate)
> +             __field(int,            range_cyclic)
> +             __field(int,            for_background)
> +     ),
> +
> +     TP_fast_assign(
> +             strncpy(__entry->name, dev_name(bdi->dev), 16);

Should use strlcpy() ?

> +             __entry->nr_pages       = args->nr_pages;
> +             __entry->sb             = !!args->sb;
> +             __entry->for_kupdate    = args->for_kupdate;
> +             __entry->range_cyclic   = args->range_cyclic;
> +             __entry->for_background = args->for_background;
> +     ),
> +
> +     TP_printk("%s: pages=%ld, sb=%d, kupdate=%d, range_cyclic=%d "
> +               "for_background=%d", __entry->name, __entry->nr_pages,
> +                     __entry->sb, __entry->for_kupdate,
> +                     __entry->range_cyclic, __entry->for_background)
> +);
> +
> +TRACE_EVENT(writeback_sched,
> +
> +     TP_PROTO(struct backing_dev_info *bdi, struct bdi_work *work,
> +              const char *msg),
> +
> +     TP_ARGS(bdi, work, msg),
> +
> +     TP_STRUCT__entry(
> +             __array(char,                   name,           16)
> +             __field(unsigned int,           work)
> +             __array(char,                   task,           8)
> +     ),
> +
> +     TP_fast_assign(
> +             strncpy(__entry->name, dev_name(bdi->dev), 16);

ditto

> +             __entry->work = (unsigned long) work & 0xffff;
> +             snprintf(__entry->task, 8, "%s", msg);
> +     ),
> +
> +     TP_printk("work=%x, task=%s", __entry->work, __entry->task)
> +);

...

> +TRACE_EVENT(writeback_bdi_register,
> +
> +     TP_PROTO(const char *name, int start),
> +
> +     TP_ARGS(name, start),
> +
> +     TP_STRUCT__entry(
> +             __array(char,   name,           16)
> +             __field(int,    start)
> +     ),
> +
> +     TP_fast_assign(
> +             strncpy(__entry->name, name, 16);

ditto

> +             __entry->start = start;
> +     ),
> +
> +     TP_printk("%s: %s", __entry->name,
> +                     __entry->start ? "registered" : "unregistered")
> +);

<Prev in Thread] Current Thread [Next in Thread>