Using Callgrind
Complete:
Goal of the page
This page is intended to provide a short introduction to callgrind tool and its usage to measure the performance of CMS offline code
Contacts
Vincenzo Innocente
Robin Moser
Introduction
Cachegrind and Callgrind are tools from the
valgrind tool suite
.
Cachegrind is a cache profiler. It performs detailed simulation of the I1, D1 and L2 caches in your CPU and so can accurately pinpoint the sources of cache misses in your code. It identifies the number of cache misses, memory references and instructions executed for each line of source code, with per-function, per-module and whole-program summaries. It is useful with programs written in any language. Cachegrind runs programs about 20--100x slower than normal.
Callgrind Is an extension to Cachegrind (another val. It provides all the information that Cachegrind does, plus extra information about callgraphs. Available separately is an amazing visualisation tool,
KCachegrind, which gives a much better overview of the data that Callgrind collects; it can also be used to visualise Cachegrind's output.
Usage
Callgrind is available together with valgrind on most of the Linux distributions.
CMS distributes its own version of valgrind and callgrind. We recommend therefore to use the version made available in the CMSSW runtime environment.
to instrument an executable for performance measurement (say
cmsrun my.cfg
) just run it under valgrind as
valgrind --tool=callgrind cmsrun my.cfg
from a shell initialized with the CMSSW runtime environement.
Several options exist, in particular to limit the instrumentation to given part of the code.
Please refers to
ProfilerService documentation for mode details.
Documentation
Please refer to the
original documentation
available on the web or with the valgrind distribution
Examples
For more example and a tutorial on how to use callgrind with cms offline software please refer to the
workbook.
Review status
Responsible:
VincenzoInnocente
Last reviewed by: Most recent reviewer
--
CMSUserSupport - 15 Mar 2007