DAMON development mailing list
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: sashiko-bot@kernel.org
Cc: SJ Park <sj@kernel.org>, damon@lists.linux.dev
Subject: Re: [RFC PATCH 6/6] selftests/damon/sysfs.py: test damon probes
Date: Wed, 29 Jul 2026 17:07:19 -0700	[thread overview]
Message-ID: <20260730000720.100207-1-sj@kernel.org> (raw)
In-Reply-To: <20260729151934.3B8481F000E9@smtp.kernel.org>

On Wed, 29 Jul 2026 15:19:33 +0000 sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] DamonProbe.stage() completely ignores the error returned when writing to the 'weight' sysfs file, masking potential write failures.
> --
> 
> --- Patch [6]: [RFC PATCH 6/6] selftests/damon/sysfs.py: test damon probes ---
> commit e47c18c7c1e4b19237b2738bc5c072c3c570dcc9
> Author: SJ Park <sj@kernel.org>
> 
> selftests/damon/sysfs.py: test damon probes
> 
> This commit extends sysfs.py to test DAMON probes by committing them via
> sysfs and checking the in-kernel status using drgn.
> 
> > diff --git a/tools/testing/selftests/damon/sysfs.py b/tools/testing/selftests/damon/sysfs.py
> > index 8c2dfc5ed8e04..852b6887a75ce 100755
> > --- a/tools/testing/selftests/damon/sysfs.py
> > +++ b/tools/testing/selftests/damon/sysfs.py
> > @@ -319,7 +319,21 @@ def main():
> >                  intervals_goal=_damon_sysfs.IntervalsGoal(
> >                      access_bp@0, aggrs=3, min_sample_usP00,
> >                      max_sample_us\x10000000),
> > -                update_us 00000),
> > +                update_us 00000,
> > +                probes=_damon_sysfs.DamonProbes(
> > +                    probes=[_damon_sysfs.DamonProbe(
> > +                        weightB,
> 
> [Severity: Medium]
> Will this properly catch setup failures when setting the probe weight?
> 
> When testing DamonProbes, DamonProbe.stage() writes the weight to sysfs
> but overwrites the returned error status without checking it:
> 
> tools/testing/selftests/damon/_damon_sysfs.py:DamonProbe.stage()
> 
>     def stage(self):
>         err = write_file(
>                 os.path.join(self.sysfs_dir(), 'weight'), '%d' % self.weight)
>         return self.filters.stage()
> 
> If the sysfs write fails, such as the kernel rejecting the weight value
> or the sysfs node being absent, the error is silently ignored. Could this
> cause the test suite to proceed as if setup succeeded, leading to false
> positive passes or confusing downstream errors?

Yes, I will fix it.

> 
> [ ... ]
> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260729144738.90895-1-sj@kernel.org?part=6
> 


Thanks,
SJ

      reply	other threads:[~2026-07-30  0:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 14:47 [RFC PATCH 0/6] mm/damon: add kunit and selftests for probes and probe weights SJ Park
2026-07-29 14:47 ` [RFC PATCH 1/6] mm/damon/tests/core-kunit: test damon_commit_filter() SJ Park
2026-07-29 14:52   ` sashiko-bot
2026-07-30  0:01     ` SJ Park
2026-07-29 14:47 ` [RFC PATCH 2/6] mm/damon/tests/core-kunit: add damon_commit_probes() test SJ Park
2026-07-29 15:00   ` sashiko-bot
2026-07-30  0:04     ` SJ Park
2026-07-29 14:47 ` [RFC PATCH 3/6] selftests/damon/_damon_sysfs: implement DamonProbes SJ Park
2026-07-29 15:04   ` sashiko-bot
2026-07-30  0:06     ` SJ Park
2026-07-29 14:47 ` [RFC PATCH 4/6] selftests/damon/drgn_dump_damon_status: dump probes SJ Park
2026-07-29 14:47 ` [RFC PATCH 5/6] selftests/damon/sysfs.py: extend commit assertion function for probes SJ Park
2026-07-29 14:47 ` [RFC PATCH 6/6] selftests/damon/sysfs.py: test damon probes SJ Park
2026-07-29 15:19   ` sashiko-bot
2026-07-30  0:07     ` SJ Park [this message]

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=20260730000720.100207-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-bot@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