img
To use TNF probes from Java, it is necessary to write the probes themselves in C and then use JNI
to call those probes from your Java code. This is more than a little bit awkward and totally
nonportable, but it does give you a great deal of very detailed performance information. We have
an example of this in the code on the Web page (TNFExample.java).
Once that data is collected, all that's left is to make sense of it. While you could simply read the
file itself, that would probably prove to be rather difficult--there's just too much data to read from
a printout.
bil@cloudbase[89]: tnfdump /tmp/trace-45132
probe tnf_name: "give_friend_raise_middle" tnf_string: "keys
lgl;file tnf_list_global_lock.c;line 157;"
probe tnf_name: "give_friend_raise_end" tnf_string: "keys
lgl;file tnf_list_global_lock.c;line 159;"
probe tnf_name: "liquidate_enemies_start" tnf_string: "keys
lgl;file tnf_list_global_lock.c;line 186;"
probe tnf_name: "liquidate_enemies_end" tnf_string: "keys
lgl;file tnf_list_global_lock.c;line 198;"
probe tnf_name: "give_friends_raise_end" tnf_string: "keys
lgl;file tnf_list_global_lock.c;line 164;"
Elapsed (ms)
Delta (ms)
...
Probe Name
------------
----------
----------
0.000000
0.000000
give_friends_raise_start
0.695500
0.695500
give_friend_raise_start
0.955000
0.259500
give_friend_raise_middle
1.447000
0.492000
give_friends_raise_start
16.150000
14.703000
give_friend_raise_end
16.703000
0.553000
give_friend_raise_start
17.311000
0.608000
give_friend_raise_middle
36.163000
18.852000
give_friend_raise_end
A better method is to use a special viewer, TNFview (also available via FTP), which condenses
that data into graphical form and produces a series of histograms and plots.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home