Skip to contentSkip to conversation

selftests/damon: change wrong json.dump usage to json.dumps

PATCH Superseded Sang-Heon Jeon 2 participants 3 messages Aug 15, 2025 – Aug 16, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/damon: change wrong json.dump usage to json.dumps

To print drgn status to stdout json.dumps should be used without json.dump. Change incorrect function call by typo.

Fixes 441f487d6ebf ("selftests/damon: test no-op commit broke DAMON status")

---
First I'm sorry that make you guys work twice. This is fix of my last patch [1]. I'll be more careful next time.

[1] https://lore.kernel.org/damon/[email protected]/

---
 tools/testing/selftests/damon/sysfs_no_op_commit_break.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/damon/sysfs_no_op_commit_break.py +2 -2
index f557587ebc81..2c65cffe6b54 100755
@@ -62,8 +62,8 @@ def main():
         exit(1)
 
     if before_commit_status != after_commit_status:
-        print(f'before: {json.dump(before_commit_status, indent=2)}')
-        print(f'after: {json.dump(after_commit_status, indent=2)}')
+        print(f'before: {json.dumps(before_commit_status, indent=2)}')
+        print(f'after: {json.dumps(after_commit_status, indent=2)}')
         exit(1)
 
     kdamonds.stop()
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · On Fri, 15 Aug 2025 18:40:29 +0900 Sang-Heon Jeon <[email protected]> wrote:

To print drgn status to stdout json.dumps should be used without json.dump. Change incorrect function call by typo.

Fixes 441f487d6ebf ("selftests/damon: test no-op commit broke DAMON status")

Seems the fixee commit is on mm-unstable now. Since this commit ids on the tree is unreliable, I usually add a comment, like below.

Fixes 441f487d6ebf ("selftests/damon: test no-op commit broke DAMON status") # mm-unstable

Also, add the destination branch on patch subject prefix, like,

[PATCH mm-unstable] selftests/damon: change wrong json.dump usage to json.dumps

These are only my personal and undocumented conventions. I'm not sure if this helps others, but it would help me. Please consider using these conventions for DAMON patches in future. I'll document this on DAMON maintainer-profile document.

Quoted 1 line
Quoted 5 lines

---
First I'm sorry that make you guys work twice. This is fix of my last patch [1]. I'll be more careful next time.

[1] https://lore.kernel.org/damon/[email protected]/

Thank you for clarifying the context.

Thanks,
SJ

[...]

#2 lore raw
Quoted 6 lines · SeongJae Park
Quoted 3 lines · On Fri, 15 Aug 2025 18:40:29 +0900 Sang-Heon Jeon <[email protected]> wrote:

To print drgn status to stdout json.dumps should be used without json.dump. Change incorrect function call by typo.

Quoted 6 lines
Quoted 1 line
Fixes 441f487d6ebf ("selftests/damon: test no-op commit broke DAMON status")

Seems the fixee commit is on mm-unstable now. Since this commit ids on the tree is unreliable, I usually add a comment, like below.

Fixes 441f487d6ebf ("selftests/damon: test no-op commit broke DAMON status") # mm-unstable

I'll keep it my mind.

Quoted 8 lines

Also, add the destination branch on patch subject prefix, like,

[PATCH mm-unstable] selftests/damon: change wrong json.dump usage to json.dumps

These are only my personal and undocumented conventions. I'm not sure if this helps others, but it would help me. Please consider using these conventions for DAMON patches in future. I'll document this on DAMON maintainer-profile document.

Sure, I'll follow your convention. Maybe If I don't follow, it just means that I couldn't understand your comment and future document well, haha.

Quoted 4 lines
Quoted 1 line
Quoted 8 lines
Quoted 5 lines

---
First I'm sorry that make you guys work twice. This is fix of my last patch [1]. I'll be more careful next time.

[1] https://lore.kernel.org/damon/[email protected]/

Thank you for clarifying the context.

The pleasure is mine.

Quoted 4 lines

Thanks,
SJ

[...]

Best Regards.
Sang-Heon Jeon