[kaffe]printing to a file in kaffe

sita tangirala_madhu at yahoo.com
Mon Aug 30 08:07:08 PDT 2004


Hi Dalibor,
 
        The problem with using dprintf and configure options in this scenario is
there will be a lot of information and parameters printed to the file which I may not need.
I have put  some specific hooks in the JVM(these are the only things that I want) using fprintf with which I'm unable to get it in the correct format. I also used flock but with no result. Could you please help me with any ideas other than dprintf and configuring in the debug mode.
 
Thanks,
Sita.

Dalibor Topic <robilad at kaffe.org> wrote:
sita wrote:
> Hi,
> 
> I'm actually trying to profile kaffe. In this process, I'm printing some arguments to a file.
> Say for example If I have a function called gcmalloc in kaffe, I put a hook as follows:
> 
> extern FILE *outfp; //outfp points to my trace file 
> fprintf(outfp,"%p %d\n",mem,sz);
> 
> I expect the trace file to be in a fixed format something like this:
> 
> 0x1234 22
> 0x2345 34
> .....
> 
> But I see something like
> 
> 0x1234 220x2345 34
> 
> I used fflush(outfp) but I really cannot print something to a file in the format that I want.
> The format is really important for my analysis. Can anyone please help me with this and let me know how to print to a file in the format that I want in kaffe.

Hi sita,

your problem may be caused by different threads calling your function at 
the same time. Try using dprintf, like other debugging output does.

Looking at kaffe/kaffevm/kaffe-gc/gcmem.c, it seems like that sort of 
output (size and location of allocated blocks in the gc) is already 
printed by -vmdebug GCALLOC. You have to enable debugging in configure, 
though. And you'd have to deal with a slightly different output format.

best of luck for your work,
dalibor topic


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kaffe.org/pipermail/kaffe/attachments/20040830/d3a5b993/attachment-0006.htm 


More information about the kaffe mailing list