All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Popov <alex.popov@linux.com>,
	Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Dmitriy Vyukov <dvyukov@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Kees Cook <keescook@chromium.org>,
	Vegard Nossum <vegard.nossum@oracle.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] Makefile: support flag -fsanitizer-coverage=trace-cmp
Date: Tue, 10 Oct 2017 17:28:01 +0200	[thread overview]
Message-ID: <CAG_fn=WaC2hk6i=CLq2u37MhZ_5FtOgbjyXScmqAnRh46uNNiQ@mail.gmail.com> (raw)
In-Reply-To: <0e1d9dbe-6c09-979d-e0ba-c39368028cbf@virtuozzo.com>

On Mon, Oct 9, 2017 at 8:53 AM, Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
>
> On 10/09/2017 06:05 PM, Alexander Potapenko wrote:
>
>> v2: - updated KCOV_ENABLE_COMPARISONS description
>> ---
>>  Makefile             |  5 +++--
>>  lib/Kconfig.debug    | 10 ++++++++++
>>  scripts/Makefile.lib |  6 ++++++
>>  3 files changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 2835863bdd5a..c2a8e56df748 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -374,7 +374,7 @@ AFLAGS_KERNEL     =
>>  LDFLAGS_vmlinux =
>>  CFLAGS_GCOV  := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
>>  CFLAGS_KCOV  := $(call cc-option,-fsanitize-coverage=trace-pc,)
>> -
>> +CFLAGS_KCOV_COMPS := $(call cc-option,-fsanitize-coverage=trace-cmp,)
>>
>>  # Use USERINCLUDE when you must reference the UAPI directories only.
>>  USERINCLUDE    := \
>> @@ -420,7 +420,7 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
>>  export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
>>
>>  export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
>> -export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KASAN CFLAGS_UBSAN
>> +export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KCOV_COMPS CFLAGS_KASAN CFLAGS_UBSAN
>>  export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
>>  export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
>>  export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
>> @@ -822,6 +822,7 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)
>>  KBUILD_ARFLAGS := $(call ar-option,D)
>>
>>  include scripts/Makefile.kasan
>> +include scripts/Makefile.kcov
>
> scripts/Makefile.kcov doesn't exist.
Good catch! Will fix.

>
>
>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 5e975fee0f5b..7ddd5932c832 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -142,6 +142,12 @@ _c_flags += $(if $(patsubst n%,, \
>>       $(CFLAGS_KCOV))
>>  endif
>>
>> +ifeq ($(CONFIG_KCOV_ENABLE_COMPARISONS),y)
>> +_c_flags += $(if $(patsubst n%,, \
>> +     $(KCOV_INSTRUMENT_$(basetarget).o)$(KCOV_INSTRUMENT)$(CONFIG_KCOV_INSTRUMENT_ALL)), \
>> +     $(CFLAGS_KCOV_COMPS))
>> +endif
>> +
>
> Instead of this you could simply add -fsanitize-coverage=trace-cmp to CFLAGS_KCOV.
Indeed. I've refactored these bits and moved them to Makefile.kcov.
>
>>  # If building the kernel in a separate objtree expand all occurrences
>>  # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
>>
>>



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Potapenko <glider@google.com>
To: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Popov <alex.popov@linux.com>,
	Quentin Casasnovas <quentin.casasnovas@oracle.com>,
	Dmitriy Vyukov <dvyukov@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Kees Cook <keescook@chromium.org>,
	Vegard Nossum <vegard.nossum@oracle.com>,
	syzkaller <syzkaller@googlegroups.com>,
	Linux Memory Management List <linux-mm@kvack.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] Makefile: support flag -fsanitizer-coverage=trace-cmp
Date: Tue, 10 Oct 2017 17:28:01 +0200	[thread overview]
Message-ID: <CAG_fn=WaC2hk6i=CLq2u37MhZ_5FtOgbjyXScmqAnRh46uNNiQ@mail.gmail.com> (raw)
In-Reply-To: <0e1d9dbe-6c09-979d-e0ba-c39368028cbf@virtuozzo.com>

On Mon, Oct 9, 2017 at 8:53 AM, Andrey Ryabinin <aryabinin@virtuozzo.com> wrote:
>
>
> On 10/09/2017 06:05 PM, Alexander Potapenko wrote:
>
>> v2: - updated KCOV_ENABLE_COMPARISONS description
>> ---
>>  Makefile             |  5 +++--
>>  lib/Kconfig.debug    | 10 ++++++++++
>>  scripts/Makefile.lib |  6 ++++++
>>  3 files changed, 19 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 2835863bdd5a..c2a8e56df748 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -374,7 +374,7 @@ AFLAGS_KERNEL     =
>>  LDFLAGS_vmlinux =
>>  CFLAGS_GCOV  := -fprofile-arcs -ftest-coverage -fno-tree-loop-im $(call cc-disable-warning,maybe-uninitialized,)
>>  CFLAGS_KCOV  := $(call cc-option,-fsanitize-coverage=trace-pc,)
>> -
>> +CFLAGS_KCOV_COMPS := $(call cc-option,-fsanitize-coverage=trace-cmp,)
>>
>>  # Use USERINCLUDE when you must reference the UAPI directories only.
>>  USERINCLUDE    := \
>> @@ -420,7 +420,7 @@ export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
>>  export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
>>
>>  export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
>> -export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KASAN CFLAGS_UBSAN
>> +export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV CFLAGS_KCOV CFLAGS_KCOV_COMPS CFLAGS_KASAN CFLAGS_UBSAN
>>  export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
>>  export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
>>  export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
>> @@ -822,6 +822,7 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=designated-init)
>>  KBUILD_ARFLAGS := $(call ar-option,D)
>>
>>  include scripts/Makefile.kasan
>> +include scripts/Makefile.kcov
>
> scripts/Makefile.kcov doesn't exist.
Good catch! Will fix.

>
>
>
>> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
>> index 5e975fee0f5b..7ddd5932c832 100644
>> --- a/scripts/Makefile.lib
>> +++ b/scripts/Makefile.lib
>> @@ -142,6 +142,12 @@ _c_flags += $(if $(patsubst n%,, \
>>       $(CFLAGS_KCOV))
>>  endif
>>
>> +ifeq ($(CONFIG_KCOV_ENABLE_COMPARISONS),y)
>> +_c_flags += $(if $(patsubst n%,, \
>> +     $(KCOV_INSTRUMENT_$(basetarget).o)$(KCOV_INSTRUMENT)$(CONFIG_KCOV_INSTRUMENT_ALL)), \
>> +     $(CFLAGS_KCOV_COMPS))
>> +endif
>> +
>
> Instead of this you could simply add -fsanitize-coverage=trace-cmp to CFLAGS_KCOV.
Indeed. I've refactored these bits and moved them to Makefile.kcov.
>
>>  # If building the kernel in a separate objtree expand all occurrences
>>  # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/').
>>
>>



-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-10-10 15:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09 15:05 [PATCH v2 1/3] kcov: support comparison operands collection Alexander Potapenko
2017-10-09 15:05 ` Alexander Potapenko
2017-10-09 15:05 ` [PATCH v2 2/3] Makefile: support flag -fsanitizer-coverage=trace-cmp Alexander Potapenko
2017-10-09 15:05   ` Alexander Potapenko
2017-10-09 15:53   ` Andrey Ryabinin
2017-10-09 15:53     ` Andrey Ryabinin
2017-10-10 15:28     ` Alexander Potapenko [this message]
2017-10-10 15:28       ` Alexander Potapenko
2017-10-10 21:53   ` kbuild test robot
2017-10-09 15:05 ` [PATCH v2 3/3] kcov: update documentation Alexander Potapenko
2017-10-09 15:05   ` Alexander Potapenko
2017-10-09 15:46 ` [PATCH v2 1/3] kcov: support comparison operands collection Mark Rutland
2017-10-09 15:46   ` Mark Rutland
2017-10-09 18:15   ` Dmitry Vyukov
2017-10-09 18:15     ` Dmitry Vyukov
2017-10-09 18:37     ` Mark Rutland
2017-10-09 18:37       ` Mark Rutland
2017-10-09 18:46       ` Dmitry Vyukov
2017-10-09 18:46         ` Dmitry Vyukov
2017-10-10  9:56         ` Mark Rutland
2017-10-10  9:56           ` Mark Rutland
2017-10-10 15:28   ` Alexander Potapenko
2017-10-10 15:28     ` Alexander Potapenko
2017-10-10 15:34     ` Dmitry Vyukov
2017-10-10 15:34       ` Dmitry Vyukov
2017-10-11  9:56       ` Alexander Potapenko
2017-10-11  9:56         ` Alexander Potapenko

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='CAG_fn=WaC2hk6i=CLq2u37MhZ_5FtOgbjyXScmqAnRh46uNNiQ@mail.gmail.com' \
    --to=glider@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=alex.popov@linux.com \
    --cc=andreyknvl@google.com \
    --cc=aryabinin@virtuozzo.com \
    --cc=dvyukov@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mark.rutland@arm.com \
    --cc=quentin.casasnovas@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=vegard.nossum@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.