From nobody Mon May 25 02:43:15 2026 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 711FA2EA172 for ; Tue, 19 May 2026 16:06:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206779; cv=none; b=jWfVsJSSJFDYqQ+HiVaTkPAIipKMxTwwkNj+0tIncAn1AcJuM5jOvHMUsCLdOcc6if8Lt9SAai5p/TrQjrE05QipucCY7YRaq2kJx8Sa9snCJrlb2N3diRsxVwcqECJrq7iVlRc4w6YvkryP/sGrBlHr02MUggKucxO8u5yGY5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779206779; c=relaxed/simple; bh=C/B1lVeaTtz/ePR47+xtpJBJq2QL3rrVqLcpcHgIF4U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=kGAnbJdPQEYFq8p7kPLKeEo+sghmzUiA+qdEH1uaSraHwJt8oQl/YesjugaIQB8N4gjlRJivembMol/CaXpeGFtQRqMvlDFuYv3Vp8MDaWmYr+b7w3g5p/EAnFWdPq6Eldbk3s9N//0C8GdU9ldjTF1H45uwe35RhfO9A/2CzdE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=S/71Y0ur; arc=none smtp.client-ip=209.85.128.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="S/71Y0ur" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-48d1c670255so1895e9.0 for ; Tue, 19 May 2026 09:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1779206776; x=1779811576; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=WVT2pddk3gcPsEHsiwSHH91UEq8/qd9iT2XxZfTaW38=; b=S/71Y0urR7GMC+tuj6jGex2cxotxz/n0epoinKt+2+RB7whlJE04ug+dkEK4oTTA4o g6TfcBavysSs5uqUkUZ0PCzYQr1g9Xt1VGJyM9C+NIgBQxTkQ4eCyD4wgdCwmrcUgPkB I3/LIw7t8KRMdYhNtJydWgfFqp+d4gDPoCLTtfF5Wi49Bxq9wKzcSNdG/K6gGpvWUXj2 +L4X2Mndqu+hQcqGw/QHZiu2FXhD9uaQrH0Ocht2RPggOJfl2bPYernc5VXY2+WNSoO6 HcMY+YjDmVG8rgdMvPUwJMg1079PRPhcizIdZwu0ugiCxtdFz4gwzhLk1oHBUDkGEbBn c+pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779206776; x=1779811576; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WVT2pddk3gcPsEHsiwSHH91UEq8/qd9iT2XxZfTaW38=; b=FfzpRo/F5+Y8+5vFtYhdkU2iV72XWNdATAvTDeRV9u7aPfLIsVi45mhqPJQ6Mlsdi5 gYoraLTHOS0Nw6pwuZkS8uS3sHxZHGGoQzIWBXTO1d6KS4lFaBwFImgU0EYWrYBV3OiQ e8lSI5BK35gKSWiXA1RNvcSbLIU6KV0o/9dN0pyjotmTuSrFK4aL4tq8n8hCfiUj9epx AWAzf8lfh0SsuudnvRFCJW4Hpuk/Kqp2WJMAPIdNZgUc+T6kU0AwTnDaApxuJSQyc9Fd bd74oGo03MWK8+BoRS209EQwlUa0sbweKeJdKTcm4j3XC0WUbFdo185UMOde8WCjJHG2 7WTA== X-Gm-Message-State: AOJu0YyfFlK5pNFIsY8W8pxrsdJH6wmtMsyW1UVpETPsSjr6ay015tWp A8AUSP4wcvAO/INSJcYT7m0NEO53u+PNSRGG4br+57zUSPgfr0a1SfbN+A+OK7twtA== X-Gm-Gg: Acq92OH3JR6WSsrFVmXjQ09neCkLjQYusP3PO9ySBhAbMq6653dPYME52ZWi8lceRSM 9uddeqRck8KJfAo62mwvAaM1h/Asq/8AMh/eGjnbcoBVEeS76N24baKp8qAKoLfoWB/0nFMatKM no03H73dUFJYMzd72lI2ZogOeBWDd2yAG/Srn5ttK6vkSrVsfbc9zPsCAvH7NmF4a3DNPe+6fJP EwH5vQBmfyjo263krtSsB9NrlBRLnev1pgebwQK6nAQGYsesxmSZ7gxrBIt/RVJS6KqR3Srp4Bo g+w7PJ25NCrHiH838jdH8jUA2opl4Yy+pdyULDXsXZxqji8wx7zzunBECRYNDpYwRTrJ9cCqIue hciIEoRfvOjHrho4iKaOfjNUazL+5KzNcLO+Yfa7Wsi/XypZng0GSsfDqq3ItRIsgOcjqvbJf1M H2YMXMJ1qbNTgQqvr3UsXSGOffewi30esUtFoxuK63o08eBYA3ll8lIUlVKMq9vg== X-Received: by 2002:a05:600c:1716:b0:477:86fd:fb49 with SMTP id 5b1f17b1804b1-48ffa5f3d4amr3145995e9.10.1779206775352; Tue, 19 May 2026 09:06:15 -0700 (PDT) Received: from localhost ([2a00:79e0:288a:8:c208:c046:d3db:6b00]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45d9e767ee0sm43809711f8f.1.2026.05.19.09.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 09:06:14 -0700 (PDT) From: Jann Horn Date: Tue, 19 May 2026 18:06:06 +0200 Subject: [PATCH] kcov: update documentation on remote coverage collection Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260519-kcov-docs-v1-1-5bb22f4cb20c@google.com> X-B4-Tracking: v=1; b=H4sIAG2KDGoC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIzMDU0NL3ezk/DLdlPzkYl1D07TUxKS0JEODxEQloPqCotS0zAqwWdGxtbU A8I3/SVsAAAA= X-Change-ID: 20260519-kcov-docs-15feabfb10aa To: Alexander Potapenko , Dmitry Vyukov , Andrey Konovalov , kasan-dev@googlegroups.com, Andrew Morton Cc: linux-kernel@vger.kernel.org, Jann Horn X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1779206771; l=1875; i=jannh@google.com; s=20240730; h=from:subject:message-id; bh=C/B1lVeaTtz/ePR47+xtpJBJq2QL3rrVqLcpcHgIF4U=; b=UMD2GfdBFg8qv4WM8ISpBbB9D3mPNBsM9ExxW0iH3LCsQ3wlDh7JJTraam6ArX3K13Yl+Lpgz BejPJ8jSt8PAPRi0Raru6UQvVomVi1slILZ7pi+8bxG/7BofkjRgiM9 X-Developer-Key: i=jannh@google.com; a=ed25519; pk=AljNtGOzXeF6khBXDJVVvwSEkVDGnnZZYqfWhP1V+C8= Adjust the docs on remote coverage collection to reflect the changes made in "kcov: refactor common handle ID into kcov_common_handle_id" and "kcov: allow simultaneous KCOV_ENABLE/KCOV_REMOTE_ENABLE". Suggested-by: Alexander Potapenko Signed-off-by: Jann Horn Reviewed-by: Alexander Potapenko --- Documentation/dev-tools/kcov.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/dev-tools/kcov.rst b/Documentation/dev-tools/kco= v.rst index 8127849d40f5..54a0baeb917a 100644 --- a/Documentation/dev-tools/kcov.rst +++ b/Documentation/dev-tools/kcov.rst @@ -246,6 +246,8 @@ KCOV supports collecting remote coverage from the follo= wing contexts: 2. Local kernel background tasks. These are spawned when a userspace proce= ss interacts with some kernel interface and are usually killed when the pr= ocess exits (e.g. vhost workers). + This can be combined with another KCOV instance that is configured for = normal + coverage collection. =20 3. Soft interrupts. =20 @@ -262,6 +264,9 @@ gets saved to the ``kcov_handle`` field in the current = ``task_struct`` and needs to be passed to the newly spawned local tasks via custom kernel code modifications. Those tasks should in turn use the passed handle in their ``kcov_remote_start`` and ``kcov_remote_stop`` annotations. +In the kernel, common handles are wrapped in a ``kcov_common_handle_id``, = which +consumes no space in builds without ``CONFIG_KCOV``; subsystems that integ= rate +with this mechanism should not need to use any ``#ifdef CONFIG_KCOV`` or s= uch. =20 KCOV follows a predefined format for both global and common handles. Each handle is a ``u64`` integer. Currently, only the one top and the lower 4 b= ytes --- base-commit: ab5fce87a778cb780a05984a2ca448f2b41aafbf change-id: 20260519-kcov-docs-15feabfb10aa -- =20 Jann Horn