Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757125Ab0FDCNP (ORCPT ); Thu, 3 Jun 2010 22:13:15 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.123]:64732 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677Ab0FDCNN (ORCPT ); Thu, 3 Jun 2010 22:13:13 -0400 X-Authority-Analysis: v=1.1 cv=xm0otvE9/LjRWYlyDrHfx7zP0/MGCmNk7gQgTP1ehto= c=1 sm=0 a=PrV_ml3jdBcA:10 a=yQWWgrYGNuUA:10 a=7U3hwN5JcxgA:10 a=Q9fys5e9bTEA:10 a=gMqfjgEr1zLu/65IO0LwxA==:17 a=nJFUfH9sVRbywR1TkBcA:9 a=EVo11fOrKt8HSDK26bgA:7 a=y3IkeJKY4ymWyS5jgKVHQXdKIXMA:4 a=PUjeQqilurYA:10 a=gMqfjgEr1zLu/65IO0LwxA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 74.67.89.75 Subject: Re: [PATCH][GIT PULL][v2.6.35] tracing/events: Convert format output to seq_file From: Steven Rostedt Reply-To: rostedt@goodmis.org To: Li Zefan Cc: LKML , Ingo Molnar , Frederic Weisbecker , "Martin K. Petersen" , Kei Tokunaga , James Bottomley , Tomohiro Kusumi , Xiao Guangrong In-Reply-To: <4C0860DE.5020609@cn.fujitsu.com> References: <1275594103.15884.35.camel@gandalf.stny.rr.com> <4C0860DE.5020609@cn.fujitsu.com> Content-Type: text/plain; charset="ISO-8859-15" Organization: Kihon Technologies Inc. Date: Thu, 03 Jun 2010 22:13:11 -0400 Message-ID: <1275617591.15884.67.camel@gandalf.stny.rr.com> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1313 Lines: 55 On Fri, 2010-06-04 at 10:11 +0800, Li Zefan wrote: > > +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. And a common mistake I do :-p I'll rebase it with the fix. > > What we need to do in start() is move the pointer to postion *pos. So the rest is OK then? All that is needed is the removal of *pos++ ? Thanks, -- Steve > > > + 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; > > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/