|
From: Satya V. G. <gup...@ne...> - 2010-06-09 03:34:04
|
Josef,
I now realize that I didn't have the correct Uchar* in the function fd =
VG_(connect_via_socket)(UChar* valgrind-listener-IP_Port).
As soon as I hardcoded the address, callgrind stopped crashing. Would you
know how I could retrieve the UChar* valgrind-listener-IP_Port from the
command line option?
So far here is what I have tried. Attempt 1 involved declaring the
valgrind-listener-IP_Port as a global that gets updated in
./coregrind/m_main.c when the command line is being parsed. I then extern'ed
this variable in the file ./callgrind/dump.c. That didn't work and I
surmised that these two files are probably in two separate .so files.
Attempt 2 involved writing the valgrind-listener-IP_Port into a config file
when I am in m_main.c and letting dump.c read this data from the said config
file. However, I realized that the normal data types FILE* and run time
functions like strcpy(), sprintf etc don't work with the run time libraries
that are used by valgrind.
So I'd greatly appreciate it if you could suggest how I could retrieve the
valgrind-listener-IP_Port information from the original command line options
when I am in the function new_dumpfile(..)?
Regards
SVG
-----Original Message-----
From: Josef Weidendorfer [mailto:Jos...@gm...]
Sent: Monday, June 07, 2010 5:59 PM
To: gup...@ne...
Cc: val...@li...
Subject: Re: [Valgrind-developers] Need to change where Valgrind writes logs
fo r callgrind
On Monday 07 June 2010, gup...@ne... wrote:
> Based on your comment, I changed the function new_dumpfile(..) so that
instead of the original line:
>
> fd = sr_Res(res);
>
> I now have:
>
> fd = VG_(connect_via_socket)(log_fsname_unexpanded);
>
> To get the "log_fsname_unexpanded" in the above invocation, I used the
following code:
>
> for (i = 0; i < VG_(sizeXA)( VG_(args_for_valgrind) ); i++) {
> HChar* arg = * (HChar**) VG_(indexXA)( VG_(args_for_valgrind), i
);
> VG_STR_CLO(arg, "--log-socket", log_fsname_unexpanded);
>
> Unfortunately, when I run callgrind with the --dump-before='*' or
--dump-every-bb=5 the call to new_dumpfile(..) in print_bbccs_of_thread(..)
causes a crash with the call stack showing the error to be at the line: fd =
VG_(connect_via_socket)("IP address of listener").
Now idea how that can crash at all.
Do you check for error conditions, and perhaps retry the connect?
Josef
> However, if I run callgrind without either of the two dump options, the
contents of the callgrind.out.PID.partn get written out to the
valgrind-listener.
>
> I concluded that I must be parsing the IP address correctly but somehow
the function new_dumpfile(..) doesn't like the fd for some obscure reason.
>
> Could you suggest what I may be doing wrong? I am totally stuck and would
greatly appreciate your help.
>
> Regards
>
> SVG
>
>
> Perhaps
>
> ---------- Original Message ----------
> From: Josef Weidendorfer <Jos...@gm...>
> To: val...@li...
> Cc: "gup...@ne..." <gup...@ne...>
> Subject: Re: [Valgrind-developers] Need to change where Valgrind
> writes logs for callgrind
> Date: Mon, 7 Jun 2010 18:34:47 +0200
>
> On Monday 07 June 2010, gup...@ne... wrote:
> > I am using callgrind on hardware with very small disk space. I'd like to
know where should I begin making changes so that the callgrind logs (basic
blocks, function before, function after) are written to a network socket
instead of a log-file. Could someone be of help?
>
> I suppose you would need to replace the VG_(open) calls in
> callgrind/dump.c into something opening a socket. For that, you can check
how the --log-socket option is implemented.
>
> Josef
>
> >
> > SVG
> >
> > ____________________________________________________________
> > Project Management
> > 100% Online. Project Management certificate from Villanova. Free info.
> > http://thirdpartyoffers.netzero.net/TGL3241/4c0cff6029c7223d6eest04v
> > uc
> >
> > --------------------------------------------------------------------
> > ---------- ThinkGeek and WIRED's GeekDad team up for the Ultimate
> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky
> > parental unit. See the prize list and enter to win:
> > http://p.sf.net/sfu/thinkgeek-promo
> > _______________________________________________
> > Valgrind-developers mailing list
> > Val...@li...
> > https://lists.sourceforge.net/lists/listinfo/valgrind-developers
> >
>
>
> ____________________________________________________________
> $653/Month for $150,000 Mortgage!
> Free Quotes. No SSN or Credit Check.
> http://thirdpartyoffers.netzero.net/TGL3241/4c0d68129031243cc7st03vuc
>
|