Profile JVM on Raspberry Pi B+ 1.2

Questions about YourKit Java Profiler
Post Reply
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

Hi,

I am trying to profile a Java application which is running on my Raspberry Pi B+ 1.2 headlessly. The profiler for linux-arm-x32 returns a segmentation error and does not work. I found out that this board has an ARM1176 processor which makes use of the ARMv6-processor architecture -- which seems not supported anymore by YourKit?

As a result, I could not find a libyjpagent.so-profiler for this architecture. Are there any (old) and (un)supported profilers available? Thanks!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Older profiler versions can be found at
https://www.yourkit.com/download/archive.jsp

Please use the agent from "bin/linux-armv5-sf" from version 2019.1, which is the last one supporting ARMv5.
You'll need to use v2019.1 UI with it.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Hi,

Did the old version help?
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

Hi Anton,

Thanks for your reply. Unfortunately not, I've received this error while the file *is* available at this location:

Code: Select all

Could not find agent library /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so in absolute path, with error: /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so: cannot open shared object file: No such file or directory
Should this agent work on an ARMv6 hard float processor architecture? That is used by the Raspberry Pi B+ 1.2 board.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Hi,
Should this agent work on an ARMv6 hard float processor architecture?
As I understand, yes. This agent is compiled as soft-float ("sf" in the name), so it should work on hardware with hard float too. Also, it targets ARMv5, so should run on ARMv6 as well.

What does this command print?
ldd -r /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

The ldd command prints the following message:

Code: Select all

ldd -r /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so
	not a dynamic executable
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

What does it show for these?
file /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so
uname -a
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

The response is;

Code: Select all

 pi@Marantz:~ $ uname -a
Linux Marantz 4.19.66+ #1253 Thu Aug 15 11:37:30 BST 2019 armv6l GNU/Linux
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

And;

Code: Select all

pi@Marantz:~ $ file /home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so
/home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv5-sf/libyjpagent.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Did you try the hard float library from the same version 2019.1?
/home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv7-hf/libyjpagent.so

Does it work with "ldd -r"?

Does Java load it?

Although it has "armv7" in its name, perhaps the compiler de-facto generated instructions for older architecture, and it will work for you. The chance is not big, though.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Update:

Apparently the hard float agent linux-armv7-hf from v2019.1 won't work because it was compiled with GCC targeting

Code: Select all

--with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard
whereas your board likely needs

Code: Select all

--with-arch=armv6 --with-fpu=vfp --with-float=hard
Perhaps it makes sense to try even older profiler versions from the archive. For example, I see that v2016.02 was compiled with a much older compiler than v2019.1. Unfortunately, I cannot provide exact target detail for older versions because it's now extremely difficult to recreate the build environment which existed at the build time.

The best approach I can suggest is to actually try older versions in the archive, one-by-one, to check whether a compatible agent exists.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

FYI: the oldest version in the archive with ARM agent is v12.0.6.
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

Did you try the hard float library from the same version 2019.1?
/home/pi/yourkit/YourKit-JavaProfiler-2019.1/bin/linux-armv7-hf/libyjpagent.so
I've tried this version as well, which results in a fatal error:

Code: Select all

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0xb60d7a74, pid=23195, tid=23196
FYI: the oldest version in the archive with ARM agent is v12.0.6.
Thanks for the complete update, I will try all the older versions and give an overview of my results here.
tjvanderlaan
Posts: 7
Joined: Tue Dec 24, 2019 4:28 pm

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by tjvanderlaan »

I tried every profiler, but unfortunately none of them work.

You can find the log files of every test I've did here: https://gist.github.com/tjibbevanderlaa ... ec39b99031
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Profile JVM on Raspberry Pi B+ 1.2

Post by Anton Katilin »

Apparently, YourKit Java Profiler ARM hard float agent has always been targeting armv7. Hence it's unfortunately impossible to profile Raspberry Pi B+ 1.2 in your configuration. Minimum requirement is Raspberry Pi 2.
Post Reply