From patchwork Mon Jul 22 22:37:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 13739202 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97A99C3DA5D for ; Mon, 22 Jul 2024 22:37:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE1786B0083; Mon, 22 Jul 2024 18:37:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C91246B0088; Mon, 22 Jul 2024 18:37:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B58656B0089; Mon, 22 Jul 2024 18:37:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 991D66B0083 for ; Mon, 22 Jul 2024 18:37:35 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EB03381936 for ; Mon, 22 Jul 2024 22:37:34 +0000 (UTC) X-FDA: 82368851628.03.7975971 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) by imf29.hostedemail.com (Postfix) with ESMTP id 76B10120020 for ; Mon, 22 Jul 2024 22:37:32 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=nbYbTP9Z; spf=pass (imf29.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721687806; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=r0s2bcH9kroSUN7wqiU+85l1vjvMcUHeZz27ffRte2E=; b=csbA5J5pUy3NkjTAN5K0tGDZNYIb3KO1dYHmlKrAc3iC809TLNdR1YwKC1SHp3Y2wNWon4 AMac94K4a/oI4x7QKC5PIwa4VQztwmCROZKDXHECH6ZzNrBqXXiVf+1F3H8G0niJjzG6jO 4yl6BoJdzcPZjhpAFTltVTbJKcGArQU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721687806; a=rsa-sha256; cv=none; b=hQoJBvN0euHUBFMJa5Uo4M33HUFrLRdA5ttEfkMehqHgJW3qyBYEtvytad5RHItiOslXjQ ibkSvLjrQEwtfGm4cJLXEhqQ1A4jtMEj62YPQcMKvd0YCme7baxfm6BXQPUAECntu/C//i Z7wDHWEwKEtZc24aNdgfbA4QcRBJHXk= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=nbYbTP9Z; spf=pass (imf29.hostedemail.com: domain of andrey.konovalov@linux.dev designates 95.215.58.176 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: dvyukov@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1721687850; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=r0s2bcH9kroSUN7wqiU+85l1vjvMcUHeZz27ffRte2E=; b=nbYbTP9ZQMvO+c6cZtJGWfuX+yFlD4hTwLChUAOegCs1VOBNqzOLrsRDx84u4fH+aBeT2S yw/N3ZH0fArrRp0YFAPQ3eYQE7hkQmrIgmZ6F+/taOc66QhcOnlbkrxfElc1NMqcn0Xy9i JJguMxXR6VteDV8Sq9Es+SDs80E0wlc= X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: andreyknvl@gmail.com X-Envelope-To: nogikh@google.com X-Envelope-To: elver@google.com X-Envelope-To: glider@google.com X-Envelope-To: kasan-dev@googlegroups.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: yury.norov@gmail.com X-Envelope-To: linux@rasmusvillemoes.dk X-Envelope-To: linux-kernel@vger.kernel.org X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: andrey.konovalov@linux.dev To: Dmitry Vyukov , Andrew Morton Cc: Andrey Konovalov , Aleksandr Nogikh , Marco Elver , Alexander Potapenko , kasan-dev@googlegroups.com, linux-mm@kvack.org, Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [PATCH] kcov: don't instrument lib/find_bit.c Date: Tue, 23 Jul 2024 00:37:26 +0200 Message-Id: <20240722223726.194658-1-andrey.konovalov@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 4bm6gnodnkhjkaywcgo685knti6hsjng X-Rspamd-Queue-Id: 76B10120020 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1721687852-173729 X-HE-Meta: U2FsdGVkX1+tGpTYRet0oMu8vfFogdJgbL2lZ1Cc7NPJmYowZhNTvSfiCL5pbzi5NB0M++yXoGJ1AgPRl1e1WooZlmB2gwLZOPbNATm5fLjl179bhzOjGOvgwvfwV/V9NPh8+D9v0nsDLcoD94N5Q4cJ/spwmxLsVRK/jZfqw+TuOfmJTIp63XerlP5nR4A6ICAqwVMANRy8H4I92cg90jIp0pyL4WjSxFnK/+5JDWhO+DnN+z+y5Omtvcu8lNxzRQLl1c5hSGErwcfr9p07W4KLT9ssmapHZ5P53Msj4yOjsTNx8H5ETc7XHINxP7RkA7fEabGyb7XTjvsHmBpkQZO1EbKXUn/H0/TdmGM7Ta9lA9phcuQsLE5fBs/175K3kjmZSpgjD3CuJQYFWeIo/uiE31/po4Kduzr4ESWEglch+hJEQtBOT36hReE6FU36HNJZ3JyFPyri4ZJnzeQUrWxzCwJouiLQe8zcrD9By7Ktl4Zzm009e2W2K6XxeHxheIQfSKIxLc0tKSQNGhtH7sa9DX53vUP5rt29xljEHcXjXWXCXoepgkqZfBiBGZOXMMuFgDXEfdpiFPNAANCScW1SsmQt2wg2qMyUiISeciWr/sFE3d5exsgffyyNH4rLiwhhpEuhj8GKwUk2XfwSh7TYGxGnGBuf0wQPwVT1sr3SX55+GNTHiPJXY3fUEKj5UO1xsGl6DNjJfVgSPZoRkZFUDR6BcLwnUMehtIS36whUGmQPhMreSXhgm0BrlFxsYLYYAW+mAY/9HPvQJc5dRct9K7sy76lb1YcPeF9WX57wB+180QMHfVHvPRNZNiggYCDFU74cQa5ZMpMvvZPRiUpYRZpU8psFH5Z2i94l6kG2sF4EyGftwUlnoanoj2l4WcaH1Zo0ka1uiSB6cQQQAnow9p84Or2o9dA7R65YWZwUq0noPig56YXXo1iMJTnL5FMYUxJfWS6br308JId w4NgEsOy 7/gbj3Du5bc+WQ+PAvAUH6PlfZpjCMlQOqEo4SedbMuwOKIXDwehFjRG5KdLnHGGKv8cX18MtGt+S24tZFXOWZDLUGiPUqAQVmm1A+Bg97RcTeU/nlpuJip+xyeq4nJZjXSl0rfsgPiBUCag3Slwnq5IZ4B6TByEABFsEO7TkGPJX09AlCPRHlcJnel44S+9hmYsNevWmIxX6GPBOHrv6ab302lzdn17ATHMcjq/wg7GKRO6ErBX61iIvhe1QI5U5w7F6 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Andrey Konovalov This file produces large amounts of flaky coverage not useful for the KCOV's intended use case (guiding the fuzzing process). Signed-off-by: Andrey Konovalov Reviewed-by: Dmitry Vyukov --- I noticed this while running one of the syzkaller's programs. In one run of the program, the number of KCOV entries amounts to ~300k, with the top ones: 117285 /home/user/src/lib/find_bit.c:137 (discriminator 10) 116752 /home/user/src/lib/find_bit.c:137 (discriminator 3) 2455 /home/user/src/lib/vsprintf.c:2559 2033 /home/user/src/fs/kernfs/dir.c:317 1662 /home/user/src/fs/kernfs/kernfs-internal.h:72 ... In another run (that triggers exactly the same behavior in the kernel), the amount of entries drops to ~110k: 7141 /home/user/src/lib/find_bit.c:137 (discriminator 10) 7110 /home/user/src/lib/find_bit.c:137 (discriminator 3) 2455 /home/user/src/lib/vsprintf.c:2559 2033 /home/user/src/fs/kernfs/dir.c:317 1662 /home/user/src/fs/kernfs/kernfs-internal.h:72 ... With this patch applied, the amount of KCOV entries for the same program remains somewhat stable at ~100k. --- lib/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Makefile b/lib/Makefile index 322bb127b4dc..0fde1c360f32 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -14,6 +14,7 @@ KCOV_INSTRUMENT_list_debug.o := n KCOV_INSTRUMENT_debugobjects.o := n KCOV_INSTRUMENT_dynamic_debug.o := n KCOV_INSTRUMENT_fault-inject.o := n +KCOV_INSTRUMENT_find_bit.o := n # string.o implements standard library functions like memset/memcpy etc. # Use -ffreestanding to ensure that the compiler does not try to "optimize"