Hi

Take a look at btrace. It is DTrace like dynamic instrumentation tool
for JVM (DTrace : System :: btrace : JVM, though DTrace is superset of
btrace).
It allows you to instrument JVM at bytecode level with no changes in
code.

It might also help going forward to enhance clojure to insert btrace
probes. These probes can help expose higher level details to
instrumentation tools like btrace and would help professional
developers immensely.

- Akhilesh

On Oct 24, 5:03 am, BerlinBrown <[EMAIL PROTECTED]> wrote:
> On Oct 23, 6:42 pm, BerlinBrown <[EMAIL PROTECTED]> wrote:
>
>
>
> > I asked this on common lisp thread but I want to work with clojure as
> > well:
>
> > With clojure and I am assuming the introspection properties.  How
> > can I add code to clojure code that will tell me when a function
> > is called and when has finished executing.  I want to take any lisp
> > code and this particular modification to the code.  I figure with
> > lisp's AST analysis, this should be possible.
>
> > For example, pseudo code in common lisp, hello_world.lisp:
>
> > (defun hello-world ()
> >   (format t "Hello World"))
>
> > (hello-world)
>
> > ---- And then I have a utility to load hello_world.lisp and execute
> > the hello-world call.
>
> > At the command line:
> > #Inspect: hello-world function was called
> > #Hello World
> > #Inspect: hello-world has finished executing.
>
> Another similar question (second question):
>
> If you have used ASM, I can do a lot of this "trace" type
> functionality with the bytecode manipulator ASM (and obviously
> reflection) but I was also looking for the clojure way.  
> http://asm.objectweb.org/).
> Or maybe even reflection.  Is there something in clojure that might
> allow me to see when a function is called.
>
> For example, with ASM, I can get the following information of a
> method:
>
>   protected <init>(Ljava/lang/String;)V
>     ALOAD 0
>     INVOKESPECIAL java/lang/Object.<init>()V
>     ALOAD 0
>     ALOAD 1
>     PUTFIELD org/objectweb/asm/Attribute.type : Ljava/lang/String;
>     RETURN
>     MAXSTACK = 2
>     MAXLOCALS = 2
>
> ----
> What is put on the stack and when methods are invoked.
>
> Does something similar exist for ASM?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to