> >
> > Signed-off-by: Sang-Heon Jeon <
ekffu200098@gmail.com>
> > ---
> > tools/testing/selftests/damon/Makefile | 1 +
> > .../damon/sysfs_no_op_commit_break.py | 78 +++++++++++++++++++
> > 2 files changed, 79 insertions(+)
> > create mode 100755 tools/testing/selftests/damon/sysfs_no_op_commit_break.py
> >
> > diff --git a/tools/testing/selftests/damon/Makefile b/tools/testing/selftests/damon/Makefile
> > index 5b230deb19e8..44a4a819df55 100644
> > --- a/tools/testing/selftests/damon/Makefile
> > +++ b/tools/testing/selftests/damon/Makefile
> > @@ -17,6 +17,7 @@ TEST_PROGS += reclaim.sh lru_sort.sh
> > TEST_PROGS += sysfs_update_removed_scheme_dir.sh
> > TEST_PROGS += sysfs_update_schemes_tried_regions_hang.py
> > TEST_PROGS += sysfs_memcg_path_leak.sh
> > +TEST_PROGS += sysfs_no_op_commit_break.py
> >
> > EXTRA_CLEAN = __pycache__
> >
> > diff --git a/tools/testing/selftests/damon/sysfs_no_op_commit_break.py b/tools/testing/selftests/damon/sysfs_no_op_commit_break.py
> > new file mode 100755
> > index 000000000000..300cdbaa7eda
> > --- /dev/null
> > +++ b/tools/testing/selftests/damon/sysfs_no_op_commit_break.py
> > @@ -0,0 +1,78 @@
> > +#!/usr/bin/env python3
> > +# SPDX-License-Identifier: GPL-2.0
> > +
> > +import json
> > +import os
> > +import subprocess
> > +import sys
> > +
> > +import _damon_sysfs
> > +
> > +def dump_damon_status_dict(pid):
> > + try:
> > + subprocess.check_output(['which', 'drgn'], stderr=subprocess.DEVNULL)
> > + except:
> > + return None, 'drgn not found'
> > + file_dir = os.path.dirname(os.path.abspath(__file__))
> > + dump_script = os.path.join(file_dir, 'drgn_dump_damon_status.py')
> > + rc = subprocess.call(['drgn', dump_script, pid, 'damon_dump_output'],
> > + stderr=subprocess.DEVNULL)
> > +
> > + if rc != 0:
> > + return None, f'drgn fail : return code({rc})'
>
> Let's not add a space before ':', for the consistency.