« October 2009
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
22
23
24
25
26
27
28
29
30
31
       
Today
XML

Blog::Navigation

GetJava Download Button
Get the Source
Personal Blog

Blog::Referers

Today's Page Hits: 708

Powered by Roller Weblogger.
« Playing with JSqueak | Main | Playing with Alice... »
20080808 Friday August 08, 2008

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.



( Aug 08 2008, 06:36:08 PM IST ) Permalink Comments [2] del.icio.us | furl | simpy | slashdot | technorati | digg

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 08: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 10:07 PM IST #

Post a Comment:

Comments are closed for this entry.
Copyright (C) 2005, A. Sundararajan's Weblog