Commit f26808ba authored by yuan linyu's avatar yuan linyu Committed by Steven Rostedt (VMware)

tracing: Optimize trace_buffer_iter() logic

Simplify and optimize the logic in trace_buffer_iter() to use a conditional
operation instead of an if conditional.

Link: http://lkml.kernel.org/r/20180408113631.3947-1-cugyly@163.comSigned-off-by: default avataryuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent f9065872
...@@ -583,9 +583,7 @@ static __always_inline void trace_clear_recursion(int bit) ...@@ -583,9 +583,7 @@ static __always_inline void trace_clear_recursion(int bit)
static inline struct ring_buffer_iter * static inline struct ring_buffer_iter *
trace_buffer_iter(struct trace_iterator *iter, int cpu) trace_buffer_iter(struct trace_iterator *iter, int cpu)
{ {
if (iter->buffer_iter && iter->buffer_iter[cpu]) return iter->buffer_iter ? iter->buffer_iter[cpu] : NULL;
return iter->buffer_iter[cpu];
return NULL;
} }
int tracer_init(struct tracer *t, struct trace_array *tr); int tracer_init(struct tracer *t, struct trace_array *tr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment