• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSES/H03-May-2022-

cgview/H03-May-2022-215169

converters/H03-May-2022-1,105808

doc/H03-May-2022-1,127988

kcachegrind/H03-May-2022-5,9924,940

libcore/H03-May-2022-12,1998,170

libviews/H03-May-2022-21,17915,372

pics/hicolor/H03-May-2022-

po/H01-Mar-2022-105,56688,451

poqm/H01-Mar-2022-98,23282,398

qcachegrind/H03-May-2022-4,5593,452

.arcconfigH A D27-Feb-202257 43

.gitignoreH A D27-Feb-2022232 2322

AUTHORSH A D27-Feb-202247 21

ChangeLogH A D27-Feb-2022167 75

INSTALLH A D27-Feb-2022131 63

KnownBugsH A D27-Feb-20221 KiB2417

Mainpage.doxH A D27-Feb-2022734 1716

Messages.shH A D27-Feb-2022351 75

READMEH A D27-Feb-20223.4 KiB10974

README_DEVELOPERH A D27-Feb-20223.7 KiB8063

TODOH A D27-Feb-20222.1 KiB9573

kcachegrind.spec.inH A D27-Feb-20221.9 KiB5647

qcg.proH A D27-Feb-2022383 1812

version.h.inH A D27-Feb-202253 21

version.priH A D27-Feb-2022113 43

README

1KCachegrind / QCachegrind
2-========================
3
4{K,Q}Cachegrind is a KDE/Qt GUI to visualize profiling data.
5It's mainly used as visualization frontend for data measured
6by Cachegrind/Callgrind tools from the Valgrind package, but
7there are converters for other measurement tools available.
8
9Features
10
11* direct support for profiles generated by Cachegrind/Callgrind
12* support for arbitrary event types and derived event types
13* sorted function list, with grouping according to ELF object/source
14  file/symbol namespace (such as C++ classes)
15* correct handling of recursive cycles (similar to GProf)
16* various visualization views for a selected function, such as
17  - treemap in caller/callee direction
18  - call graph around function
19  - source & assembly annotation
20
21
22Hmm. What is stuff good for?
23----------------------------
24
25Any work in improving the performance of a program should be
26started with measuring the performance characteristics of the
27optimized binary, using representative input data. This process
28is called "Profiling". Any other way for performance optimization
29usually just wastes developer time.
30Profile measurements show whether optimization is needed at all,
31and what improvement can be expected. Further, it pinpoint at
32functions and source lines where most time is spent, i.e. where an
33improvement has most influence on allover runtime.
34
35{K,Q}Cachegrind visualizes profile measurement data. Example of an
36easy to use profile measurement tool (no source modifications and
37recompilation is required, as well as no root access) are the
38cache simulators Cachegrind and Callgrind from the Valgrind toolset.
39While {K,Q}Cachegrind directly supports the formats of these
40profiling tools, converters are available to allow to import data
41from other profiling tools, too.
42
43
44
45Compilation and Installation
46-===========================
47
48
49QCachegrind
50-----------
51
52Requirements:
53* Qt5.x (x >=2) (earlier versions not tested)
54* Any platform supported by Qt (Linux, Windows, Mac OS X, ...)
55
56Compilation (from base directory):
57
58	qmake; make
59
60To not build in the source directories, do:
61
62	mkdir build; cd build; qmake ../qcg.pro; make
63
64The build includes the command line tool "cgview".
65
66Copy the resulting "qcachegrind" binary from the build directory into
67your $PATH. For better desktop integration, it should be enough to
68copy the .desktop file and icons into standard places, such as:
69
70	sudo install -m 755 qcachegrind/qcachegrind /usr/local/bin
71	sudo install -m 644 qcachegrind/qcachegrind.desktop \
72		/usr/local/share/applications/
73	sudo install -m 644 kcachegrind/hi32-app-kcachegrind.png \
74		/usr/local/share/icons/hicolor/32x32/apps/kcachegrind.png
75	sudo install -m 644 kcachegrind/hi48-app-kcachegrind.png \
76		/usr/local/share/icons/hicolor/48x48/apps/kcachegrind.png
77
78
79KCachegrind
80------------
81
82Requirements:
83* KF 5.12 or higher: Frameworks development packages (libs & headers)
84* CMake
85
86Commands (from base directory):
87
88	cmake .; make; make install
89
90To not build in the source directories, do:
91
92	mkdir build; cd build; cmake ..; make; make install
93
94The build also compiles the command line tool "cgview" and "qcachegrind",
95the Qt-only version of KCachegrind. However, these are not installed.
96If you want to also install qcachegrind, see instructions above.
97
98
99Usage & Help
100-===========
101
102{K,Q}Cachegrind has detailed "What's this?" help for
103each GUI part. For further help, see quick start pages
104on kcachegrind.sf.net
105
106
107
108 Josef Weidendorfer
109

README_DEVELOPER

1A short guide into the internal design of KCachegrind
2=====================================================
3
4
5Basics of the data model
6------------------------
7
8KCachegrind is a visualization of constant data. This makes the
9data model quite simple. However, as the visualization may require
10a lot of aggregation/summation of a huge number of raw data points in
11all kind of different ways, this aggregation is done in a lazy way.
12Only when the visualization asks for aggregated data, and the data was
13never requested before, aggregation is done.
14This makes the loading of large files faster: only the hierarchy of
15records (e.g. instructions belonging to a source line, source lines
16belong to a function, multiple functions are part of an ELF object)
17is built while loading a file, but no aggregation of data is done.
18Further, this reduces memory consumption.
19
20Important classes of the data model:
21
22* TraceData is a representation of profile data from one profile session,
23  possibly consisting of multiple parts, where each part corresponds to a
24  loaded file
25
26* any record/entry of a some profile data is inherited from CostItem,
27  and this is a complete hierarchy, which gets automatically built
28  when loading a file. E.g. TraceData itself inherits from CostItem.
29
30* every record/entry usually consists of different fields, and
31  are indexed by so-called EventType's. So-called "derived" event
32  types are not actually backed by real fields with concrete data,
33  but get calculated on-demand using a given formula referencing
34  fields with real data.
35
36
37Basics of the GUI
38-----------------
39
40At any time, every view visualizes some CostItem from loaded profile data.
41More concretely, the "visualization state" consists of e.g. the
42current CostItem to show, a curent EventType to show, from which
43part(s) to show, which sub-CostItem should be shown selected and so on.
44
45Every view is inherited from the TraceItemView class, which manages the
46visualization state. TraceItemView's can be setup in a hierarchical
47fashion, and make sure to keep the visualization state consistent between
48each other. E.g. item selection by mouse are forwarded to the parent view,
49which passes the new selection back to all its sub-views.
50
51When a subclass of TraceItemView is asked to change its visualization state,
52it actually only starts a timer, and all state change wishes get merged
53until a time-out happens.
54Then, TraceViewItem::doUpdate() gets called with an argument telling what
55parts of the visualization state should be changed. There, one can do
56special handling if only one thing is to be changed, such as selection of
57another CostItem - in such cases, it is not required to refresh the whole
58view. Otherwise, TraceViewItem::refresh() gets called, which is expected
59to do a complete refresh of the visualization.
60
61The basic visualization task of subclasses of TraceItemView's is to visualize
62one CostItem (the "active" CostItem), typically e.g. a function
63(TraceFunction). Further, there is a "selected" CostItem. This usually is
64a subitem of the active, visualized CostItem, e.g. a source line from the
65active function (TraceLine), or another function in the call graph around
66the active function.
67
68TraceItemView's may not be able to show a given CostItem, but want to show
69another CostItem instead, or show nothing. In the latter case, they get
70grayed out. This behavior is encoded through TraceItemView::canShow, which,
71given a CostItem to visualize, returns the replacement it can visualize
72instead, or 0 if it cannot show anything.
73
74Every top-level window visualizes exactly one profile data (_data),
75and consists of some subviews (FunctionSelection on the left, MultiView on
76the right, with various TabViews embedded) which all inherit from
77TraceItemView, always synced to show some visualization state at a given
78time.
79
80