User-level SystemTap Tracing for CMSSW

SystemTap is able to record user-level events in its kernel traces. We can add debug symbols to various portions of CMSSW and use these debug symbols to add calls in ROOT and CMSSW to BlockTrace's output

Compiling parts of ROOT with debug symbols.

This is not a tutorial for making ROOT; you can in fact probably rebuild it from the CMSSW RPM. Here's what I do (getting debug symbols for libTree.so is sufficient for me):

svn co http://root.cern.ch/svn/root/tags/v5-22-00h root-52200h
cd root-52200h
./configure linux --build=debug
make lib/libTree.so -j9

At this point, you can link the newly-created libTree.so into the CMSSW environment.

cmsrel CMSSW_3_5_4
cd CMSSW_3_5_4
ln -s /path/to/root-52200h/lib/libTree.so lib/slc5_ia32_gcc434/libTree.so

Compiling parts of CMSSW with debug symbols.

This one is easier. Once you check out the CMSSW code you want to modify, run scram with the following argument:
scram b USER_CXXFLAGS="-g"

For example, if you want the Input module to have debugging symbols, you can execute the following two commands:

addpkg IOPool/Input
scram b USER_CXXFLAGS="-g"

SystemTap and user symbols

Once you have debug symbols in ROOT and/or CMSSW, you can start writing traces for them. For example, the following code will trace entry and exit for the 'fillHistory' function in IOPool/Input/src/RootFile.cc and 'FillBuffer' in tree/tree/src/TTreeCache.cxx:
probe process("/home/cse496/bbockelm/tmp/CMSSW_3_5_4/lib/slc5_ia32_gcc434/pluginIOPoolInput.so").function("fillHistory") {
  printf("fillHistory.start\n");
}

probe process("/home/cse496/bbockelm/tmp/CMSSW_3_5_4/lib/slc5_ia32_gcc434/pluginIOPoolInput.so").function("fillHistory").return {
  printf("fillHistory.end\n");
}

probe process("/mnt/unl/home/cse496/bbockelm/software/root-5.22.00h/lib/libTree.so").function("FillBuffer") {
  printf("FillBuffer.start\n");
}

probe process("/mnt/unl/home/cse496/bbockelm/software/root-5.22.00h/lib/libTree.so").function("FillBuffer").return {
  printf("FillBuffer.end\n");
}
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2010-05-13 - BrianBockelman
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback