Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423212

Re: [PATCH] kcov: reject open when kernel not instrumented

From Dmitry Vyukov <dvyukov@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH] kcov: reject open when kernel not instrumented
Date 2016-06-15 18:40 +0200
Message-ID <rKm1c-4VP-9@gated-at.bofh.it> (permalink)
References <rKleN-4pE-5@gated-at.bofh.it> <rKlRw-4SQ-13@gated-at.bofh.it> <rKm1c-4VP-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jun 15, 2016 at 6:34 PM, Mark Rutland <mark.rutland@arm.com> wrote:
> On Wed, Jun 15, 2016 at 06:21:03PM +0200, Michal Marek wrote:
>> Dne 15.6.2016 v 17:49 Mark Rutland napsal(a):
>> > If the toolchain does not support -fsanitize-coverage=trace-pc, we blat
>> > this option from CFLAGS_KCOV, and build the kernel without
>> > instrumentation, even if CONFIG_KCOV was selected. However, we still
>> > build the rest of the kcov infrastructure, and expose a kcov file under
>> > debugfs. This can be confusing, as the kernel will appear to support
>> > kcov, yet will never manage to sample any trace PC values. While we do
>> > note this fact at build time, this may be missed, and a user may not
>> > have access to build logs.
>> >
>> > This patch adds an artificial CONFIG symbol, CONFIG_KCOV_CC, that is
>> > only set when the toolchain supports -fsanitize-coverage=trace-pc, and
>> > hence the kernel is built with instrumentation. When this is not the
>> > case, the kernel will return -ENOTSUPP if userspace attempts to open the
>> > kcov debugfs file, indicating that kcov functionality is unavailable.
>>
>> Hi Mark,
>>
>> please use a define outside the CONFIG_ namespace, because it is not a
>> config option that one can find in .config or a Kconfig file. We already
>> have CC_HAVE_ASM_GOTO, CC_USING_FENTRY and similar in the kernel.
>
> Sure thing. I guess I should also not use IS_ENABLED, and will fall back
> to the usual ifdefferty.
>
> Dmitry, Alexander, any preference for the name? Is
> CC_HAVE_SANCOV_TRACE_PC ok?

Fine with me.

> I guess we should also clean up arm64's current use of CONFIG_AS_LSE
> (which I guess should be something like AS_HAVE_LSE per the
> CC_HAVE_ASM_GOTO example). I can cook up a patch for that too.
>
> Thanks,
> Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] kcov: reject open when kernel not instrumented Mark Rutland <mark.rutland@arm.com> - 2016-06-15 17:50 +0200
  Re: [PATCH] kcov: reject open when kernel not instrumented Dmitry Vyukov <dvyukov@google.com> - 2016-06-15 18:00 +0200
  Re: [PATCH] kcov: reject open when kernel not instrumented Michal Marek <mmarek@suse.com> - 2016-06-15 18:30 +0200
    Re: [PATCH] kcov: reject open when kernel not instrumented Mark Rutland <mark.rutland@arm.com> - 2016-06-15 18:40 +0200
      Re: [PATCH] kcov: reject open when kernel not instrumented Dmitry Vyukov <dvyukov@google.com> - 2016-06-15 18:40 +0200

csiph-web