tracing: Simplify conditional compilation code in tracing_set_tracer()
PATCH 1/1 tracing: Simplify conditional compilation code in tracing_set_tracer()
Two conditional compilation directives "#ifdef CONFIG_TRACER_SNAPSHOT" are used consecutively, and no other code in between. Simplify conditional the compilation code and only use one "#ifdef CONFIG_TRACER_SNAPSHOT".
--- kernel/trace/trace.c | 2 -- 1 file changed, 2 deletions(-)
kernel/trace/trace.c +0 -2
@@ -6430,9 +6430,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)synchronize_rcu ();free_snapshot (tr); } -#endif -#ifdef CONFIG_TRACER_MAX_TRACE if (t->use_max_tr && !had_max_tr) { ret =tracing_alloc_snapshot_instance (tr);if (ret <0 )
Signature · 1 line
2.25.1
Steven Rostedt
maintainerQuoted 3 lines · On Thu, 2 Jun 2022 10:24:04 +0800 sunliming <[email protected]> wrote:
Two conditional compilation directives "#ifdef
CONFIG_TRACER_SNAPSHOT" are used consecutively, and no other code in between. Simplify conditional the compilation code and only use one "#ifdefCONFIG_TRACER_SNAPSHOT".
I think you mean CONFIG_TRACER_MAX_TRACE here.
-- Steve
Quoted 20 lines
Signed-off-by sunliming <[email protected]>--- kernel/trace/trace.c | 2 -- 1 file changed, 2 deletions(-)kernel/trace/trace.c +0
-2@@ -6430,9 +6430,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)synchronize_rcu ();free_snapshot (tr); } -#endif -#ifdef CONFIG_TRACER_MAX_TRACE if (t->use_max_tr && !had_max_tr) { ret =tracing_alloc_snapshot_instance (tr);if (ret <0 )
Quoted 28 lines · Steven Rostedt <[email protected]> 于2022年6月2日周四 20:26写道:
Quoted 3 lines · On Thu, 2 Jun 2022 10:24:04 +0800 sunliming <[email protected]> wrote:
Two conditional compilation directives "#ifdef
CONFIG_TRACER_SNAPSHOT" are used consecutively, and no other code in between. Simplify conditional the compilation code and only use one "#ifdefCONFIG_TRACER_SNAPSHOT".I think you mean
CONFIG_TRACER_MAX_TRACEhere.-- Steve
Quoted 16 lines
Signed-off-by sunliming <[email protected]>--- kernel/trace/trace.c | 2 -- 1 file changed, 2 deletions(-)kernel/trace/trace.c +0
-1@@ -6430,9 +6430,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)synchronize_rcu ();free_snapshot (tr); } -#endif
Quoted 5 lines
kernel/trace/trace.c int tracing_set_tracer(struct trace_array *tr, const char *buf) · line 6436
Quoted 4 lines
kernel/trace/trace.c +0
-1-#ifdef CONFIG_TRACER_MAX_TRACE if (t->use_max_tr && !had_max_tr) { ret =tracing_alloc_snapshot_instance (tr);if (ret <0 )
Yes, you are right. I am sorry about this low-level mistakes.