From: Dmitry Vyukov <dvyukov@google.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
syzkaller <syzkaller@googlegroups.com>
Subject: Re: [PATCH] kcov: disable tracing and branch profiling in kcov
Date: Thu, 21 Apr 2016 12:39:02 +0200 [thread overview]
Message-ID: <CACT4Y+ayeScUP91zVx0-RJSDzs35V8O2i1n_ysAYEKep1CzMSQ@mail.gmail.com> (raw)
In-Reply-To: <1461234772-31832-1-git-send-email-aryabinin@virtuozzo.com>
On Thu, Apr 21, 2016 at 12:32 PM, Andrey Ryabinin
<aryabinin@virtuozzo.com> wrote:
> Tracing of __sanitizer_cov_trace_pc() causes unbound recursion and crash,
> because __sanitizer_cov_trace_pc() is also called from tracer code.
> For the same reason we need to disable profiling of 'if' branches.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> ---
> kernel/kcov.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/kcov.c b/kernel/kcov.c
> index 3efbee0..7919253 100644
> --- a/kernel/kcov.c
> +++ b/kernel/kcov.c
> @@ -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>
> @@ -43,7 +44,7 @@ struct kcov {
> * Entry point from instrumented code.
> * This is called once per basic-block/edge.
> */
> -void __sanitizer_cov_trace_pc(void)
> +notrace void __sanitizer_cov_trace_pc(void)
> {
> struct task_struct *t;
> enum kcov_mode mode;
> --
> 2.7.3
There was a similar patch "kcov: Don't trace the code coverage code"
recently. But it did not add DISABLE_BRANCH_PROFILING.
next prev parent reply other threads:[~2016-04-21 10:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-21 10:32 Andrey Ryabinin
2016-04-21 10:39 ` Dmitry Vyukov [this message]
2016-04-21 12:16 ` [PATCH v2] kcov: don't profile branches " Andrey Ryabinin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACT4Y+ayeScUP91zVx0-RJSDzs35V8O2i1n_ysAYEKep1CzMSQ@mail.gmail.com \
--to=dvyukov@google.com \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzkaller@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome