Scriptifying BTrace?

One of the issues reported with BTrace is that the trace authors have to write "verbose" code [some people say Java is "verbose"!]. In BTrace, we have to repeat the same set of imports, annotations in every btrace file and all methods have to be "public static void" and so on. Instead of inventing a new scripting language, I've added a simple C preprocessor like step in BTrace compilation. This preprocessor is based on the one in the GlueGen project. Thanks to Ken Russell for this code and for reviewing my changes specific to BTrace project. The preprocessor solution does not rule out a scripting solution in future :-) If you have nice ideas or would like contribute in this area, you are always welcome! But, I think preprocessor solution is simple and will be useful to some.


Simple Example:


btracedefs.h
ThreadBean.java

To run this sample, the following command can be used:

   btrace -I . <pid-of-the-traced-process> ThreadBean.java

Without the -I option in command line, BTrace skips the preprocessor step.
Comments:

Hey Man, Java is indeed verbose. You have to type a lot. However some things introduced in recent times have helped reduce some of the verbosity. In addition using Netbeans also helps in reducing typing as well.

Posted by Moinak Ghosh on August 08, 2008 at 01:57 PM IST #

Hi Moinak: Hope you are having fun in the new place!!
<br>
On verbosity: I'd rather prefer slightly verbose code compared to the one with lots of "defaults" and systems/languages that encourage writing terse/"too smart" code :-) But, that is just a preference - not everyone may agree.

Posted by A. Sundararajan on August 08, 2008 at 03:07 PM IST #

Post a Comment:
Comments are closed for this entry.
About

sundararajan

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today
Bookmarks
Links

No bookmarks in folder

Blogroll

No bookmarks in folder

News

No bookmarks in folder