From: Dmitry Vyukov <dvyukov@google.com>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: "Albert Ou" <aou@eecs.berkeley.edu>,
"Björn Töpel" <bjorn.topel@gmail.com>,
syzkaller <syzkaller@googlegroups.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Paul Walmsley" <paul.walmsley@sifive.com>,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH] riscv: enable kcov
Date: Thu, 25 Jun 2020 20:45:55 +0200 [thread overview]
Message-ID: <CACT4Y+azxRtnEQO9tH8nqM_o8VJaTRAiQmQAYhTsrWmVWWhLGw@mail.gmail.com> (raw)
In-Reply-To: <20200625183941.23093-1-tklauser@distanz.ch>
On Thu, Jun 25, 2020 at 8:39 PM Tobias Klauser <tklauser@distanz.ch> wrote:
>
> Add ARCH_HAS_KCOV and HAVE_GCC_PLUGINS to the riscv Kconfig.
> Also disable instrumentation of vdso.
>
> Cc: Björn Töpel <bjorn.topel@gmail.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
If it boots:
Acked-by: Dmitry Vyukov <dvyukov@google.com>
FWIW for x86 we needed to do much more of this:
$ find arch/x86/ -name Makefile -exec grep KCOV_INSTRUMENT {} \; -print
KCOV_INSTRUMENT := n
arch/x86/kernel/Makefile
KCOV_INSTRUMENT := n
arch/x86/kernel/apic/Makefile
KCOV_INSTRUMENT_common.o := n
KCOV_INSTRUMENT_perf_event.o := n
arch/x86/kernel/cpu/Makefile
KCOV_INSTRUMENT := n
arch/x86/realmode/rm/Makefile
KCOV_INSTRUMENT := n
arch/x86/boot/Makefile
KCOV_INSTRUMENT := n
arch/x86/boot/compressed/Makefile
KCOV_INSTRUMENT := n
arch/x86/entry/Makefile
KCOV_INSTRUMENT := n
arch/x86/entry/vdso/Makefile
KCOV_INSTRUMENT := n
arch/x86/um/vdso/Makefile
KCOV_INSTRUMENT_delay.o := n
KCOV_INSTRUMENT_cmdline.o := n
arch/x86/lib/Makefile
KCOV_INSTRUMENT_tlb.o := n
KCOV_INSTRUMENT_mem_encrypt.o := n
KCOV_INSTRUMENT_mem_encrypt_identity.o := n
arch/x86/mm/Makefile
KCOV_INSTRUMENT := n
arch/x86/purgatory/Makefile
> ---
> arch/riscv/Kconfig | 2 ++
> arch/riscv/kernel/vdso/Makefile | 1 +
> 2 files changed, 3 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 089293e4ad46..a7d7f8184f15 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -19,6 +19,7 @@ config RISCV
> select ARCH_HAS_DEBUG_WX
> select ARCH_HAS_GCOV_PROFILE_ALL
> select ARCH_HAS_GIGANTIC_PAGE
> + select ARCH_HAS_KCOV
> select ARCH_HAS_MMIOWB
> select ARCH_HAS_PTE_SPECIAL
> select ARCH_HAS_SET_DIRECT_MAP
> @@ -57,6 +58,7 @@ config RISCV
> select HAVE_DMA_CONTIGUOUS if MMU
> select HAVE_EBPF_JIT if MMU
> select HAVE_FUTEX_CMPXCHG if FUTEX
> + select HAVE_GCC_PLUGINS
> select HAVE_GENERIC_VDSO if MMU && 64BIT
> select HAVE_PCI
> select HAVE_PERF_EVENTS
> diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
> index 38ba55b0eb9d..9debbaab393d 100644
> --- a/arch/riscv/kernel/vdso/Makefile
> +++ b/arch/riscv/kernel/vdso/Makefile
> @@ -29,6 +29,7 @@ CPPFLAGS_vdso.lds += -P -C -U$(ARCH)
>
> # Disable gcov profiling for VDSO code
> GCOV_PROFILE := n
> +KCOV_INSTRUMENT := n
>
> # Force dependency
> $(obj)/vdso.o: $(obj)/vdso.so
> --
> 2.27.0
>
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2020-06-26 12:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 18:39 [PATCH] riscv: enable kcov Tobias Klauser
2020-06-25 18:45 ` Dmitry Vyukov [this message]
2020-06-26 12:02 ` Tobias Klauser
2020-06-26 12:40 ` [PATCH v2] riscv: Allow building with kcov coverage Tobias Klauser
2020-06-26 14:28 ` Dmitry Vyukov
2020-07-11 4:27 ` Palmer Dabbelt
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+azxRtnEQO9tH8nqM_o8VJaTRAiQmQAYhTsrWmVWWhLGw@mail.gmail.com \
--to=dvyukov@google.com \
--cc=aou@eecs.berkeley.edu \
--cc=bjorn.topel@gmail.com \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=syzkaller@googlegroups.com \
--cc=tklauser@distanz.ch \
/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;
as well as URLs for NNTP newsgroup(s).