Skip to contentSkip to conversation

selftests/damon: trivial fixes

PATCH Superseded Yuanchu Xie 4 participants 10 messages Feb 18, 2022 – Apr 18, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover selftests/damon: trivial fixes

These patches fixes trivial errors with building
and running DAMON selftests.

Yuanchu Xie (2):
selftests/damon: add damon to selftests root Makefile selftests/damon: make selftests executable

 tools/testing/selftests/Makefile                               | 1 +
 tools/testing/selftests/damon/debugfs_attrs.sh                 | 0
 tools/testing/selftests/damon/debugfs_empty_targets.sh         | 0
 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh | 0
 tools/testing/selftests/damon/debugfs_schemes.sh               | 0
 tools/testing/selftests/damon/debugfs_target_ids.sh            | 0
 6 files changed, 1 insertion(+)
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_empty_targets.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_schemes.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_target_ids.sh
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
#1 lore raw

PATCH 1/2 selftests/damon: add damon to selftests root Makefile

Currently the damon selftests are not built with the rest of the selftests. We add damon to the list of targets.

Fixes b348eb7abd09 ("mm/damon: add user space selftests")
---
 tools/testing/selftests/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/Makefile +1 -0
index d08fe4cfe811..ffe453760a12 100644
@@ -9,6 +9,7 @@ TARGETS += clone3
 TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
+TARGETS += damon
 TARGETS += drivers/dma-buf
 TARGETS += efivarfs
 TARGETS += exec
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] selftests/damon: add damon to selftests root Makefile

Hi Yuanchu, thank you for this patch!

Quoted 5 lines · On Fri, 18 Feb 2022 00:10:16 +0000 Yuanchu Xie <[email protected]> wrote:

Currently the damon selftests are not built with the rest of the selftests. We add damon to the list of targets.

Fixes b348eb7abd09 ("mm/damon: add user space selftests")

Thanks,
SJ

Quoted 18 lines
---
 tools/testing/selftests/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/Makefile +1 -0
index d08fe4cfe811..ffe453760a12 100644
@@ -9,6 +9,7 @@ TARGETS += clone3
 TARGETS += core
 TARGETS += cpufreq
 TARGETS += cpu-hotplug
+TARGETS += damon
 TARGETS += drivers/dma-buf
 TARGETS += efivarfs
 TARGETS += exec
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
#3 lore raw

PATCH 2/2 selftests/damon: make selftests executable

In reply to Yuanchu Xie

The damon selftests do not have the executable bit on. We fix that by setting the x bits on the .sh files similar to other existing shell selftests.

Fixes 9ab3b0c8ef62 ("selftests/damon: split test cases")
---
 tools/testing/selftests/damon/debugfs_attrs.sh                 | 0
 tools/testing/selftests/damon/debugfs_empty_targets.sh         | 0
 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh | 0
 tools/testing/selftests/damon/debugfs_schemes.sh               | 0
 tools/testing/selftests/damon/debugfs_target_ids.sh            | 0
 5 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_empty_targets.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_schemes.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_target_ids.sh
tools/testing/selftests/damon/debugfs_attrs.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_empty_targets.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_huge_count_read_write.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_schemes.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_target_ids.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Hello Yuanchu,

Thank you for this patch!

Quoted 6 lines · On Fri, 18 Feb 2022 00:10:17 +0000 Yuanchu Xie <[email protected]> wrote:

The damon selftests do not have the executable bit on. We fix that by setting the x bits on the .sh files similar to other existing shell selftests.

Fixes 9ab3b0c8ef62 ("selftests/damon: split test cases")

Thanks,
SJ

Quoted 30 lines
---
 tools/testing/selftests/damon/debugfs_attrs.sh                 | 0
 tools/testing/selftests/damon/debugfs_empty_targets.sh         | 0
 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh | 0
 tools/testing/selftests/damon/debugfs_schemes.sh               | 0
 tools/testing/selftests/damon/debugfs_target_ids.sh            | 0
 5 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_attrs.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_empty_targets.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_huge_count_read_write.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_schemes.sh
 mode change 100644 => 100755 tools/testing/selftests/damon/debugfs_target_ids.sh
tools/testing/selftests/damon/debugfs_attrs.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_empty_targets.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_huge_count_read_write.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_schemes.sh +0 -0
old mode 100644
new mode 100755
tools/testing/selftests/damon/debugfs_target_ids.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.35.1.265.g69c8d7142f-goog
#5 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Quoted 6 lines · SeongJae Park

Hello Yuanchu,

Thank you for this patch!

On Fri, 18 Feb 2022 00:10:17 +0000 Yuanchu Xie <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines

The damon selftests do not have the executable bit on. We fix that by setting the x bits on the .sh files similar to other existing shell selftests.

Fixes 9ab3b0c8ef62 ("selftests/damon: split test cases")

This type of change does not work outside of git, so why not just make the tool that calls these scripts not care about the executable bit like we do for other scripts?

thanks,

greg k-h

maintainer
#6 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Quoted 11 lines · On Fri, 18 Feb 2022 09:01:11 +0100 Greg KH <[email protected]> wrote:
Quoted 10 lines · SeongJae Park

Hello Yuanchu,

Thank you for this patch!

Quoted 4 lines · On Fri, 18 Feb 2022 00:10:17 +0000 Yuanchu Xie <[email protected]> wrote:

The damon selftests do not have the executable bit on. We fix that by setting the x bits on the .sh files similar to other existing shell selftests.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Fixes 9ab3b0c8ef62 ("selftests/damon: split test cases")

This type of change does not work outside of git, so why not just make the tool that calls these scripts not care about the executable bit like we do for other scripts?

Actually, we made kselftest receives scripts having no executable bit[1], though it still prints warning. I guess Yuanchu wants to remove the warning?

To remove the warning, simply making kselftest (runner.sh) stop printing the warning message might make more sense. Nevertheless, it's also true that letting some scripts have executable bits while others not looks inconsistent to me. That's why I left the warning message there. Should we remove the warning from kselftest and remove executable bits from other selftest test scripts? Or, let the inconsistency be? I have no real opinion here, so just wanted to hear others' opinion if possible.

BTW, similar issue is also in Kconfig's 'shell' macro. For example, 'runst-version.sh' on -mm tree bothered me before[2], and now 'pahole-version.sh'. I might make change in 'scrips/Kconfig/preprocess.c' later.

[1] https://lore.kernel.org/linux-kselftest/[email protected]/
[2] https://lore.kernel.org/all/[email protected]/

Thanks,
SJ

Quoted 4 lines

thanks,

greg k-h

maintainer
#7 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Quoted 25 lines · SeongJae Park
Quoted 11 lines · On Fri, 18 Feb 2022 09:01:11 +0100 Greg KH <[email protected]> wrote:
Quoted 10 lines · SeongJae Park

Hello Yuanchu,

Thank you for this patch!

Quoted 4 lines · On Fri, 18 Feb 2022 00:10:17 +0000 Yuanchu Xie <[email protected]> wrote:

The damon selftests do not have the executable bit on. We fix that by setting the x bits on the .sh files similar to other existing shell selftests.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Fixes 9ab3b0c8ef62 ("selftests/damon: split test cases")

This type of change does not work outside of git, so why not just make the tool that calls these scripts not care about the executable bit like we do for other scripts?

Actually, we made kselftest receives scripts having no executable bit[1], though it still prints warning. I guess Yuanchu wants to remove the warning?

Quoted 8 lines

To remove the warning, simply making kselftest (runner.sh) stop printing the warning message might make more sense. Nevertheless, it's also true that letting some scripts have executable bits while others not looks inconsistent to me. That's why I left the warning message there. Should we remove the warning from kselftest and remove executable bits from other selftest test scripts? Or, let the inconsistency be? I have no real opinion here, so just wanted to hear others' opinion if possible.

I don't recall why we decided to add the check in runner.sh - let's keep them consistent with the rest of the scripts. If we get rid of the check, we can make the change then.

thanks,
-- Shuah

#8 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Quoted 8 lines

I don't recall why we decided to add the check in runner.sh - let's keep them
consistent with the rest of the scripts. If we get rid of the check, we can make the change then.

thanks,
-- Shuah

It seems reasonable to add the x bit for these tests to be consistent with the rest.

I also received an email from a [email protected] telling me my patch series was included in shuah/linux-kselftest.git, but that does not seem to be the case.
Is this a bug?

Hello:

Quoted 1 line

This series was applied to shuah/linux-kselftest.git (next)

by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 18 Feb 2022 00:10:15 +0000 you wrote:
Quoted 7 lines

These patches fixes trivial errors with building
and running DAMON selftests.

Yuanchu Xie (2):
selftests/damon: add damon to selftests root Makefile selftests/damon: make selftests executable

Quoted 8 lines
Quoted 1 line

[...]

Here is the summary with links:
- [1/2] selftests/damon: add damon to selftests root Makefile (no matching commit)
- [2/2] selftests/damon: make selftests executable

    https://git.kernel.org/shuah/linux-kselftest/c/1335648f0b6f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

#9 lore raw

Re: [PATCH 2/2] selftests/damon: make selftests executable

Quoted 6 lines

I don't recall why we decided to add the check in runner.sh - let's keep them consistent with the rest of the scripts. If we get rid of the check, we can make the change then.

thanks,
-- Shuah

It seems reasonable to add the x bit for these tests to be consistent with the rest.

I also received an email from a [email protected] telling me my patch series was included in shuah/linux-kselftest.git, but that does not seem to be the case.
Is this a bug?

Sorry about the previous non-plain-text email. I never replied to anyone before and didn't know what I was doing.

Quoted 29 lines

Hello:

This series was applied to shuah/linux-kselftest.git (next)

by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Fri, 18 Feb 2022 00:10:15 +0000 you wrote:

These patches fixes trivial errors with building
and running DAMON selftests.

Yuanchu Xie (2):
selftests/damon: add damon to selftests root Makefile selftests/damon: make selftests executable

[...]

Here is the summary with links:
- [1/2] selftests/damon: add damon to selftests root Makefile (no matching commit)
- [2/2] selftests/damon: make selftests executable

    https://git.kernel.org/shuah/linux-kselftest/c/1335648f0b6f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html