Please ignore this, accidentally sent it to the wrong place.
/Nisse
On 09/20/2011 01:57 PM, Nils Loodin wrote:
Since I can't be present at the meeting, I thought I'd share what I've
been working on this week in this manner instead!
Since one of the most important thing's to do quickly in this project
is to get a feel for how customers such as WLDF and DMS are using the
Java API:s to flight recorder we're supposedly supporting, I've been
trying to dig into that.
First by actually looking at a demo source file from WLDF to see what
API:s they're calling and veryfing that these are ones that actually
work now. The answer to this question is YES. Every API is supported
and tested in the Echeneis tests for flight recorder!
Furthermore, I've been using code coverage (old habits die hard, eh?)
To see how many of the com.oracle.jrockit.jfr.client API:s (which are
the ones that seems to be defining some sort of Interface outwards)
are covered in testing.
The first bit of good news here is that it's actually fairly simple to
get Java code coverage of the Java-parts (ofc) of JFR. I did it using
a third party library called EMMA, which seems to be a standard one to
use in this case. I built the JDK locally on my machine and then
instrumented jfr.jar with EMMA, and then ran the echeneis tests as
usual (although I had to put emma.jar on the bootclasspath to get the
classes to run). After that it's simple to generate an HTML report of
what is run.
in the client package, we have code coverage of about 65% (after I
added and modified some tests. When you get the report up and realize
it's super simple to add some tests to get more coverage, I started
doing it almost without thinking. I guess I'll be checking in some
stuff soon).
Some of you were present on my presentation of native code coverage,
where I showed a report of the native parts. Unfortunately, that
system Isn't (yet) compatible with emma, but I was thinking about
looking into unification of these reports, that would probably save us
all a bit of time when developing.
Here's how to generate your own java CC-reports:
1. Build JDK.
2. Download emma:
http://sourceforge.net/projects/emma/files/emma-release/2.0.5312/emma-2.0.5312.zip/download
3. Put emma.jar in jre/lib/ext in your JDK.
2. Instrument jfr.jar: java emma instr -ip jfr.jar -m overwrite. This
will generate a file called coverage.em, containing class metadata.
Put it somewhere.
4. Run the echeneis tests: java -Xbootclasspath/a:emma.jar -jar
echeneis.jar -mode local -dir api/jfr/. This will create a coverage.ec
file, containing information about the run.
5. Generate a report using the two coverage files: java emma report -r
html -in coverage.ec -in coverage.em -sp
/localhome/hg-workspaces/jfr/hotspot-jfr/jdk/src/closed/share/classes/
Look for the report in the coverage dir created. Note that above we're
giving the report system a link to where the sources are. Presto!
I'll attach a report that I've created so you won't have to if you
just want to have a look.
Regards,
Nils Loodin