lkml.org 
[lkml]   [2010]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][GIT PULL][v2.6.35] tracing/events: Convert format output to seq_file
> +static void *f_start(struct seq_file *m, loff_t *pos)
> +{
> + loff_t l = 1;
> + void *p;
> +
> + /* Start by showing the header */
> + if (!*pos) {
> + (*pos)++;

We shoudn't increment *pos in start() handler. It's a common mistake when
using seqfile.

What we need to do in start() is move the pointer to postion *pos.

> + return (void *)FORMAT_HEADER;
> }
>
> - if (r)
> - r = trace_seq_printf(s, "\nprint fmt: %s\n",
> - call->print_fmt);
> + p = (void *)FORMAT_HEADER;
> + do {
> + p = f_next(m, p, &l);
> + } while (p && l < *pos);
>
> - if (!r) {
> - /*
> - * ug! The format output is bigger than a PAGE!!
> - */
> - buf = "FORMAT TOO BIG\n";
> - r = simple_read_from_buffer(ubuf, cnt, ppos,
> - buf, strlen(buf));
> - goto out;
> + return p;
> +}


\
 
 \ /
  Last update: 2010-06-04 04:11    [W:0.322 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site