Skip to content

Commit

Permalink
Improved debug tools.
Browse files Browse the repository at this point in the history
- RunTools/config/known_memory_leaks.supp: list of memory leaks to
  ignore.
- RecoilCorrector_v7/RecoilCorrector.hh: delete random generator in the
  destructor.
- debug.sh: use extended valgrind parameters.
  • Loading branch information
kandrosov committed Oct 2, 2014
1 parent 3e591ca commit 909e3d2
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 6 deletions.
1 change: 1 addition & 0 deletions HHbbTauTau.files
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,4 @@ HHKinFit/include/HHParticle.h
HHKinFit/include/PSTools.h
Analysis/config/embedded.cfg
debug.sh
RunTools/config/known_memory_leaks.supp
2 changes: 0 additions & 2 deletions HHbbTauTau.includes
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ $$(BOOST_INCLUDE_PATH)
$$(ROOT_INCLUDE_PATH)
$$(HEPMC_INCLUDE_PATH)
/usr/include
HHKinFit/src
HHKinFit/include
3 changes: 3 additions & 0 deletions RecoilCorrector_v7/RecoilCorrector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class RecoilCorrector
public:
RecoilCorrector(std::string iNameZDat, int iSeed=0xDEADBEEF);
RecoilCorrector(std::string iNameZDat1, std::string iPrefix, int iSeed=0xDEADBEEF);
~RecoilCorrector();
void CorrectAll(double &met, double &metphi, double iGenPt, double iGenPhi, double iLepPt, double iLepPhi,double &iU1,double &iU2,double iFluc,double iScale=0,int njet=0);
void Correct(double &pfmet, double &pfmetphi, double &trkmet, double &trkmetphi,
double iGenPt, double iGenPhi, double iLepPt, double iLepPhi,double iFluc ,double iScale=0,int njet=0);
Expand Down Expand Up @@ -174,6 +175,8 @@ RecoilCorrector::RecoilCorrector(std::string iNameZ, int iSeed) {
fId = 0; fJet = 0;
}

RecoilCorrector::~RecoilCorrector() { delete fRandom; }

//-----------------------------------------------------------------------------------------------------------------------------------------
void RecoilCorrector::addDataFile(std::string iNameData) {
readRecoil(fD1U1Fit,fD1U1RMSSMFit,fD1U1RMS1Fit,fD1U1RMS2Fit,fD1U2Fit,fD1U2RMSSMFit,fD1U2RMS1Fit,fD1U2RMS2Fit,iNameData,"PF");
Expand Down
113 changes: 113 additions & 0 deletions RunTools/config/known_memory_leaks.supp
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
libCint_leaks
Memcheck:Leak
...
obj:*/libCint.so
}

{
libRIO_leaks
Memcheck:Leak
...
obj:*/libRIO.so
}

{
dyld_leaks
Memcheck:Leak
...
obj:/usr/lib/dyld
}

{
Foundation_C_leaks
Memcheck:Leak
...
obj:/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
}

{
CoreFoundation_A_leaks
Memcheck:Leak
...
obj:/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
}

{
libsystem_info_leaks
Memcheck:Leak
...
obj:/usr/lib/system/libsystem_info.dylib
}

{
StreamerInfo_leaks
Memcheck:Leak
...
fun:*TStreamerInfo*Compile*
}

{
basic_ostream_buffer
Memcheck:Leak
match-leak-kinds: reachable
...
fun:*char_traits*basic_ostream*
}

{
basic_istream_buffer
Memcheck:Leak
match-leak-kinds: reachable
...
fun:*basic_istream*char_traits*
}

{
exception_buffer
Memcheck:Leak
match-leak-kinds: reachable
fun:calloc
fun:__cxa_get_globals
fun:__cxa_throw
}

{
libCore_leaks_ROOT
Memcheck:Leak
...
fun:*ROOT*
obj:*/libCore.so
}

{
libCore_leaks_TClass
Memcheck:Leak
...
fun:*TClass*
obj:*/libCore.so
}

{
libCore_leaks_TCint
Memcheck:Leak
...
fun:*TCint*
obj:*/libCore.so
}

{
libCore_leaks_TApplication
Memcheck:Leak
...
fun:*TApplication*
obj:*/libCore.so
}

{
libCore_leaks_TFormula
Memcheck:Leak
...
fun:*TFormula*
obj:*/libCore.so
}
6 changes: 3 additions & 3 deletions RunTools/make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ printf \
#include <iostream>
int main()
{
int result = 0;
try {
gROOT->ProcessLine(\"#include <vector>\");
$NAME a( $arg_list );
a.Run();
}
catch(std::exception& e) {
std::cerr << \"ERROR: \" << e.what() << std::endl;
return 1;
result = 1;
}
return 0;
return result;
}
" > $CODE_OUT

#g++ -std=c++0x -Wall -O3 \
g++ -std=c++0x -Wall $COMPILE_FLAGS \
-I. -I$CMSSW_BASE/src -I$CMSSW_RELEASE_BASE/src -I$ROOT_INCLUDE_PATH -I$BOOST_INCLUDE_PATH \
$( root-config --libs ) -lMathMore -lGenVector -lTMVA -L$BOOST_BASE/lib -lboost_thread \
Expand Down
3 changes: 2 additions & 1 deletion debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ $SCRIPT_PATH/RunTools/make.sh $SCRIPT_RUN_PATH $JOB_NAME -g $*

RESULT=$?
if [[ $RESULT -eq 0 ]] ; then
valgrind --leak-check=full --track-origins=yes -v $EXE_NAME
valgrind -v --leak-check=full --show-leak-kinds=all --track-origins=yes --log-file=debug.log \
--suppressions=RunTools/config/known_memory_leaks.supp --gen-suppressions=all $EXE_NAME
rm -f "$EXE_NAME"
fi

0 comments on commit 909e3d2

Please sign in to comment.