public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean
       [not found] <CA+icZUUOckm1kwOEZhSw8zsaL5z7r8uczwiKeKGEVioZ=GeFNg@mail.gmail.com>
@ 2023-01-17 15:40 ` Wysocki, Rafael J
  2023-01-17 16:48   ` Doug Smythies
  0 siblings, 1 reply; 4+ messages in thread
From: Wysocki, Rafael J @ 2023-01-17 15:40 UTC (permalink / raw)
  To: Huang Rui, Doug Smythies; +Cc: linux-kernel, sedat.dilek, Jinzhou Su, linux-pm


On 1/17/2023 3:03 PM, Sedat Dilek wrote:
> Hi,
>
> I regularly test:
>
> $ LANG=C LC_ALL=C make -C tools/ clean 2>&1 | tee ../make-log_tools-clean.txt
>
> This removes:
>
> $ git status -s
> D tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py
> D tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
>
> Checking the log:
>
> $ grep pstate_tracer.py ../make-log_tools-clean.txt
> 89:rm -f -r   /home/dileks/src/linux/git/tools/testing/selftests/amd-pstate/../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
> /home/dileks/src/linux/git/tools/t
> esting/selftests/amd-pstate/../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
>
> Is that intended or not?

I don't think so.

Doug?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean
  2023-01-17 15:40 ` [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean Wysocki, Rafael J
@ 2023-01-17 16:48   ` Doug Smythies
  2023-01-17 17:50     ` Sedat Dilek
  2023-01-17 17:56     ` Sedat Dilek
  0 siblings, 2 replies; 4+ messages in thread
From: Doug Smythies @ 2023-01-17 16:48 UTC (permalink / raw)
  To: 'Wysocki, Rafael J', 'Huang Rui', li.meng
  Cc: linux-kernel, sedat.dilek, 'Jinzhou Su', linux-pm,
	Doug Smythies

On 2023.01.17 07:40 Rafael wrote:
> On 1/17/2023 3:03 PM, Sedat Dilek wrote:
>> Hi,
>> I regularly test:
>> $ LANG=C LC_ALL=C make -C tools/ clean 2>&1 | tee ../make-log_tools-clean.txt
>> This removes:
>>
>> $ git status -s
>> D tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py
>> D tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
>>
>> Checking the log:
>>
>> $ grep pstate_tracer.py ../make-log_tools-clean.txt
>> 89:rm -f -r   /home/dileks/src/linux/git/tools/testing/selftests/amd-pstate/../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
>> /home/dileks/src/linux/git/tools/t
>> esting/selftests/amd-pstate/../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
>>
>> Is that intended or not?
>
> I don't think so.
>
> Doug?

Nothing should ever remove the intel_pstate_tracer.py source file.

Sedat, Thank you for your report.
I get the same results when running your test.

Note that I know nothing about Makefiles and such, but
think the guilty commit is this one:

commit ba2d788aa873da9c65ff067ca94665853eab95f0
Author: Meng Li <li.meng@amd.com>
Date:   Mon Oct 31 16:49:22 2022 +0800

    selftests: amd-pstate: Trigger tbench benchmark and test cpus

    Add tbench.sh trigger the tbench testing and monitor the cpu desire
    performance, frequency, load, power consumption and throughput etc.

    Signed-off-by: Meng Li <li.meng@amd.com>
    Acked-by: Huang Rui <ray.huang@amd.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

diff --git a/tools/testing/selftests/amd-pstate/Makefile b/tools/testing/selftests/amd-pstate/Makefile
index 6f4c7b01e3bb..cac8dedb7226 100644
--- a/tools/testing/selftests/amd-pstate/Makefile
+++ b/tools/testing/selftests/amd-pstate/Makefile
@@ -4,7 +4,15 @@
 # No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
 all:

+uname_M := $(shell uname -m 2>/dev/null || echo not)
+ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
+
+ifeq (x86,$(ARCH))
+TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
+TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
+endif
+
 TEST_PROGS := run.sh
-TEST_FILES := basic.sh
+TEST_FILES := basic.sh tbench.sh

 include ../lib.mk
diff --git a/tools/testing/selftests/amd-pstate/run.sh b/tools/testing/selftests/amd-pstate/run.sh
...

And if I do this:

