Maintainer workflows discussions
 help / color / mirror / Atom feed
From: Hui Su <sh_def@163.com>
To: elver@google.com, dvyukov@google.com
Cc: kasan-dev@googlegroups.com, corbet@lwn.net,
	skhan@linuxfoundation.org, rdunlap@infradead.org,
	workflows@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 4/4] docs: kcsan: document targeted watchpoint sampling
Date: Wed, 14 Oct 2026 18:52:38 +0900	[thread overview]
Message-ID: <20261014095238.2132580-5-sh_def@163.com> (raw)

Describe the KCSAN debugfs target interface, including address and kallsyms
symbol forms, module symbols, disabling the target, and how it relates to
report filters. Clarify CONFIG_KALLSYMS_ALL requirements and that a
symbol target selects only the symbol start address. Warn about
hot-target overhead and clear the target before unloading a module that
owns the address.

Signed-off-by: Hui Su <sh_def@163.com>
---
 Documentation/dev-tools/kcsan.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/dev-tools/kcsan.rst b/Documentation/dev-tools/kcsan.rst
index 8575178aa87f..53cc3e5bc1f0 100644
--- a/Documentation/dev-tools/kcsan.rst
+++ b/Documentation/dev-tools/kcsan.rst
@@ -169,6 +169,23 @@ The file ``/sys/kernel/debug/kcsan`` provides the following interface:
   can be used to silence frequently occurring data races; the whitelist feature
   can help with reproduction and testing of fixes.
 
+* Writing ``target=<address>`` or ``target=<symbol>`` to
+  ``/sys/kernel/debug/kcsan`` enables targeted watchpoint sampling for one
+  address. An instrumented access is eligible for watchpoint setup when its
+  byte range contains the selected address. While targeted sampling is active,
+  non-target accesses do not consume the per-CPU ``kcsan.skip_watch`` interval.
+  Symbol targets are resolved using kallsyms. Naming vmlinux data symbols
+  requires ``CONFIG_KALLSYMS_ALL``, and module symbols use ``module:symbol``.
+  A symbol target selects the symbol's start address, not the full object.
+  Marked atomic accesses remain ineligible for watchpoint setup. This controls
+  watchpoint setup and is independent of report whitelist/blacklist filtering.
+  Write ``target=off`` to restore normal sampling.
+  Matching accesses bypass the normal skip interval, so targeting a hot
+  address can significantly increase KCSAN overhead. Use targeted sampling to
+  focus debugging on a known suspicious location.
+  The target does not hold a module reference; clear it before unloading a
+  module that owns the selected address.
+
 Tuning performance
 ~~~~~~~~~~~~~~~~~~
 
-- 
2.55.0


                 reply	other threads:[~2026-10-14  9:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261014095238.2132580-5-sh_def@163.com \
    --to=sh_def@163.com \
    --cc=corbet@lwn.net \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=skhan@linuxfoundation.org \
    --cc=workflows@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox