Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7668786ybl; Thu, 16 Jan 2020 03:40:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxQgi4tw3/L8uV2EmAJNRkiD6+CqiZXU5tBVc55mnE1jwIDQq9+TVYjYNmRVmLaO6XNTbO3 X-Received: by 2002:a05:6830:1db5:: with SMTP id z21mr1592967oti.325.1579174829392; Thu, 16 Jan 2020 03:40:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579174829; cv=none; d=google.com; s=arc-20160816; b=C1X3XPG05lMbAfZEVsm56OrYHKGcurwW2mRKcz/EWd3geCABtKVMsu/mOFVkvXIqS2 WsZKtma/qeX48hcRdzFfTm7zfI7H85VK3PuKUBE4GEOhEGpHZKcZWdZHHy60f0iAxPLi 4PX2wVlJIPVCvgY1++PupYt7ofiF+xXVRni96i1HBNzAR/Y3OMHHuKd1TAvEUJFcQl2O g2m6x1Tk0hOd52CKg+oVckvyZYBJJzkuTVsqtDCx4IlNb5HTpSiqB7Bu5FI3I9RHfnTp qVVlP+v7JvX9bbFTl2PK3NSIuN4PG4BGgCS6+7cnHefj1szHJnaYM6WNViVN70M+Ies8 8x9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=XQ2WYK66tyT9hqx5BTHGPz07wmp8qftkyUQb3t1BOpU=; b=n1D9KLDLbfB0DIr0uN/yvCtJaEoaIa+uZyV6Y2QKQkaNt4sZ0q2WlQH4wB4YBXaiIM n3AL1i+1SeRTWZkaZg7hHeuwpR6RNY44dxRDkEPNOCU0DsVbMPPRnDsTmoj4gHnL2HC3 KWIaIqhRmdkni+qHlx34rF5VF05h8uDgXTuglH4XXfj/DpgpyfZ1mIXX6hBUwfgtK8XO xuhwaB1lyF5BxRpaPXPViCNfipAcWWkNlfnDboO3E9F6tEovEsOAKZMhohGLbUuIaR94 DPmxM4ujUYspQGZNw3UzSRibTd8VFwsUW5EzkGy5LmuARB2ykm514BqMRqVNBuj5EvVO gi4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dSzoVn31; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si11731194oic.108.2020.01.16.03.40.16; Thu, 16 Jan 2020 03:40:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=dSzoVn31; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726329AbgAPLjR (ORCPT + 99 others); Thu, 16 Jan 2020 06:39:17 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38602 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbgAPLjQ (ORCPT ); Thu, 16 Jan 2020 06:39:16 -0500 Received: by mail-pg1-f194.google.com with SMTP id a33so9764076pgm.5 for ; Thu, 16 Jan 2020 03:39:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XQ2WYK66tyT9hqx5BTHGPz07wmp8qftkyUQb3t1BOpU=; b=dSzoVn31mzKWef/nnHG1uXr6Zxopc4S8CzEfz2r4chbCqgoMBr1WNPGI3UOm05BjXO 9/X4lpg8BxT5BKjIc3NOY4KVOOXKJfWmnwQJH1PXcHMuih7x5I/D7TreTm1h5gqqgdLd OnOQdwnNPQS/8579FMfo96clV/2yMUcT29zZW11W1OoDEcg7esEbyvieb7qeuPzSp+8R WsPrn0XlQDD2p0fQPwevC+to99jaV5yAWNARP0JM1z76Lv0/B0pGtXqIEfUeeJUY5KV2 WqdSTFTgnqQ+D55RWTOwZwgwqsex2a5XXtNtarvAr3cTwgwMbGSMYofXI+eB6WsJlhv5 AOZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XQ2WYK66tyT9hqx5BTHGPz07wmp8qftkyUQb3t1BOpU=; b=j6lUS6v5myP9K9nyhdukVR2PszTu0JOcPYrJ3xWNZ8CZs0eglyW24b8sMs4/wRc6Rh KeuJwfxNG/UK7qEVvlK1X70bFpuJpByyNgwvf0QyHUXzJREG9mtnWFaNlwDNmB/YjEYQ j72vn+1rN3xr6GFvArUGKWG4DUerW3KtmoLNQRX1gcbnLtjqKXFH8APTHQmNS6RYepKv sL4kovJ2eIl6AgOy7C/WXMEz5KcbLXY+0RocJv7G2f5qWmBXGROO/ALJCiTKSvxAVs4w OcZEsA/dTrOIP1k8bmdHIISGoa4BTt6lY6R+gPzKImscp71l8IH+WxAULJ8JeO+ooIu2 gklw== X-Gm-Message-State: APjAAAWOYkkIiLOjKh+A5VQUmc//RPb4lpRG8QfDK09hZNOHBgdmB0jj AqXU7UDFhXTFJ9/qQfdj7zp85wA3mSqf3ueNf14P3w== X-Received: by 2002:a63:358a:: with SMTP id c132mr39524917pga.286.1579174755819; Thu, 16 Jan 2020 03:39:15 -0800 (PST) MIME-Version: 1.0 References: <20200116111449.217744-1-dvyukov@gmail.com> In-Reply-To: <20200116111449.217744-1-dvyukov@gmail.com> From: Andrey Konovalov Date: Thu, 16 Jan 2020 12:39:04 +0100 Message-ID: Subject: Re: [PATCH] kcov: ignore fault-inject and stacktrace To: Dmitry Vyukov Cc: Andrew Morton , Dmitry Vyukov , kasan-dev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 16, 2020 at 12:14 PM Dmitry Vyukov wrote: > > From: Dmitry Vyukov > > Don't instrument 3 more files that contain debugging facilities and > produce large amounts of uninteresting coverage for every syscall. > The following snippets are sprinkled all over the place in kcov > traces in a debugging kernel. We already try to disable instrumentation > of stack unwinding code and of most debug facilities. I guess we > did not use fault-inject.c at the time, and stacktrace.c was somehow > missed (or something has changed in kernel/configs). > This change both speeds up kcov (kernel doesn't need to store these > PCs, user-space doesn't need to process them) and frees trace buffer > capacity for more useful coverage. > > should_fail > lib/fault-inject.c:149 > fail_dump > lib/fault-inject.c:45 > > stack_trace_save > kernel/stacktrace.c:124 > stack_trace_consume_entry > kernel/stacktrace.c:86 > stack_trace_consume_entry > kernel/stacktrace.c:89 > ... a hundred frames skipped ... > stack_trace_consume_entry > kernel/stacktrace.c:93 > stack_trace_consume_entry > kernel/stacktrace.c:86 > > Signed-off-by: Dmitry Vyukov Reviewed-by: Andrey Konovalov > Cc: Andrew Morton > Cc: Andrey Konovalov > Cc: kasan-dev@googlegroups.com > Cc: linux-kernel@vger.kernel.org > --- > kernel/Makefile | 1 + > lib/Makefile | 1 + > mm/Makefile | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/kernel/Makefile b/kernel/Makefile > index e5ffd8c002541..5d935b63f812a 100644 > --- a/kernel/Makefile > +++ b/kernel/Makefile > @@ -30,6 +30,7 @@ KCSAN_SANITIZE_softirq.o = n > # and produce insane amounts of uninteresting coverage. > KCOV_INSTRUMENT_module.o := n > KCOV_INSTRUMENT_extable.o := n > +KCOV_INSTRUMENT_stacktrace.o := n > # Don't self-instrument. > KCOV_INSTRUMENT_kcov.o := n > KASAN_SANITIZE_kcov.o := n > diff --git a/lib/Makefile b/lib/Makefile > index 004a4642938af..6cd19bb3085c5 100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@ -16,6 +16,7 @@ KCOV_INSTRUMENT_rbtree.o := n > KCOV_INSTRUMENT_list_debug.o := n > KCOV_INSTRUMENT_debugobjects.o := n > KCOV_INSTRUMENT_dynamic_debug.o := n > +KCOV_INSTRUMENT_fault-inject.o := n > > # Early boot use of cmdline, don't instrument it > ifdef CONFIG_AMD_MEM_ENCRYPT > diff --git a/mm/Makefile b/mm/Makefile > index 3c53198835479..c9696f3ec8408 100644 > --- a/mm/Makefile > +++ b/mm/Makefile > @@ -28,6 +28,7 @@ KCOV_INSTRUMENT_kmemleak.o := n > KCOV_INSTRUMENT_memcontrol.o := n > KCOV_INSTRUMENT_mmzone.o := n > KCOV_INSTRUMENT_vmstat.o := n > +KCOV_INSTRUMENT_failslab.o := n > > CFLAGS_init-mm.o += $(call cc-disable-warning, override-init) > CFLAGS_init-mm.o += $(call cc-disable-warning, initializer-overrides) > -- > 2.25.0.rc1.283.g88dfdc4193-goog >