[Devel,RHEL7,COMMIT] ms/kcov: don't trace the code coverage code

Submitted by Konstantin Khorenko on Nov. 28, 2016, 10:12 a.m.

Details

Message ID 201611281012.uASACuAs002174@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Nov. 28, 2016, 10:12 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.4
------>
commit 270b7f2558e3626196a55908ad117514a6c70905
Author: James Morse <james.morse@arm.com>
Date:   Mon Nov 28 14:12:56 2016 +0400

    ms/kcov: don't trace the code coverage code
    
    Kcov causes the compiler to add a call to __sanitizer_cov_trace_pc() in
    every basic block.  Ftrace patches in a call to _mcount() to each
    function it has annotated.
    
    Letting these mechanisms annotate each other is a bad thing.  Break the
    loop by adding 'notrace' to __sanitizer_cov_trace_pc() so that ftrace
    won't try to patch this code.
    
    This patch lets arm64 with KCOV and STACK_TRACER boot.
    
    Signed-off-by: James Morse <james.morse@arm.com>
    Acked-by: Dmitry Vyukov <dvyukov@google.com>
    Cc: Alexander Potapenko <glider@google.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    
    https://jira.sw.ru/browse/PSBM-56169
    
    (cherry picked from commit bdab42dfc974d15303afbf259f340f374a453974)
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 kernel/kcov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/kernel/kcov.c b/kernel/kcov.c
index 9ea7a05..f963fca 100644
--- a/kernel/kcov.c
+++ b/kernel/kcov.c
@@ -44,7 +44,7 @@  struct kcov {
  * Entry point from instrumented code.
  * This is called once per basic-block/edge.
  */
-void __sanitizer_cov_trace_pc(void)
+void notrace __sanitizer_cov_trace_pc(void)
 {
 	struct task_struct *t;
 	enum kcov_mode mode;