Problems buidling a new gtest on MacOS and Windows

Jaroslav Bachorík jaroslav.bachorik at datadoghq.com
Fri Sep 25 13:41:24 UTC 2020


Hello,

I hope this is the right mailing list. If not, please, redirect me to
the more appropriate one.

I am working on an early prototype (or rather a PoC) for the
rate-limited allocation sample event. In order to test the rate
limiting sampler implementation I have added
https://github.com/jbachorik/jdk/blob/submit/allocation_sampling/test/hotspot/gtest/jfr/test_adaptiveSampler.cpp
gtest. I based this test on
https://github.com/jbachorik/jdk/blob/submit/allocation_sampling/test/hotspot/gtest/jfr/test_networkUtilization.cpp
to have the overall structure and mocking support.

However, I am not able to build my changes with this test in place for
MacOS and Windows (Linux/gcc builds just fine). The failure is about a
symbol being defined in an anonymous namespace
(https://github.com/jbachorik/jdk/runs/1165666520?check_suite_focus=true).
While it is true that the *.cpp file under test is included within an
anonymous namespace it is very strange that the
test_networkUtilization.cpp does not have the same problem, nor this
same test but when built for Linux.

I have spent a non-trivial amount of time trying to figure out
whatever minimal difference there might be but I can't spot any :(

Thanks in advance for any advice here!

-JB-


More information about the hotspot-jfr-dev mailing list