UPSTREAM: kcov: don't profile branches in kcov

Profiling 'if' statements in __sanitizer_cov_trace_pc() leads to
unbound recursion and crash:

	__sanitizer_cov_trace_pc() ->
		ftrace_likely_update ->
			__sanitizer_cov_trace_pc() ...

Define DISABLE_BRANCH_PROFILING to disable this tracer.

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Bug: 64145065
(cherry-picked from 36f05ae8bc)
Change-Id: I53cea027ba86b89016df3944374bdb119a2ca9dd
Signed-off-by: Paul Lawrence <paullawrence@google.com>
This commit is contained in:
Andrey Ryabinin
2016-04-28 16:18:55 -07:00
committed by Amit Pundir
parent 318c10553b
commit 928e925573

View File

@@ -1,5 +1,6 @@
#define pr_fmt(fmt) "kcov: " fmt
#define DISABLE_BRANCH_PROFILING
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/file.h>