From: "Steven Rostedt (Red Hat)" <[email protected]>
Rewrite seq_buf_path() like it is done in seq_path() and allow
it to accept any escape character instead of just "\n".
Making seq_buf_path() like seq_path() will help prevent problems
when converting seq_file to use the seq_buf logic.
Signed-off-by: Steven Rostedt <[email protected]>
---
include/linux/seq_buf.h | 2 +-
kernel/trace/seq_buf.c | 30 ++++++++++++++++--------------
kernel/trace/trace_seq.c | 2 +-
3 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
index 97872154d51c..6d1c57d6073f 100644
--- a/include/linux/seq_buf.h
+++ b/include/linux/seq_buf.h
@@ -64,7 +64,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
unsigned int len);
-extern int seq_buf_path(struct seq_buf *s, const struct path *path);
+extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
int nmaskbits);
diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
index 2bf582753902..243123b12d16 100644
--- a/kernel/trace/seq_buf.c
+++ b/kernel/trace/seq_buf.c
@@ -272,28 +272,30 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
* seq_buf_path - copy a path into the sequence buffer
* @s: seq_buf descriptor
* @path: path to write into the sequence buffer.
+ * @esc: set of characters to escape in the output
*
* Write a path name into the sequence buffer.
*
* Returns zero on success, -1 on overflow
*/
-int seq_buf_path(struct seq_buf *s, const struct path *path)
+int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
{
- unsigned int len = SEQ_BUF_LEFT(s);
- unsigned char *p;
-
- WARN_ON(s->size == 0);
-
- p = d_path(path, s->buffer + s->len, len);
- if (!IS_ERR(p)) {
- p = mangle_path(s->buffer + s->len, p, "\n");
- if (p) {
- s->len = p - s->buffer;
- return 0;
+ char *buf = s->buffer + s->len;
+ size_t size = SEQ_BUF_LEFT(s);
+ int res = -1;
+
+ if (size) {
+ char *p = d_path(path, buf, size);
+ if (!IS_ERR(p)) {
+ char *end = mangle_path(buf, p, esc);
+ if (end)
+ res = end - buf;
}
}
- seq_buf_set_overflow(s);
- return -1;
+ if (res > 0)
+ s->len += res;
+
+ return res;
}
/**
diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
index 960ccfb2f50c..6599577cea15 100644
--- a/kernel/trace/trace_seq.c
+++ b/kernel/trace/trace_seq.c
@@ -382,7 +382,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;
--
2.1.1
On Tue 2014-11-04 10:52:41, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <[email protected]>
>
> Rewrite seq_buf_path() like it is done in seq_path() and allow
> it to accept any escape character instead of just "\n".
>
> Making seq_buf_path() like seq_path() will help prevent problems
> when converting seq_file to use the seq_buf logic.
>
> Signed-off-by: Steven Rostedt <[email protected]>
> ---
> include/linux/seq_buf.h | 2 +-
> kernel/trace/seq_buf.c | 30 ++++++++++++++++--------------
> kernel/trace/trace_seq.c | 2 +-
> 3 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> index 97872154d51c..6d1c57d6073f 100644
> --- a/include/linux/seq_buf.h
> +++ b/include/linux/seq_buf.h
> @@ -64,7 +64,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
> extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
> extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> unsigned int len);
> -extern int seq_buf_path(struct seq_buf *s, const struct path *path);
> +extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
>
> extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
> int nmaskbits);
> diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
> index 2bf582753902..243123b12d16 100644
> --- a/kernel/trace/seq_buf.c
> +++ b/kernel/trace/seq_buf.c
> @@ -272,28 +272,30 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> * seq_buf_path - copy a path into the sequence buffer
> * @s: seq_buf descriptor
> * @path: path to write into the sequence buffer.
> + * @esc: set of characters to escape in the output
> *
> * Write a path name into the sequence buffer.
> *
> * Returns zero on success, -1 on overflow
>
> */
> -int seq_buf_path(struct seq_buf *s, const struct path *path)
> +int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
> {
> - unsigned int len = SEQ_BUF_LEFT(s);
> - unsigned char *p;
> -
> - WARN_ON(s->size == 0);
I would keep this check.
> - p = d_path(path, s->buffer + s->len, len);
> - if (!IS_ERR(p)) {
> - p = mangle_path(s->buffer + s->len, p, "\n");
> - if (p) {
> - s->len = p - s->buffer;
> - return 0;
> + char *buf = s->buffer + s->len;
> + size_t size = SEQ_BUF_LEFT(s);
I would use the variable name "len" to make it consistent with
the other fucntions in seq_buf.c.
> + int res = -1;
> +
> + if (size) {
> + char *p = d_path(path, buf, size);
> + if (!IS_ERR(p)) {
> + char *end = mangle_path(buf, p, esc);
> + if (end)
> + res = end - buf;
> }
> }
> - seq_buf_set_overflow(s);
We still should set overflow on failure.
> - return -1;
> + if (res > 0)
> + s->len += res;
> +
> + return res;
It returns -1 on failure and the number of written characters on
success. This is incompatible with the other seq_buf functions
and with the comment above this function. Also it changes the
return value from trace_seq_path().
I do not mind about the used scheme but I think that we should
make it consistent.
Best Regards,
Petr
On Wed, 5 Nov 2014 15:45:53 +0100
Petr Mladek <[email protected]> wrote:
> > */
> > -int seq_buf_path(struct seq_buf *s, const struct path *path)
> > +int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
> > {
> > - unsigned int len = SEQ_BUF_LEFT(s);
> > - unsigned char *p;
> > -
> > - WARN_ON(s->size == 0);
>
> I would keep this check.
Yeah, I could.
>
> > - p = d_path(path, s->buffer + s->len, len);
> > - if (!IS_ERR(p)) {
> > - p = mangle_path(s->buffer + s->len, p, "\n");
> > - if (p) {
> > - s->len = p - s->buffer;
> > - return 0;
> > + char *buf = s->buffer + s->len;
> > + size_t size = SEQ_BUF_LEFT(s);
>
> I would use the variable name "len" to make it consistent with
> the other fucntions in seq_buf.c.
Note, seq_path() is a different beast than the other seq_*() functions
(this will be keeping a return code). And the inconsistency is in
seq_file.c as well. I'm not saying we shouldn't keep it consistent. But
as this patch is to make seq_buf like seq_file, I'll keep the
inconsistencies the same too.
We can always do a clean up later.
>
> > + int res = -1;
> > +
> > + if (size) {
> > + char *p = d_path(path, buf, size);
> > + if (!IS_ERR(p)) {
> > + char *end = mangle_path(buf, p, esc);
> > + if (end)
> > + res = end - buf;
> > }
> > }
> > - seq_buf_set_overflow(s);
>
> We still should set overflow on failure.
Again, this is different in seq_file too. I'm leaving it as is.
>
> > - return -1;
> > + if (res > 0)
> > + s->len += res;
> > +
> > + return res;
>
> It returns -1 on failure and the number of written characters on
> success. This is incompatible with the other seq_buf functions
> and with the comment above this function. Also it changes the
> return value from trace_seq_path().
>
> I do not mind about the used scheme but I think that we should
> make it consistent.
>
As seq_file has had this inconsistency for a long time, and this code
is to try to merge the code between trace_seq and seq_file, I'm going
to follow seq_file as that has been around much longer than trace_seq.
-- Steve
On Wed 2014-11-05 15:10:53, Steven Rostedt wrote:
> On Wed, 5 Nov 2014 15:45:53 +0100
> Petr Mladek <[email protected]> wrote:
>
>
> > > */
> > > -int seq_buf_path(struct seq_buf *s, const struct path *path)
> > > +int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
> > > {
> > > - unsigned int len = SEQ_BUF_LEFT(s);
> > > - unsigned char *p;
> > > -
> > > - WARN_ON(s->size == 0);
> >
> > I would keep this check.
>
> Yeah, I could.
great :-)
> >
> > > - p = d_path(path, s->buffer + s->len, len);
> > > - if (!IS_ERR(p)) {
> > > - p = mangle_path(s->buffer + s->len, p, "\n");
> > > - if (p) {
> > > - s->len = p - s->buffer;
> > > - return 0;
> > > + char *buf = s->buffer + s->len;
> > > + size_t size = SEQ_BUF_LEFT(s);
> >
> > I would use the variable name "len" to make it consistent with
> > the other fucntions in seq_buf.c.
>
> Note, seq_path() is a different beast than the other seq_*() functions
> (this will be keeping a return code). And the inconsistency is in
> seq_file.c as well. I'm not saying we shouldn't keep it consistent. But
> as this patch is to make seq_buf like seq_file, I'll keep the
> inconsistencies the same too.
Ah, I have missed this.
> We can always do a clean up later.
Fair enough. The result of this patch set (safe printing of
backtraces from all CPUs) is more important than this clean up.
[...]
> >
> > > - return -1;
> > > + if (res > 0)
> > > + s->len += res;
> > > +
> > > + return res;
> >
> > It returns -1 on failure and the number of written characters on
> > success. This is incompatible with the other seq_buf functions
> > and with the comment above this function. Also it changes the
> > return value from trace_seq_path().
> >
> > I do not mind about the used scheme but I think that we should
> > make it consistent.
> >
>
> As seq_file has had this inconsistency for a long time, and this code
> is to try to merge the code between trace_seq and seq_file, I'm going
> to follow seq_file as that has been around much longer than trace_seq.
I see. Well, we still need to fix trace_seq_path() or its callers.
For example, seq_print_user_ip() checks trace_seq_path() return value
and expects 0 on failure.
Best Regards,
Petr
On Tue 2014-11-04 10:52:41, Steven Rostedt wrote:
> From: "Steven Rostedt (Red Hat)" <[email protected]>
>
> Rewrite seq_buf_path() like it is done in seq_path() and allow
> it to accept any escape character instead of just "\n".
>
> Making seq_buf_path() like seq_path() will help prevent problems
> when converting seq_file to use the seq_buf logic.
>
> Signed-off-by: Steven Rostedt <[email protected]>
> ---
> include/linux/seq_buf.h | 2 +-
> kernel/trace/seq_buf.c | 30 ++++++++++++++++--------------
> kernel/trace/trace_seq.c | 2 +-
> 3 files changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> index 97872154d51c..6d1c57d6073f 100644
> --- a/include/linux/seq_buf.h
> +++ b/include/linux/seq_buf.h
> @@ -64,7 +64,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
> extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
> extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> unsigned int len);
> -extern int seq_buf_path(struct seq_buf *s, const struct path *path);
> +extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
>
> extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
> int nmaskbits);
> diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
> index 2bf582753902..243123b12d16 100644
> --- a/kernel/trace/seq_buf.c
> +++ b/kernel/trace/seq_buf.c
> @@ -272,28 +272,30 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> * seq_buf_path - copy a path into the sequence buffer
> * @s: seq_buf descriptor
> * @path: path to write into the sequence buffer.
> + * @esc: set of characters to escape in the output
> *
> * Write a path name into the sequence buffer.
> *
> * Returns zero on success, -1 on overflow
Ah, I have missed this. We should also update this comment to reflect
the change. I would also add a note that it is because of
compatibility with seq_path(). So, something like:
* Return the number of written bytes on success, -1 on overflow
*
* The behavior is consistent with seq_path()
> */
> -int seq_buf_path(struct seq_buf *s, const struct path *path)
> +int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
> {
[...]
> + if (size) {
> + char *p = d_path(path, buf, size);
> + if (!IS_ERR(p)) {
> + char *end = mangle_path(buf, p, esc);
> + if (end)
> + res = end - buf;
> }
> }
> - seq_buf_set_overflow(s);
> - return -1;
> + if (res > 0)
> + s->len += res;
> +
> + return res;
Best Regards,
Petr
On Thu, 6 Nov 2014 15:18:22 +0100
Petr Mladek <[email protected]> wrote:
> I see. Well, we still need to fix trace_seq_path() or its callers.
> For example, seq_print_user_ip() checks trace_seq_path() return value
> and expects 0 on failure.
Crap, thanks for pointing that out. Luckily, there's only one user, and
it's not used much. It's the user backtrace and that only prints if a
file is found, and this would only cause the offset not to be printed.
-- Steve
I made a few touch ups on this patch.
-- Steve
>From 309e8ce4cc1605d3038b16b8e43219a2867f47b1 Mon Sep 17 00:00:00 2001
From: "Steven Rostedt (Red Hat)" <[email protected]>
Date: Wed, 29 Oct 2014 13:48:37 -0400
Subject: [PATCH] tracing: Convert seq_buf_path() to be like seq_path()
Rewrite seq_buf_path() like it is done in seq_path() and allow
it to accept any escape character instead of just "\n".
Making seq_buf_path() like seq_path() will help prevent problems
when converting seq_file to use the seq_buf logic.
Link: http://lkml.kernel.org/r/[email protected]
Tested-by: Jiri Kosina <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
---
include/linux/seq_buf.h | 2 +-
kernel/trace/seq_buf.c | 26 +++++++++++++++-----------
kernel/trace/trace_seq.c | 4 ++--
3 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
index 64bf5a43411e..aec09b126082 100644
--- a/include/linux/seq_buf.h
+++ b/include/linux/seq_buf.h
@@ -70,7 +70,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
unsigned int len);
-extern int seq_buf_path(struct seq_buf *s, const struct path *path);
+extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
int nmaskbits);
diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
index 88738b200bf3..ac6eb864c946 100644
--- a/kernel/trace/seq_buf.c
+++ b/kernel/trace/seq_buf.c
@@ -272,28 +272,32 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
* seq_buf_path - copy a path into the sequence buffer
* @s: seq_buf descriptor
* @path: path to write into the sequence buffer.
+ * @esc: set of characters to escape in the output
*
* Write a path name into the sequence buffer.
*
* Returns zero on success, -1 on overflow
*/
-int seq_buf_path(struct seq_buf *s, const struct path *path)
+int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
{
- unsigned int len = seq_buf_buffer_left(s);
- unsigned char *p;
+ char *buf = s->buffer + s->len;
+ size_t size = seq_buf_buffer_left(s);
+ int res = -1;
WARN_ON(s->size == 0);
- p = d_path(path, s->buffer + s->len, len);
- if (!IS_ERR(p)) {
- p = mangle_path(s->buffer + s->len, p, "\n");
- if (p) {
- s->len = p - s->buffer;
- return 0;
+ if (size) {
+ char *p = d_path(path, buf, size);
+ if (!IS_ERR(p)) {
+ char *end = mangle_path(buf, p, esc);
+ if (end)
+ res = end - buf;
}
}
- seq_buf_set_overflow(s);
- return -1;
+ if (res > 0)
+ s->len += res;
+
+ return res;
}
/**
diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
index 3ad8738aea19..64550ed28e76 100644
--- a/kernel/trace/trace_seq.c
+++ b/kernel/trace/trace_seq.c
@@ -382,7 +382,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;
@@ -390,7 +390,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
return 0;
}
- return ret;
+ return 1;
}
EXPORT_SYMBOL_GPL(trace_seq_path);
--
2.1.1
On Fri 2014-11-07 13:34:13, Steven Rostedt wrote:
>
> I made a few touch ups on this patch.
>
> -- Steve
>
> From 309e8ce4cc1605d3038b16b8e43219a2867f47b1 Mon Sep 17 00:00:00 2001
> From: "Steven Rostedt (Red Hat)" <[email protected]>
> Date: Wed, 29 Oct 2014 13:48:37 -0400
> Subject: [PATCH] tracing: Convert seq_buf_path() to be like seq_path()
>
> Rewrite seq_buf_path() like it is done in seq_path() and allow
> it to accept any escape character instead of just "\n".
>
> Making seq_buf_path() like seq_path() will help prevent problems
> when converting seq_file to use the seq_buf logic.
>
> Link: http://lkml.kernel.org/r/[email protected]
>
> Tested-by: Jiri Kosina <[email protected]>
> Acked-by: Jiri Kosina <[email protected]>
> Signed-off-by: Steven Rostedt <[email protected]>
> ---
> include/linux/seq_buf.h | 2 +-
> kernel/trace/seq_buf.c | 26 +++++++++++++++-----------
> kernel/trace/trace_seq.c | 4 ++--
> 3 files changed, 18 insertions(+), 14 deletions(-)
>
> diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> index 64bf5a43411e..aec09b126082 100644
> --- a/include/linux/seq_buf.h
> +++ b/include/linux/seq_buf.h
> @@ -70,7 +70,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
> extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
> extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> unsigned int len);
> -extern int seq_buf_path(struct seq_buf *s, const struct path *path);
> +extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
>
> extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
> int nmaskbits);
> diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
> index 88738b200bf3..ac6eb864c946 100644
> --- a/kernel/trace/seq_buf.c
> +++ b/kernel/trace/seq_buf.c
> @@ -272,28 +272,32 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> * seq_buf_path - copy a path into the sequence buffer
> * @s: seq_buf descriptor
> * @path: path to write into the sequence buffer.
> + * @esc: set of characters to escape in the output
> *
> * Write a path name into the sequence buffer.
> *
> * Returns zero on success, -1 on overflow
This should be
* Returns the number of written bytes on success, -1 on overflow
This is just a minor issue. I believe the you would fix it. Feel free to add:
Reviewed-by: Petr Mladek <[email protected]>
Best Regards,
Petr
> -int seq_buf_path(struct seq_buf *s, const struct path *path)
> +int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc)
> {
> - unsigned int len = seq_buf_buffer_left(s);
> - unsigned char *p;
> + char *buf = s->buffer + s->len;
> + size_t size = seq_buf_buffer_left(s);
> + int res = -1;
>
> WARN_ON(s->size == 0);
>
> - p = d_path(path, s->buffer + s->len, len);
> - if (!IS_ERR(p)) {
> - p = mangle_path(s->buffer + s->len, p, "\n");
> - if (p) {
> - s->len = p - s->buffer;
> - return 0;
> + if (size) {
> + char *p = d_path(path, buf, size);
> + if (!IS_ERR(p)) {
> + char *end = mangle_path(buf, p, esc);
> + if (end)
> + res = end - buf;
> }
> }
> - seq_buf_set_overflow(s);
> - return -1;
> + if (res > 0)
> + s->len += res;
> +
> + return res;
> }
>
> /**
> diff --git a/kernel/trace/trace_seq.c b/kernel/trace/trace_seq.c
> index 3ad8738aea19..64550ed28e76 100644
> --- a/kernel/trace/trace_seq.c
> +++ b/kernel/trace/trace_seq.c
> @@ -382,7 +382,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;
> @@ -390,7 +390,7 @@ int trace_seq_path(struct trace_seq *s, const struct path *path)
> return 0;
> }
>
> - return ret;
> + return 1;
> }
> EXPORT_SYMBOL_GPL(trace_seq_path);
>
> --
> 2.1.1
>
On Mon, 10 Nov 2014 15:03:25 +0100
Petr Mladek <[email protected]> wrote:
> On Fri 2014-11-07 13:34:13, Steven Rostedt wrote:
> >
> > I made a few touch ups on this patch.
> >
> > -- Steve
> >
> > From 309e8ce4cc1605d3038b16b8e43219a2867f47b1 Mon Sep 17 00:00:00 2001
> > From: "Steven Rostedt (Red Hat)" <[email protected]>
> > Date: Wed, 29 Oct 2014 13:48:37 -0400
> > Subject: [PATCH] tracing: Convert seq_buf_path() to be like seq_path()
> >
> > Rewrite seq_buf_path() like it is done in seq_path() and allow
> > it to accept any escape character instead of just "\n".
> >
> > Making seq_buf_path() like seq_path() will help prevent problems
> > when converting seq_file to use the seq_buf logic.
> >
> > Link: http://lkml.kernel.org/r/[email protected]
> >
> > Tested-by: Jiri Kosina <[email protected]>
> > Acked-by: Jiri Kosina <[email protected]>
> > Signed-off-by: Steven Rostedt <[email protected]>
> > ---
> > include/linux/seq_buf.h | 2 +-
> > kernel/trace/seq_buf.c | 26 +++++++++++++++-----------
> > kernel/trace/trace_seq.c | 4 ++--
> > 3 files changed, 18 insertions(+), 14 deletions(-)
> >
> > diff --git a/include/linux/seq_buf.h b/include/linux/seq_buf.h
> > index 64bf5a43411e..aec09b126082 100644
> > --- a/include/linux/seq_buf.h
> > +++ b/include/linux/seq_buf.h
> > @@ -70,7 +70,7 @@ extern int seq_buf_putc(struct seq_buf *s, unsigned char c);
> > extern int seq_buf_putmem(struct seq_buf *s, const void *mem, unsigned int len);
> > extern int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> > unsigned int len);
> > -extern int seq_buf_path(struct seq_buf *s, const struct path *path);
> > +extern int seq_buf_path(struct seq_buf *s, const struct path *path, const char *esc);
> >
> > extern int seq_buf_bitmask(struct seq_buf *s, const unsigned long *maskp,
> > int nmaskbits);
> > diff --git a/kernel/trace/seq_buf.c b/kernel/trace/seq_buf.c
> > index 88738b200bf3..ac6eb864c946 100644
> > --- a/kernel/trace/seq_buf.c
> > +++ b/kernel/trace/seq_buf.c
> > @@ -272,28 +272,32 @@ int seq_buf_putmem_hex(struct seq_buf *s, const void *mem,
> > * seq_buf_path - copy a path into the sequence buffer
> > * @s: seq_buf descriptor
> > * @path: path to write into the sequence buffer.
> > + * @esc: set of characters to escape in the output
> > *
> > * Write a path name into the sequence buffer.
> > *
> > * Returns zero on success, -1 on overflow
>
> This should be
>
> * Returns the number of written bytes on success, -1 on overflow
Yep.
>
>
> This is just a minor issue. I believe the you would fix it. Feel free to add:
>
> Reviewed-by: Petr Mladek <[email protected]>
Thanks,
-- Steve