From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>,
npiggin@gmail.com, christophe.leroy@csgroup.eu,
aneesh.kumar@kernel.org, naveen.n.rao@linux.ibm.com,
shuah@kernel.org
Cc: linuxppc-dev@lists.ozlabs.org, linux-kselftest@vger.kernel.org,
Sachin Sant <sachinp@linux.ibm.com>
Subject: Re: [PATCH 2/3] selftest/powerpc: Add flags.mk to support pmu buildable
Date: Thu, 2 May 2024 14:04:42 +0530 [thread overview]
Message-ID: <fef9ac16-a6b0-4a44-a240-fc3ae469d62f@linux.ibm.com> (raw)
In-Reply-To: <874jbkjm54.fsf@mail.lhotse>
On 4/29/24 7:39 PM, Michael Ellerman wrote:
> Madhavan Srinivasan <maddy@linux.ibm.com> writes:
>> When running `make -C powerpc/pmu run_tests` from top level selftests
>> directory, currently this error is being reported
>>
>> make: Entering directory '/home/maddy/linux/tools/testing/selftests/powerpc/pmu'
>> Makefile:40: warning: overriding recipe for target 'emit_tests'
>> ../../lib.mk:111: warning: ignoring old recipe for target 'emit_tests'
>> gcc -m64 count_instructions.c ../harness.c event.c lib.c ../utils.c loop.S -o /home/maddy/selftest_output//count_instructions
>> In file included from count_instructions.c:13:
>> event.h:12:10: fatal error: utils.h: No such file or directory
>> 12 | #include "utils.h"
>> | ^~~~~~~~~
>> compilation terminated.
>>
>> This is due to missing of include path in CFLAGS. That is, CFLAGS and
>> GIT_VERSION macros are defined in the powerpc/ folder Makefile which
>> in this case not involved.
>>
>> To address the failure incase of executing specific sub-folder test directly,
>> a new rule file has been addded by the patch called "flags.mk" under
>> selftest/powerpc/ folder and is linked to all the Makefile of powerpc/pmu
>> sub-folders.
> This patch made my selftest build go from ~10s to ~50s !
>
> I tracked it down to "git describe" being run hundreds of times.
>
>> diff --git a/tools/testing/selftests/powerpc/flags.mk b/tools/testing/selftests/powerpc/flags.mk
>> new file mode 100644
>> index 000000000000..28374f470126
>> --- /dev/null
>> +++ b/tools/testing/selftests/powerpc/flags.mk
>> @@ -0,0 +1,12 @@
>> +#This checks for any ENV variables and add those.
>> +
>> +#ifeq ($(GIT_VERSION),)
>
> This isn't right, # is a comment in make syntax, so this line is just a
> comment. It needs to be "ifeq".
oops, my bad :(
But nice catch. Thanks
Maddy
>
>> +GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")
>
> Using '=' here means Make re-runs the command every time the variable is
> used. Previously that was OK because the variable was set once and then
> exported. But now that it's a Make variable in each file it leads to
> "git describe" being run a few hundred times.
>
> I've squashed in those fixes, no need to send a v2.
>
> cheers
next prev parent reply other threads:[~2024-05-02 8:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 9:37 [PATCH 1/3] selftest/powerpc: Re-order *FLAGS to follow lib.mk Madhavan Srinivasan
2024-02-29 9:37 ` [PATCH 2/3] selftest/powerpc: Add flags.mk to support pmu buildable Madhavan Srinivasan
2024-02-29 13:41 ` Sachin Sant
2024-04-29 14:09 ` Michael Ellerman
2024-05-02 8:34 ` Madhavan Srinivasan [this message]
2024-02-29 9:37 ` [PATCH 3/3] selftest/powerpc: make sub-folders buildable on it own Madhavan Srinivasan
2024-05-03 10:41 ` [PATCH 1/3] selftest/powerpc: Re-order *FLAGS to follow lib.mk Michael Ellerman
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=fef9ac16-a6b0-4a44-a240-fc3ae469d62f@linux.ibm.com \
--to=maddy@linux.ibm.com \
--cc=aneesh.kumar@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kselftest@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=sachinp@linux.ibm.com \
--cc=shuah@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;
as well as URLs for NNTP newsgroup(s).