RFR: 8365053: Refresh hotspot precompiled.hpp with headers based on current frequency [v3]
Quan Anh Mai
qamai at openjdk.org
Fri Aug 8 15:05:14 UTC 2025
On Fri, 8 Aug 2025 14:08:02 GMT, Francesco Andreuzzi <duke at openjdk.org> wrote:
>> Something seems wrong with these numbers.
>>
>> - There are 538 headers with include counts of 2460.
>> - There are only 1121 .o.cmdline files.
>>
>> So how do we get include counts that are greater (by more than a factor of 2)
>> than the number of .d files?
>>
>> Note that precompiled.hpp has an include count of 2456. There's 1 .d file that
>> depends on everything - BUILD_LIBJVM.d. That probably ought to be excluded
>> from counting, although I guess it should just add one to every file.
>>
>> Also, precompiled.hpp has an include count of 2456, so not the maximum count,
>> but close. Which is itself weird that it wouldn't be the most included file.
>> But it's hard to guess what might be going on with that until the surprising
>> high include count > number of .d files is understood.
>>
>> That include count listing would also be more useful of sorted by count.
>
>> Note that precompiled.hpp has an include count of 2456. There's 1 .d file that
> depends on everything - BUILD_LIBJVM.d. That probably ought to be excluded
> from counting, although I guess it should just add one to every file.
>
> Apparently `BUILD_LIBJVM.d` mentions all files multiple times:
>
> % grep "utilities/waitBarrier.hpp" build/clang/hotspot/variant-server/libjvm/objs/BUILD_LIBJVM.d | wc -l
> 1231
>
>
> It's definitely reasonable to exclude it, I did it in the latest revision of the script.
>
> Now, the numbers seem more reasonable:
>
> % ls build/clang/hotspot/variant-server/libjvm/objs/*.d | grep -v BUILD | wc -l
> 1232
>
> % grep "code/codeCache.hpp" build/clang/hotspot/variant-server/libjvm/objs/*.d | \
> grep -v BUILD | sort | uniq | wc -l
> 1230
>
> % grep "code/codeCache.hpp" inclusions_count.txt
> code/codeCache.hpp=1230
>
>
> Updated [inclusions_count.txt](https://github.com/user-attachments/files/21685761/inclusions_count.txt)
I assume this means that other `.d` files might include a header multiple times, too. Is it reasonable to count only the number of files containing a header instead of number of appearances?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26681#discussion_r2263225465
More information about the hotspot-dev
mailing list