RE: Running Valgrind with CIM provider

Devchandra Leishangthem <[email protected]> Tue, 30 Oct 2012 11:05:23 +0530
Newsgroups gmane.network.open-pegasus.general
Message-ID <OFF56545FA.0DF3159D-ON65257AA7.001DAFC0-65257AA7.001EC3F5@in.ibm.com>
Yea,  valgrind logs for the cimprovagt will be overwritten, which seems to 
be rather bad. 

D>L> Meetei
9538270270 

IBM India Software Lab, STG
6th Floor, A0202, 
EGL -D,Bangalore, India



From:   Visakh Sreekumar <[email protected]>
To:     "Kandepu, Anusha" <[email protected]>, 
"[email protected]" <[email protected]>, 
Date:   10/29/2012 06:49 PM
Subject:        RE: Running Valgrind with CIM provider



Hi Anusha,
 
Thanks for the detailed information.
 
I followed the steps that you mentioned carefully, but unfortunately I am 
able to see only the valgrind log for cimserver.
Here is what I have tried:
1)      Created /root/cim_bin and copied binaries 
$PEGASUS_HOME/bin/cimserver and $PEGASUS_HOME/bin/cimprovagt to this 
directory.
2)      Replaced binaries $PEGASUS_HOME/bin/cimserver and 
$PEGASUS_HOME/bin/cimprovagt with the following scripts:
cimserver
========
#!/bin/bash
valgrind --log-file=/root/cimserver_valgrind --num-callers=25 
--tool=memcheck --leak-check=full --error-limit=no /root/cim_bin/cimserver 
"$@"
cimprovagt
=========
#!/bin/bash
valgrind --log-file=/root/cimprovagt_valgrind --num-callers=25 
--tool=memcheck --leak-check=full --error-limit=no 
/root/cim_bin/cimprovagt "$@"
 
3)      Ran the script $PEGASUS_HOME/bin/cimserver
 
All queries are working fine and I am able to see the cimserver_valgrind 
log file with provider information also. But here I was expecting valgrind 
to add the provider logs separately to /root/cimprovagt_valgrind file.
 
Could you please let me know if I am missing anything here?
 
Regards,
Visakh
 
From: Kandepu, Anusha [mailto:[email protected]] 
Sent: Friday, October 26, 2012 2:36 PM
To: Visakh Sreekumar; [email protected]
Subject: RE: Running Valgrind with CIM provider
 
Hi Visakh,
                  You can’t run cimprovgt bin alone with valgrind .It 
should be invoked by cimserver only. So here if you want to collect the 
leaks for cimprovgt then have a wrapper script for cimserver also and 
start cimserver.So that cimserver bin will start with valgrind enabled and 
internally it invokes cimprovgt also with valgrind enabled .I have 
mentioned below, the process of how do we run  memory leaks test as part 
of OP Nightly Build and tests.
 
Example : 
 
We have wrapper scripts for each binary under PEGASUS_HOME /bin(From this 
directory all the binaries are loaded) directory .In the wrapper script, 
each binary has been pointed  to the exact location of binaries as 
mentioned in the sample script below. In this example actual binaries are 
present under “PEGASUS_HOME /bin_exe” directory and wrapper script is 
present under “PEGASUS_HOME /bin” directory. The wrapper script for 
cimserver/cimprovgt  is mentioned below.
 
#!/bin/bash
valgrind --log-file=/var/buildMAIN/pegasus/build/valgrind_log/cimserver 
--num-callers=25 --tool=memcheck --leak-check=full --error-limit=no 
/var/buildMAIN/pegasus/build/bin_exe/cimserver "$@"
 
#!/bin/bash
valgrind --log-file=/var/buildMAIN/pegasus/build/valgrind_log/cimprovagt 
--num-callers=25 --tool=memcheck --leak-check=full --error-limit=no 
/var/buildMAIN/pegasus/build/bin_exe/cimprovagt "$@"
 
Hope this has clarified your doubt !! .
 
Regards,
Anusha.
 
From: Visakh Sreekumar [mailto:[email protected]] 
Sent: Monday, October 22, 2012 5:49 PM
To: [email protected]
Subject: RE: Running Valgrind with CIM provider
 
CIM Server used is OpenPegasus 2.11.0 and valgrind version is 3.7.0.
 
From: Visakh Sreekumar 
Sent: Monday, October 22, 2012 5:31 PM
To: '[email protected]'
Subject: Running Valgrind with CIM provider
 
Hi 
 
This is Visakh, I am new to this group. I am trying to do memory leak 
analysis of our CIM provider with valgrind and has so far been 
unsuccessful in my attempt. Hope to get some expert advice in this regard.
 
I have a wrapper script for executing cimprovagt which is as given below:
==========================================================================
module=$5
VALGRIND_ARGS="--leak-check=yes --trace-children=yes --log- 
file=/tmp/$module.valgrind"
if [ -e /tmp/$module.valgrind -o -e /tmp/LogAll.valgrind ]; then exec 
/usr/bin/valgrind $VALGRIND_ARGS \ /opt/pegasus/bin/cimprovagt.orig "$@"
else
exec /opt/pegasus/bin/cimprovagt.orig "$@"
fi
==========================================================================
Here /opt/pegasus/bin/cimprovagt.orig is the renamed original cimprovagt 
executable.
 
Now when I run valgrind -v cimprovagt(which is the wrapper), it reports 
the
error:
"cimprovagt is an internal program used by cimserver.
cimprovagt should not be invoked directly."
 
This is seen irrespective of whether "forceProviderProcesses" is 
true/false.
 
Please let me know if I am missing anything here.
 
Regards,
Visakh
(unnamed) (image/gif, 1.1 KB) - not displayed