Skip to main content

Error trying to build with CVM_JVMPI=true

12 replies [Last post]
finsprings
Offline
Joined: 2006-08-01

I am cross-compiling (using bitbake) for an embedded linux device (buglabs.net BUG) from cdc_phoneme.dev.java.net_.svn.phoneme.builds.phoneme_advanced-mr2-dev-b73_11560_.tar.gz with:

make CVM_JVMDI=true CVM_JIT=false CVM_JVMPI=true -C cdc/build/linux-arm-generic bin

and I get an error:

make[1]: *** No rule to make target `/home/dave/bug/com.buglabs.build.oe/build/tmp/work/armv6-poky-linux-gnueabi/phoneme-advanced-personal-debug-mr2-r0/cdc/build/linux-arm-generic/./lib/jvm.hprof.txt', needed by `hprof'. Stop.

If I copy ./cdc/src/share/tools/hprof/jvm.hprof.txt to the lib dir the make will proceed and complete successfully. If I build without the CVM_JVMPI it builds and runs just fine but I'd like to add profiling support. It's 99.9% of the way there as the code itself is all compiling; it's just failing to find jvm.hprof.txt in the right place when building the hprof tool for some reason.

Anyone else seen this problem?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billp
Offline
Joined: 2006-09-19

I think this is a bug in the md_get_prelude_path function. As copied over from jdk 6 it assumes the lib is in lib/i386 directory but CVM is just 'lib'. So I've submitted a bug and should fix it shortly. Meantime the fix for src/linux/tools/jvmti/hprof/jvmti_hprof_md.c is:

Index: src/linux/tools/jvmti/hprof/jvmti_hprof_md.c
===================================================================
--- src/linux/tools/jvmti/hprof/jvmti_hprof_md.c (revision 15890)
+++ src/linux/tools/jvmti/hprof/jvmti_hprof_md.c (working copy)
@@ -277,7 +277,7 @@
*lastSlash = '\0';
}
}
- (void)snprintf(path, path_len, "%s/%s", libdir, filename);
+ (void)snprintf(path, path_len, "%s/lib/%s", libdir, filename);
}

bill

finsprings
Offline
Joined: 2006-08-01

Wonderful! Thanks so much for all your help Bill.

Cheers,
Dave

finsprings
Offline
Joined: 2006-08-01

Same problem with b97_15849 FWIW.

finsprings
Offline
Joined: 2006-08-01

I found in hprof.mk that it won't copy that text file unless CVM_JVMTI is false. Does that mean I can't build with CVM_JVMDI (which by default enables CVM_JVMTI) and CVM_JVMPI at the same time?

billp
Offline
Joined: 2006-09-19

JVMDI has been obsoleted. For now, setting CVM_JVMDI=true turns on CVM_JVMTI. Going forward debugging and profiling will be provided by the JVMTI support in CVM. For this release at least, the JVMPI code is still in the repo. However you can't build with both CVM_JVMPI=true and CVM_JVMTI=true. That build flavor combination is not supported.

bill

Message was edited by: billp

finsprings
Offline
Joined: 2006-08-01

Thanks Bill. I was just following the section in the CDC Build System.

So what parameters should I be specifying to make to build a CVM binary, or binaries, that support profiling and remote debugging at the moment? (We're using b97).

billp
Offline
Joined: 2006-09-19

Just use CVM_JVMTI=true and you should be able to debug with Netbeans or jdb. For profiling you should be able to use Netbeans 6.5 with the current repo. This only works right now on linux-x86 and win32-x86. You can also use the jvmtihprof demo profiler that is in the repo. This is essentially the same as the older hprof but it uses JVMTI.

bill

finsprings
Offline
Joined: 2006-08-01

I'm cross-compiling for linux on ARM.

Given that should I stick with a separate JVMPI build for profiling for the time being?

Do I not need CVM_JIT=false any more? Does CVM_JVMTI=true automatically disable JIT?

Cheers,
Dave

billp
Offline
Joined: 2006-09-19

You can still use JVMTI for profiling on ARM, just not with Netbeans. You can use the jvmtihprof library to do that. Usage is like so:

bin/cvm -agentlib:jvmtihprof -Xbootclasspath/a:lib/java_crw_demo.jar -classpath /javatests/scimark2/build/classes jnt.scimark2.commandline

You can profile with the JIT enabled. If you try to debug (using -Xdebug option) then the JIT is turned off.

bill

finsprings
Offline
Joined: 2006-08-01

Thanks Bill. I will build with just CVM_JVMTI=true tonight. Being able to do remote debugging and local profiling from the same build will be great.

finsprings
Offline
Joined: 2006-08-01

I'm very close. It can't find jvm.hprof.txt. It's in the lib dir on my embedded device but for some reason it's looking in the directory above:

$ pwd
/opt/phoneme-advanced-personal-debug
$ bin/cvm -agentlib:jvmtihprof -Xbootclasspath/a:lib/java_crw_demo.jar
HPROF ERROR: Can't open /opt/phoneme-advanced-personal-debug/jvm.hprof.txt [jvmti_hprof_io.c:732]
HPROF TERMINATED PROCESS

Following that back it's called md_get_prelude_path which is inferring the path based on libhprof.so, which I don't have (and which isn't built when I do 'make CVM_JVMTI=true').

If I copy jvm.hprof.txt up a directory it works.

My tree:
$ find /opt/phoneme-advanced-personal-debug
/opt/phoneme-advanced-personal-debug
/opt/phoneme-advanced-personal-debug/legal
/opt/phoneme-advanced-personal-debug/legal/thirdpartylicensereadme.txt
/opt/phoneme-advanced-personal-debug/legal/copyright.txt
/opt/phoneme-advanced-personal-debug/legal/license.txt
/opt/phoneme-advanced-personal-debug/bin
/opt/phoneme-advanced-personal-debug/bin/cvm
/opt/phoneme-advanced-personal-debug/testclasses.zip
/opt/phoneme-advanced-personal-debug/democlasses.jar
/opt/phoneme-advanced-personal-debug/lib
/opt/phoneme-advanced-personal-debug/lib/libjava_crw_demo.so
/opt/phoneme-advanced-personal-debug/lib/security
/opt/phoneme-advanced-personal-debug/lib/security/java.policy
/opt/phoneme-advanced-personal-debug/lib/security/java.security
/opt/phoneme-advanced-personal-debug/lib/libjdwp.so
/opt/phoneme-advanced-personal-debug/lib/libdt_socket.so
/opt/phoneme-advanced-personal-debug/lib/zi
/opt/phoneme-advanced-personal-debug/lib/zi/America
/opt/phoneme-advanced-personal-debug/lib/zi/America/Los_Angeles
/opt/phoneme-advanced-personal-debug/lib/zi/GMT
/opt/phoneme-advanced-personal-debug/lib/zi/ZoneInfoMappings
/opt/phoneme-advanced-personal-debug/lib/zi/Asia
/opt/phoneme-advanced-personal-debug/lib/zi/Asia/Calcutta
/opt/phoneme-advanced-personal-debug/lib/zi/Asia/Novosibirsk
/opt/phoneme-advanced-personal-debug/lib/jvm.hprof.txt
/opt/phoneme-advanced-personal-debug/lib/personal.jar
/opt/phoneme-advanced-personal-debug/lib/libqtawt.so
/opt/phoneme-advanced-personal-debug/lib/content-types.properties
/opt/phoneme-advanced-personal-debug/lib/libawtjpeg.so
/opt/phoneme-advanced-personal-debug/lib/libjvmtihprof.so
/opt/phoneme-advanced-personal-debug/lib/java_crw_demo.jar
/opt/phoneme-advanced-personal-debug/lib/btclasses.zip

Any ideas?

Hinkmond Wong

finsprings wrote:
> I'm very close. It can't find jvm.hprof.txt. It's in the lib dir on my embedded device but for some reason it's looking in the directory above:
>

Hi finsprings,

I noticed your question is about CDC, so I'm moving your question over
to the phoneME Advanced forum instead of the phoneME Feature forum
(which handles MIDP/CLDC related questions).

Thanks,

Hinkmond

> $ pwd
> /opt/phoneme-advanced-personal-debug
> $ bin/cvm -agentlib:jvmtihprof -Xbootclasspath/a:lib/java_crw_demo.jar
> HPROF ERROR: Can't open /opt/phoneme-advanced-personal-debug/jvm.hprof.txt [jvmti_hprof_io.c:732]
> HPROF TERMINATED PROCESS
>
> Following that back it's called md_get_prelude_path which is inferring the path based on libhprof.so, which I don't have (and which isn't built when I do 'make CVM_JVMTI=true').
>
> If I copy jvm.hprof.txt up a directory it works.
>
> My tree:
> $ find /opt/phoneme-advanced-personal-debug
> /opt/phoneme-advanced-personal-debug
> /opt/phoneme-advanced-personal-debug/legal
> /opt/phoneme-advanced-personal-debug/legal/thirdpartylicensereadme.txt
> /opt/phoneme-advanced-personal-debug/legal/copyright.txt
> /opt/phoneme-advanced-personal-debug/legal/license.txt
> /opt/phoneme-advanced-personal-debug/bin
> /opt/phoneme-advanced-personal-debug/bin/cvm
> /opt/phoneme-advanced-personal-debug/testclasses.zip
> /opt/phoneme-advanced-personal-debug/democlasses.jar
> /opt/phoneme-advanced-personal-debug/lib
> /opt/phoneme-advanced-personal-debug/lib/libjava_crw_demo.so
> /opt/phoneme-advanced-personal-debug/lib/security
> /opt/phoneme-advanced-personal-debug/lib/security/java.policy
> /opt/phoneme-advanced-personal-debug/lib/security/java.security
> /opt/phoneme-advanced-personal-debug/lib/libjdwp.so
> /opt/phoneme-advanced-personal-debug/lib/libdt_socket.so
> /opt/phoneme-advanced-personal-debug/lib/zi
> /opt/phoneme-advanced-personal-debug/lib/zi/America
> /opt/phoneme-advanced-personal-debug/lib/zi/America/Los_Angeles
> /opt/phoneme-advanced-personal-debug/lib/zi/GMT
> /opt/phoneme-advanced-personal-debug/lib/zi/ZoneInfoMappings
> /opt/phoneme-advanced-personal-debug/lib/zi/Asia
> /opt/phoneme-advanced-personal-debug/lib/zi/Asia/Calcutta
> /opt/phoneme-advanced-personal-debug/lib/zi/Asia/Novosibirsk
> /opt/phoneme-advanced-personal-debug/lib/jvm.hprof.txt
> /opt/phoneme-advanced-personal-debug/lib/personal.jar
> /opt/phoneme-advanced-personal-debug/lib/libqtawt.so
> /opt/phoneme-advanced-personal-debug/lib/content-types.properties
> /opt/phoneme-advanced-personal-debug/lib/libawtjpeg.so
> /opt/phoneme-advanced-personal-debug/lib/libjvmtihprof.so
> /opt/phoneme-advanced-personal-debug/lib/java_crw_demo.jar
> /opt/phoneme-advanced-personal-debug/lib/btclasses.zip
>
> Any ideas?
> [Message sent by forum member 'finsprings' (finsprings)]
>
> http://forums.java.net/jive/thread.jspa?messageID=319457
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: feature-unsubscribe@phoneme.dev.java.net
> For additional commands, e-mail: feature-help@phoneme.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: feature-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: feature-help@phoneme.dev.java.net