mirror of https://gitee.com/openkylin/linux.git
tracing: provide correct return value after outputting the event
This patch is to make the function return early on failure, and give correct return value on success. Signed-off-by: Wenji Huang <wenji.huang@oracle.com> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
This commit is contained in:
parent
f54fc98aa6
commit
810dc73265
|
@ -186,30 +186,30 @@ verif_pid(struct trace_seq *s, pid_t pid, int cpu, pid_t *last_pids_cpu)
|
||||||
ret = trace_seq_printf(s,
|
ret = trace_seq_printf(s,
|
||||||
" ------------------------------------------\n");
|
" ------------------------------------------\n");
|
||||||
if (!ret)
|
if (!ret)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
ret = print_graph_cpu(s, cpu);
|
ret = print_graph_cpu(s, cpu);
|
||||||
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
ret = print_graph_proc(s, prev_pid);
|
ret = print_graph_proc(s, prev_pid);
|
||||||
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
ret = trace_seq_printf(s, " => ");
|
ret = trace_seq_printf(s, " => ");
|
||||||
if (!ret)
|
if (!ret)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
ret = print_graph_proc(s, pid);
|
ret = print_graph_proc(s, pid);
|
||||||
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
if (ret == TRACE_TYPE_PARTIAL_LINE)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
ret = trace_seq_printf(s,
|
ret = trace_seq_printf(s,
|
||||||
"\n ------------------------------------------\n\n");
|
"\n ------------------------------------------\n\n");
|
||||||
if (!ret)
|
if (!ret)
|
||||||
TRACE_TYPE_PARTIAL_LINE;
|
return TRACE_TYPE_PARTIAL_LINE;
|
||||||
|
|
||||||
return ret;
|
return TRACE_TYPE_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ftrace_graph_ret_entry *
|
static struct ftrace_graph_ret_entry *
|
||||||
|
|
Loading…
Reference in New Issue