doug@s19:~/kernel/linux$ git diff
diff --git a/tools/testing/selftests/amd-pstate/Makefile b/tools/testing/selftests/amd-pstate/Makefile
index 5f195ee756d6..5fd1424db37d 100644
--- a/tools/testing/selftests/amd-pstate/Makefile
+++ b/tools/testing/selftests/amd-pstate/Makefile
@@ -7,11 +7,6 @@ all:
 uname_M := $(shell uname -m 2>/dev/null || echo not)
 ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)

-ifeq (x86,$(ARCH))
-TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
-TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
-endif
-
 TEST_PROGS := run.sh
 TEST_FILES := basic.sh tbench.sh gitsource.sh

The source files do not get deleted with Sedat's test.

... Doug



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean
  2023-01-17 16:48   ` Doug Smythies
@ 2023-01-17 17:50     ` Sedat Dilek
  2023-01-17 17:56     ` Sedat Dilek
  1 sibling, 0 replies; 4+ messages in thread
From: Sedat Dilek @ 2023-01-17 17:50 UTC (permalink / raw)
  To: Doug Smythies
  Cc: Wysocki, Rafael J, Huang Rui, li.meng, linux-kernel, Jinzhou Su,
	linux-pm, Shuah Khan

On Tue, Jan 17, 2023 at 5:48 PM Doug Smythies <dsmythies@telus.net> wrote:
>
> On 2023.01.17 07:40 Rafael wrote:
> > On 1/17/2023 3:03 PM, Sedat Dilek wrote:
> >> Hi,
> >> I regularly test:
> >> $ LANG=C LC_ALL=C make -C tools/ clean 2>&1 | tee ../make-log_tools-clean.txt
> >> This removes:
> >>
> >> $ git status -s
> >> D tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py
> >> D tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> >>
> >> Checking the log:
> >>
> >> $ grep pstate_tracer.py ../make-log_tools-clean.txt
> >> 89:rm -f -r   /home/dileks/src/linux/git/tools/testing/selftests/amd-pstate/../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
> >> /home/dileks/src/linux/git/tools/t
> >> esting/selftests/amd-pstate/../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> >>
> >> Is that intended or not?
> >
> > I don't think so.
> >
> > Doug?
>
> Nothing should ever remove the intel_pstate_tracer.py source file.
>
> Sedat, Thank you for your report.
> I get the same results when running your test.
>
> Note that I know nothing about Makefiles and such, but
> think the guilty commit is this one:
>
> commit ba2d788aa873da9c65ff067ca94665853eab95f0
> Author: Meng Li <li.meng@amd.com>
> Date:   Mon Oct 31 16:49:22 2022 +0800
>
>     selftests: amd-pstate: Trigger tbench benchmark and test cpus
>
>     Add tbench.sh trigger the tbench testing and monitor the cpu desire
>     performance, frequency, load, power consumption and throughput etc.
>
>     Signed-off-by: Meng Li <li.meng@amd.com>
>     Acked-by: Huang Rui <ray.huang@amd.com>
>     Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
>
> diff --git a/tools/testing/selftests/amd-pstate/Makefile b/tools/testing/selftests/amd-pstate/Makefile
> index 6f4c7b01e3bb..cac8dedb7226 100644
> --- a/tools/testing/selftests/amd-pstate/Makefile
> +++ b/tools/testing/selftests/amd-pstate/Makefile
> @@ -4,7 +4,15 @@
>  # No binaries, but make sure arg-less "make" doesn't trigger "run_tests"
>  all:
>
> +uname_M := $(shell uname -m 2>/dev/null || echo not)
> +ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
> +
> +ifeq (x86,$(ARCH))
> +TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
> +TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> +endif
> +
>  TEST_PROGS := run.sh
> -TEST_FILES := basic.sh
> +TEST_FILES := basic.sh tbench.sh
>
>  include ../lib.mk
> diff --git a/tools/testing/selftests/amd-pstate/run.sh b/tools/testing/selftests/amd-pstate/run.sh
> ...
>
> And if I do this:
>
> doug@s19:~/kernel/linux$ git diff
> diff --git a/tools/testing/selftests/amd-pstate/Makefile b/tools/testing/selftests/amd-pstate/Makefile
> index 5f195ee756d6..5fd1424db37d 100644
> --- a/tools/testing/selftests/amd-pstate/Makefile
> +++ b/tools/testing/selftests/amd-pstate/Makefile
> @@ -7,11 +7,6 @@ all:
>  uname_M := $(shell uname -m 2>/dev/null || echo not)
>  ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>
> -ifeq (x86,$(ARCH))
> -TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
> -TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> -endif
> -

[ CC Shuah  due to ba2d788aa873da9c65ff067ca94665853eab95f0 ]

Hi Doug,

I guess some upper top-level Makefile in tools/ remove on PHONY
"clean" *TEST_GEN_FILES*.

Wild git grep-ing:

dileks@iniza:~/src/linux/git$ git grep TEST_GEN_FILES tools/ | sort | grep -i rm

As an example:

tools/testing/selftests/bpf/Makefile:   $(Q)$(RM) -r $(TEST_GEN_FILES)

You are right those files are NOT generated and are permanently stored in .git.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/amd_pstate_tracer/amd_pstate_trace.py

They should not be removed on `make -C tools/ clean`.

So your above changes make sense to me.

If responsible people agree, come with patch :-).

Best regards,
-Sedat-

[1] https://git.kernel.org/linus/ba2d788aa873da9c65ff067ca94665853eab95f0

>  TEST_PROGS := run.sh
>  TEST_FILES := basic.sh tbench.sh gitsource.sh
>
> The source files do not get deleted with Sedat's test.
>
> ... Doug
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean
  2023-01-17 16:48   ` Doug Smythies
  2023-01-17 17:50     ` Sedat Dilek
@ 2023-01-17 17:56     ` Sedat Dilek
  1 sibling, 0 replies; 4+ messages in thread
From: Sedat Dilek @ 2023-01-17 17:56 UTC (permalink / raw)
  To: Doug Smythies
  Cc: Wysocki, Rafael J, Huang Rui, li.meng, linux-kernel, Jinzhou Su,
	linux-pm

On Tue, Jan 17, 2023 at 5:48 PM Doug Smythies <dsmythies@telus.net> wrote:
...
> And if I do this:
>
> doug@s19:~/kernel/linux$ git diff
> diff --git a/tools/testing/selftests/amd-pstate/Makefile b/tools/testing/selftests/amd-pstate/Makefile
> index 5f195ee756d6..5fd1424db37d 100644
> --- a/tools/testing/selftests/amd-pstate/Makefile
> +++ b/tools/testing/selftests/amd-pstate/Makefile
> @@ -7,11 +7,6 @@ all:
>  uname_M := $(shell uname -m 2>/dev/null || echo not)
>  ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
>
> -ifeq (x86,$(ARCH))
> -TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
> -TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
> -endif
> -
>  TEST_PROGS := run.sh
>  TEST_FILES := basic.sh tbench.sh gitsource.sh
>
> The source files do not get deleted with Sedat's test.
>

$ LANG=C LC_ALL=C make -C tools/ clean 2>&1 | tee ../make-log_tools-clean.txt

$ git status -s
M tools/testing/selftests/amd-pstate/Makefile

$ git diff
diff --git a/tools/testing/selftests/amd-pstate/Makefile
b/tools/testing/selftests/amd-pstate/Makefile
index 5f195ee756d6..5fd1424db37d 100644
--- a/tools/testing/selftests/amd-pstate/Makefile
+++ b/tools/testing/selftests/amd-pstate/Makefile
@@ -7,11 +7,6 @@ all:
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)

-ifeq (x86,$(ARCH))
-TEST_GEN_FILES += ../../../power/x86/amd_pstate_tracer/amd_pstate_trace.py
-TEST_GEN_FILES += ../../../power/x86/intel_pstate_tracer/intel_pstate_tracer.py
-endif
-
TEST_PROGS := run.sh
TEST_FILES := basic.sh tbench.sh gitsource.sh

$ egrep 'amd-pstate|pstate_tracer' ../make-log_tools-clean.txt
88:make[2]: Entering directory
'/home/dileks/src/linux/git/tools/testing/selftests/amd-pstate'
90:make[2]: Leaving directory
'/home/dileks/src/linux/git/tools/testing/selftests/amd-pstate'

Confirmed.

-Sedat-

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-17 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CA+icZUUOckm1kwOEZhSw8zsaL5z7r8uczwiKeKGEVioZ=GeFNg@mail.gmail.com>
2023-01-17 15:40 ` [6.2-rc4] tools: {amd,intel}_pstate_tracer: make -C tools/ clean Wysocki, Rafael J
2023-01-17 16:48   ` Doug Smythies
2023-01-17 17:50     ` Sedat Dilek
2023-01-17 17:56     ` Sedat Dilek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox