lkml.org 
[lkml]   [2014]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 14/23 v4] tracing: Convert seq_buf_path() to be like seq_path()
On Fri, 14 Nov 2014 17:53:08 +0100
Petr Mladek <pmladek@suse.cz> wrote:


> > /**
> > diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
> > index 3c63b619d6b7..475412e31de5 100644
> > --- a/kernel/trace/trace_seq.c
> > +++ b/kernel/trace/trace_seq.c
> > @@ -342,7 +342,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
> > return 0;
> > }
> >
> > - ret = seq_buf_path(&s->seq, path);
> > + ret = seq_buf_path(&s->seq, path, "\n");
> >
> > if (unlikely(seq_buf_has_overflowed(&s->seq))) {
> > s->seq.len = save_len;
> > @@ -350,7 +350,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
> > return 0;
> > }
> >
> > - return ret;
> > + return 1;
>
> Ah, I have just realized that this should return -1 when
> seq_buf_path() returns -1.

It really doesn't matter as long as it's not zero. The one user just
tests if the return is zero or not.

trace_seq() doesn't have to follow all the same rules as seq_buf()
does, as seq_buf() is more in line with seq_file().


>
> Note that set_buf_path() does not longer calls seq_buf_set_overflow(s)
> when the path handling fails. Therefore the above check for overflow
> will probably never happen.

This is in a transitional state of the patch series. The final version
of seq_buf_path() will call seq_buf_commit() which will put the seq_buf
in an overflow state if it isn't correct. Trying to fix this version
here will probably just cause me to make another stupid mistake and
ruin the final version ;-)

-- Steve

>
> Best Regards,
> Petr
>
> > }
> > EXPORT_SYMBOL_GPL(trace_seq_path);
> >
> > --
> > 2.1.1
> >
> >



\
 
 \ /
  Last update: 2014-11-14 20:01    [W:0.097 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site