Commit b7bab50f authored by sunliming's avatar sunliming Committed by Lipeng Sang
Browse files

tracing: Simplify conditional compilation code in tracing_set_tracer()

stable inclusion
from stable-v5.10.152
commit bd6af07e7993e304679ac21781d2d39ecdf97de0
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I73HJ0

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bd6af07e7993e304679ac21781d2d39ecdf97de0

--------------------------------

[ Upstream commit f4b0d318 ]

Two conditional compilation directives "#ifdef CONFIG_TRACER_MAX_TRACE"
are used consecutively, and no other code in between. Simplify conditional
the compilation code and only use one "#ifdef CONFIG_TRACER_MAX_TRACE".

Link: https://lkml.kernel.org/r/20220602140613.545069-1-sunliming@kylinos.cn



Signed-off-by: default avatarsunliming <sunliming@kylinos.cn>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
Stable-dep-of: a541a955 ("tracing: Do not free snapshot if tracer is on cmdline")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLipeng Sang <sanglipeng1@jd.com>
parent 97dab41c
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -6045,9 +6045,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)