Re: [PATCH 4/6] tracing: Change trace_seq to use separate buffer

From: Frederic Weisbecker
Date: Wed Jan 20 2010 - 13:56:32 EST


On Tue, Jan 19, 2010 at 03:34:16PM +0800, Lai Jiangshan wrote:
> @@ -526,19 +526,19 @@ event_format_read(struct file *filp, char __user *ubuf, size_t cnt,
> {
> struct ftrace_event_call *call = filp->private_data;
> struct ftrace_event_field *field;
> - struct trace_seq *s;
> + struct trace_seq seq, *s = &seq;
> + unsigned char *buffer;
> int common_field_count = 5;
> - char *buf;
> int r = 0;
>
> if (*ppos)
> return 0;
>
> - s = kmalloc(sizeof(*s), GFP_KERNEL);
> - if (!s)
> + buffer = (unsigned char *)__get_free_page(GFP_KERNEL);
> + if (!buffer)
> return -ENOMEM;
>
> - trace_seq_init(s);
> + trace_seq_init(s, buffer, PAGE_SIZE);



May be can we use a paired trace_seq_init_page/trace_seq_free_page,
to sum up a bit the above pattern.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/