Re: Question for using ASM to log the method invocation trace.
Sai Zhang <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.asm |
|---|---|
| Message-ID | <[email protected]> |
Zhongxian.
I do not quite understand your question
Normally, you need to write a wrapper class for instrumentation, like:
class Tracer {
public static void record(String str) {
BufferWriter = ..
//write to the file, and close here
}
}
What you need to do is to insert *Tracer.record(xx) *to the right place. You
do
not need to deal with where to flush, close the stream, right?
Hope it helps.
-Sai
On Wed, Jun 30, 2010 at 12:10 PM, Zhongxian Gu <[email protected]> wrote:
> Hi all,
>
> I wish to use ASM to instrument the code and during the run, record the
> method invocation trace. I use AdviceAdapter to do that. To enhance the
> performance,
> I use BufferedWriter to print info to the log file. The problem is that I
> don't know how to instrument the code to close the BufferedWriter. I must
> call it until all the
> methods called which is only known at run-time. Without calling close
> method will cause information missing in the buffer.
>
> I wonder if some of you have also experienced this condition and could you
> give me some hints. Thanks
>
> Best
>
> Zhongxian
>
> --
> Zhongxian Gu
> http://wwwcsif.cs.ucdavis.edu/~gu/ <http://wwwcsif.cs.ucdavis.edu/%7Egu/>
> Ph.D. Student in Computer Science, UC Davis
> 2249 Kemper Hall
>
>
> --
> You receive this message as a subscriber of the [email protected] mailing list.
> To unsubscribe: mailto:[email protected]
> For general help: mailto:[email protected]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>
message-footer.txt
(text/plain, 238 B)
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws