lkml.org 
[lkml]   [2009]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tracing: add checks for printing graph irq
From
Date
On Fri, 2009-12-11 at 17:38 +0800, Wenji Huang wrote:
> Check return value of trace_seq_printf.
>
> Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
> ---
> kernel/trace/trace_functions_graph.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> index 45e6c01..3fa4055 100644
> --- a/kernel/trace/trace_functions_graph.c
> +++ b/kernel/trace/trace_functions_graph.c
> @@ -555,8 +555,11 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
> return TRACE_TYPE_PARTIAL_LINE;
>
> /* Don't close the duration column if haven't one */
> - if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION)
> - trace_seq_printf(s, " |");
> + if (tracer_flags.val & TRACE_GRAPH_PRINT_DURATION) {
> + ret = trace_seq_printf(s, " |");
> + if (!ret)
> + return TRACE_TYPE_PARTIAL_LINE;
> + }
> ret = trace_seq_printf(s, "\n");

Actually these checks are no longer needed. I would like to start
removing them. Only the last one is needed.

This is because trace_seq_* now has a "full" attribute. If the s buffer
gets full, it wont write anymore, and all new "trace_seq_*" calls will
return the same.

-- Steve

>
> if (!ret)




\
 
 \ /
  Last update: 2009-12-11 16:03    [W:0.042 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site