• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

kcachegrind

  • sources
  • kde-4.12
  • kdesdk
  • kcachegrind
  • libviews
callmapview.cpp
Go to the documentation of this file.
1 /* This file is part of KCachegrind.
2  Copyright (C) 2003 Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
3 
4  KCachegrind is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation, version 2.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; see the file COPYING. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 /*
20  * Call Map View
21  */
22 
23 
24 #include "callmapview.h"
25 
26 #include <QPixmap>
27 #include <QAction>
28 #include <QMenu>
29 
30 #include "config.h"
31 #include "globalguiconfig.h"
32 #include "listutils.h"
33 #include "toplevelbase.h"
34 
35 
36 //
37 // CallMapView
38 //
39 
40 
41 // defaults
42 #define DEFAULT_SPLITMODE "Rows"
43 #define DEFAULT_DRAWNAME true
44 #define DEFAULT_DRAWCOST true
45 #define DEFAULT_DRAWLOCATION false
46 #define DEFAULT_DRAWCALLS false
47 #define DEFAULT_FORCESTRINGS false
48 #define DEFAULT_ROTATION true
49 #define DEFAULT_SHADING true
50 #define DEFAULT_STOPNAME ""
51 #define DEFAULT_MAXDEPTH -1
52 #define DEFAULT_MAXAREA 100
53 
54 
55 CallMapView::CallMapView(bool showCallers, TraceItemView* parentView,
56  QWidget* parent, const char* name)
57  : TreeMapWidget(new CallMapBaseItem(), parent), TraceItemView(parentView)
58 {
59  setObjectName(name);
60  _showCallers = showCallers;
61 
62  setFieldType(0, tr("A thing's name", "Name" ));
63  setFieldType(1, tr( "Cost" ));
64  setFieldType(2, tr( "Location" ));
65  setFieldPosition(2, TreeMapItem::TopLeft);
66  setFieldType(3, tr( "Calls" ));
67  setFieldPosition(3, TreeMapItem::TopRight);
68 
69  setSplitMode(DEFAULT_SPLITMODE);
70  setFieldVisible(0, DEFAULT_DRAWNAME);
71  setFieldVisible(1, DEFAULT_DRAWCOST);
72  setFieldVisible(2, DEFAULT_DRAWLOCATION);
73  setFieldVisible(3, DEFAULT_DRAWCALLS);
74  setFieldForced(0, DEFAULT_FORCESTRINGS);
75  setFieldForced(1, DEFAULT_FORCESTRINGS);
76  setFieldForced(2, DEFAULT_FORCESTRINGS);
77  setFieldForced(3, DEFAULT_FORCESTRINGS);
78  setAllowRotation(DEFAULT_ROTATION);
79  setShadingEnabled(DEFAULT_SHADING);
80  setMinimalArea(DEFAULT_MAXAREA);
81 
82  connect(this,
83  SIGNAL(doubleClicked(TreeMapItem*)),
84  SLOT(activatedSlot(TreeMapItem*)));
85  connect(this,
86  SIGNAL(returnPressed(TreeMapItem*)),
87  SLOT(activatedSlot(TreeMapItem*)));
88  connect(this,
89  SIGNAL(currentChanged(TreeMapItem*, bool)),
90  SLOT(selectedSlot(TreeMapItem*, bool)));
91  connect(this,
92  SIGNAL(contextMenuRequested(TreeMapItem*,const QPoint &)),
93  SLOT(context(TreeMapItem*,const QPoint &)));
94 
95  this->setWhatsThis( whatsThis());
96 }
97 
98 QString CallMapView::whatsThis() const
99 {
100  QString s = _showCallers ?
101  tr( "<b>Caller Map</b>"
102  "<p>This graph shows the nested hierarchy of "
103  "all callers of the current activated function. "
104  "Each colored rectangle represents a function; "
105  "its size tries to be proportional to the cost spent "
106  "therein while the active function is running "
107  "(however, there are drawing constraints).</p>") :
108  tr("<b>Call Map</b>"
109  "<p>This graph shows the nested hierarchy of "
110  "all callees of the current activated function. "
111  "Each colored rectangle represents a function; "
112  "its size tries to be proportional to the cost spent "
113  "therein while the active function is running "
114  "(however, there are drawing constraints).</p>");
115 
116  s += tr( "<p>Appearance options can be found in the "
117  "in the context menu. To get exact size proportions, "
118  "choose 'Hide incorrect borders'. As this mode can be "
119  "<em>very</em> time consuming, you may want to limit "
120  "the maximum drawn nesting level before. "
121  "'Best' determinates the split direction for children "
122  "from the aspect ratio of the parent. "
123  "'Always Best' decides on remaining space for each "
124  "sibling. "
125  "'Ignore Proportions' takes space for function name "
126  "drawing <em>before</em> drawing children. Note that "
127  "size proportions can get <em>heavily</em> wrong.</p>"
128 
129  "<p>This is a <em>TreeMap</em> widget. "
130  "Keyboard navigation is available with the left/right arrow "
131  "keys for traversing siblings, and up/down arrow keys "
132  "to go a nesting level up/down. "
133  "<em>Return</em> activates the current item.</p>");
134 
135  return s;
136 }
137 
138 void CallMapView::setData(TraceData* d)
139 {
140  TraceItemView::setData(d);
141 
142  ((CallMapBaseItem*)base())->setFunction(0);
143 }
144 
145 void CallMapView::addItemListMenu(QMenu* menu, TreeMapItem* item)
146 {
147  QAction* a;
148 
149  QMenu* m = menu->addMenu(tr("Go To"));
150  int count = 0;
151  while (count<GlobalConfig::maxSymbolCount() && item) {
152  QString name = item->text(0);
153  a = m->addAction(GlobalConfig::shortenSymbol(name));
154  a->setData(QVariant::fromValue( (void*)item ));
155  item = item->parent();
156  count++;
157  }
158  connect(m, SIGNAL(triggered(QAction*)),
159  this, SLOT(mapItemTriggered(QAction*)) );
160 }
161 
162 void CallMapView::mapItemTriggered(QAction* a)
163 {
164  activatedSlot( (TreeMapItem*) a->data().value<void*>() );
165 }
166 
167 QAction* CallMapView::addDrawingDepthAction(QMenu* m,
168  const QString& s, int d)
169 {
170  QAction* a = m->addAction(s);
171  a->setData(d);
172  a->setCheckable(true);
173  a->setChecked(maxDrawingDepth() == d);
174  return a;
175 }
176 
177 void CallMapView::addDrawingDepthMenu(QMenu* menu,
178  TreeMapItem* i, const QString& name)
179 {
180  QMenu* m = menu->addMenu(tr("Stop at Depth"));
181  addDrawingDepthAction(m, tr("No Depth Limit"), -1);
182  m->addSeparator();
183  addDrawingDepthAction(m, tr("Depth 10"), 10);
184  addDrawingDepthAction(m, tr("Depth 15"), 15);
185  addDrawingDepthAction(m, tr("Depth 20"), 20);
186  if (i) {
187  m->addSeparator();
188  addDrawingDepthAction(m, tr("Depth of '%1' (%2)")
189  .arg(name).arg(i->depth()),
190  i->depth());
191  }
192  int maxDepth = maxDrawingDepth();
193  if (maxDepth>0) {
194  m->addSeparator();
195  addDrawingDepthAction(m, tr("Decrement Depth (to %1)").arg(maxDepth-1),
196  maxDepth-1);
197  addDrawingDepthAction(m, tr("Increment Depth (to %1)").arg(maxDepth+1),
198  maxDepth+1);
199  }
200 
201  connect(m, SIGNAL(triggered(QAction*)),
202  this, SLOT(drawingDepthTriggered(QAction*)) );
203 }
204 
205 void CallMapView::drawingDepthTriggered(QAction* a)
206 {
207  setMaxDrawingDepth(a->data().toInt());
208 }
209 
210 QAction* CallMapView::addStopFunctionAction(QMenu* m,
211  const QString& s,
212  const QString& v)
213 {
214  QAction* a = m->addAction(s);
215  a->setData(v);
216  a->setCheckable(true);
217  a->setChecked(fieldStop(0) == v);
218  return a;
219 }
220 
221 void CallMapView::addStopFunctionMenu(QMenu* menu, TreeMapItem* item)
222 {
223  QMenu* m = menu->addMenu(tr("Stop at Function"));
224  addStopFunctionAction(m, tr("No Function Limit"), QString());
225 
226  bool foundStopName = false;
227  QAction* a;
228  if (item) {
229  m->addSeparator();
230  int count = 0;
231  while (count<GlobalConfig::maxSymbolCount() && item) {
232  QString name = GlobalConfig::shortenSymbol(item->text(0));
233  a = addStopFunctionAction(m, name, item->text(0));
234  if (a->isChecked()) foundStopName = true;
235  item = item->parent();
236  count++;
237  }
238  }
239  if (!foundStopName && !fieldStop(0).isEmpty()) {
240  m->addSeparator();
241  QString name = GlobalConfig::shortenSymbol(fieldStop(0));
242  addStopFunctionAction(m, name, fieldStop(0));
243  }
244 
245  connect(m, SIGNAL(triggered(QAction*)),
246  this, SLOT(stopFunctionTriggered(QAction*)) );
247 }
248 
249 void CallMapView::stopFunctionTriggered(QAction* a)
250 {
251  setFieldStop(0, a->data().toString());
252 }
253 
254 QAction* CallMapView::addAreaLimitAction(QMenu* m,
255  const QString& s, int v)
256 {
257  QAction* a = m->addAction(s);
258  a->setData(v);
259  a->setCheckable(true);
260  a->setChecked(minimalArea() == v);
261  return a;
262 }
263 
264 void CallMapView::addAreaLimitMenu(QMenu* menu, TreeMapItem* i,
265  const QString& name)
266 {
267  QMenu* m = menu->addMenu(tr("Stop at Area"));
268  addAreaLimitAction(m, tr("No Area Limit"), -1);
269  m->addSeparator();
270  addAreaLimitAction(m, tr("100 Pixels"), 100);
271  addAreaLimitAction(m, tr("200 Pixels"), 200);
272  addAreaLimitAction(m, tr("500 Pixels"), 500);
273  addAreaLimitAction(m, tr("1000 Pixels"), 1000);
274 
275  int currentArea = 0;
276  if (i) {
277  currentArea = i->width() * i->height();
278  m->addSeparator();
279  addAreaLimitAction(m, tr("Area of '%1' (%2)")
280  .arg(name).arg(currentArea), currentArea);
281  }
282  int mArea = minimalArea();
283  if (mArea>0) {
284  m->addSeparator();
285  addAreaLimitAction(m, tr("Double Area Limit (to %1)")
286  .arg(mArea*2), mArea*2);
287  addAreaLimitAction(m, tr("Half Area Limit (to %1)")
288  .arg(mArea/2), mArea/2);
289  }
290 
291  connect(m, SIGNAL(triggered(QAction*)),
292  this, SLOT(areaLimitTriggered(QAction*)) );
293 }
294 
295 void CallMapView::areaLimitTriggered(QAction* a)
296 {
297  setMinimalArea(a->data().toInt());
298 }
299 
300 QAction* CallMapView::addBorderWidthAction(QMenu* m, const QString& s, int v)
301 {
302  QAction* a = m->addAction(s);
303  a->setData(v);
304  a->setCheckable(true);
305  a->setChecked(borderWidth() == v);
306  return a;
307 }
308 
309 void CallMapView::borderWidthTriggered(QAction* a)
310 {
311  setBorderWidth(a->data().toInt());
312 }
313 
314 void CallMapView::context(TreeMapItem* i,const QPoint & p)
315 {
316  if (!i) return;
317 
318  QMenu popup;
319  QAction* a;
320 
321  QString shortCurrentName;
322  if (i) {
323  shortCurrentName = GlobalConfig::shortenSymbol(i->text(0));
324  }
325 
326  if (i) {
327  addItemListMenu(&popup, i);
328  popup.addSeparator();
329  }
330  addGoMenu(&popup);
331  popup.addSeparator();
332  addDrawingDepthMenu(&popup, i, shortCurrentName);
333  addStopFunctionMenu(&popup, i);
334  addAreaLimitMenu(&popup, i, shortCurrentName);
335  popup.addSeparator();
336 
337  QMenu* vpopup = popup.addMenu(tr("Visualization"));
338  QMenu* spopup = vpopup->addMenu(tr("Split Direction"));
339  addSplitDirectionItems(spopup);
340 
341  QAction* skipBorderAction = vpopup->addAction(tr("Skip Incorrect Borders"));
342  skipBorderAction->setEnabled(!_showCallers);
343  skipBorderAction->setCheckable(true);
344  skipBorderAction->setChecked(skipIncorrectBorder());
345 
346  QMenu* bpopup = vpopup->addMenu(tr("Border Width"));
347  a = addBorderWidthAction(bpopup, tr("Border 0"), 0);
348  a->setEnabled(!_showCallers);
349  addBorderWidthAction(bpopup, tr("Border 1"), 1);
350  addBorderWidthAction(bpopup, tr("Border 2"), 2);
351  addBorderWidthAction(bpopup, tr("Border 3"), 3);
352  connect(bpopup, SIGNAL(triggered(QAction*)),
353  this, SLOT(borderWidthTriggered(QAction*)) );
354  vpopup->addSeparator();
355 
356  QAction* drawNamesAction = vpopup->addAction(tr("Draw Symbol Names"));
357  drawNamesAction->setCheckable(true);
358  QAction* drawCostAction = vpopup->addAction(tr("Draw Cost"));
359  drawCostAction->setCheckable(true);
360  QAction* drawLocationAction = vpopup->addAction(tr("Draw Location"));
361  drawLocationAction->setCheckable(true);
362  QAction* drawCallsAction = vpopup->addAction(tr("Draw Calls"));
363  drawCallsAction->setCheckable(true);
364  vpopup->addSeparator();
365 
366  QAction* ignorePropAction = vpopup->addAction(tr("Ignore Proportions"));
367  ignorePropAction->setCheckable(true);
368  QAction* allowRotationAction = vpopup->addAction(tr("Allow Rotation"));
369  allowRotationAction->setCheckable(true);
370  if (!fieldVisible(0) &&
371  !fieldVisible(1) &&
372  !fieldVisible(2) &&
373  !fieldVisible(3)) {
374  ignorePropAction->setEnabled(false);
375  allowRotationAction->setEnabled(false);
376  }
377  else {
378  drawNamesAction->setChecked(fieldVisible(0));
379  drawCostAction->setChecked(fieldVisible(1));
380  drawLocationAction->setChecked(fieldVisible(2));
381  drawCallsAction->setChecked(fieldVisible(3));
382  ignorePropAction->setChecked(fieldForced(0));
383  allowRotationAction->setChecked(allowRotation());
384  }
385 
386  QAction* drawShadingAction = vpopup->addAction(tr("Shading"));
387  drawShadingAction->setCheckable(true);
388  drawShadingAction->setChecked(isShadingEnabled());
389 
390  a = popup.exec(mapToGlobal(p));
391  if (a == drawNamesAction)
392  setFieldVisible(0, !fieldVisible(0));
393  else if (a == drawCostAction)
394  setFieldVisible(1, !fieldVisible(1));
395  else if (a == drawLocationAction)
396  setFieldVisible(2, !fieldVisible(2));
397  else if (a == drawCallsAction)
398  setFieldVisible(3, !fieldVisible(3));
399  else if (a == ignorePropAction) {
400  bool newSetting = !fieldForced(0);
401  setFieldForced(0, newSetting);
402  setFieldForced(1, newSetting);
403  setFieldForced(2, newSetting);
404  setFieldForced(3, newSetting);
405  }
406  else if (a == allowRotationAction)
407  setAllowRotation(!allowRotation());
408  else if (a == drawShadingAction)
409  setShadingEnabled(!isShadingEnabled());
410  else if (a == skipBorderAction)
411  setSkipIncorrectBorder(!skipIncorrectBorder());
412 }
413 
414 void CallMapView::activatedSlot(TreeMapItem* item)
415 {
416  if (!item) return;
417 
418  if (item->rtti() == 1) {
419  CallMapBaseItem* bi = (CallMapBaseItem*)item;
420  activated(bi->function());
421  }
422  else if (item->rtti() == 2) {
423  CallMapCallingItem* ci = (CallMapCallingItem*)item;
424  activated(ci->function());
425  }
426  else if (item->rtti() == 3) {
427  CallMapCallerItem* ci = (CallMapCallerItem*)item;
428  activated(ci->function());
429  }
430 }
431 
432 void CallMapView::selectedSlot(TreeMapItem* item, bool kbd)
433 {
434  if (!item) return;
435  if (item->text(0).isEmpty()) return;
436 
437  if (kbd) {
438  QString msg = tr("Call Map: Current is '%1'").arg(item->text(0));
439  if (_topLevel)
440  _topLevel->showMessage(msg, 5000);
441  }
442 
443  TraceFunction* f = 0;
444 
445  if (item->rtti() == 1) {
446  CallMapBaseItem* bi = (CallMapBaseItem*)item;
447  f = bi->function();
448  }
449  else if (item->rtti() == 2) {
450  CallMapCallingItem* ci = (CallMapCallingItem*)item;
451  f = ci->function();
452  }
453  else if (item->rtti() == 3) {
454  CallMapCallerItem* ci = (CallMapCallerItem*)item;
455  f = ci->function();
456  }
457  if (f) {
458  // this avoids marking
459  _selectedItem = f;
460  selected(f);
461  }
462 }
463 
464 CostItem* CallMapView::canShow(CostItem* i)
465 {
466  ProfileContext::Type t = i ? i->type() : ProfileContext::InvalidType;
467 
468  switch(t) {
469  case ProfileContext::Function:
470  case ProfileContext::FunctionCycle:
471  return i;
472  default:
473  break;
474  }
475  return 0;
476 }
477 
478 void CallMapView::doUpdate(int changeType, bool)
479 {
480  if (changeType == eventType2Changed) return;
481 
482  // if there is a selected item, always draw marking...
483  if (changeType & selectedItemChanged) {
484  TraceFunction* f = 0;
485 
486  if (_selectedItem) {
487  switch(_selectedItem->type()) {
488  case ProfileContext::Function:
489  case ProfileContext::FunctionCycle:
490  f = (TraceFunction*)_selectedItem;
491  break;
492  default:
493  break;
494  }
495  }
496  // if this is the only change...
497  if (changeType == selectedItemChanged) {
498  setMarked(f ? 1:0, true);
499  return;
500  }
501  setMarked(f ? 1:0, false);
502  }
503 
504 
505  if (changeType & activeItemChanged) {
506  TraceFunction* f = 0;
507 
508  if (_activeItem) {
509  switch(_activeItem->type()) {
510  case ProfileContext::Function:
511  case ProfileContext::FunctionCycle:
512  f = (TraceFunction*)_activeItem;
513  break;
514  default:
515  break;
516  }
517  }
518  ((CallMapBaseItem*)base())->setFunction(f);
519  }
520  else if ( ((changeType & partsChanged) && GlobalConfig::showCycles()) ||
521  (changeType & dataChanged) ||
522  (changeType & configChanged)) {
523  /* regenerates the treemap because traceitems were added/removed */
524  base()->refresh();
525  }
526  else if ((changeType & partsChanged) ||
527  (changeType & eventTypeChanged)) {
528  /* we need to do the draw order sorting again as the values change */
529  resort();
530  redraw();
531  }
532  else
533  redraw();
534 }
535 
536 
537 
538 QColor CallMapView::groupColor(TraceFunction* f) const
539 {
540  if (!f)
541  return palette().color( QPalette::Button );
542 
543  return GlobalGUIConfig::functionColor(_groupType, f);
544 }
545 
546 
547 QString CallMapView::tipString(TreeMapItem* i) const
548 {
549  QString tip, itemTip;
550  int count = 0;
551 
552  //qDebug("CallMapView::tipString for '%s'", i->text(0).toAscii());
553 
554  // first, SubPartItem's
555  while (i && count<GlobalConfig::maxSymbolCount()) {
556  itemTip = GlobalConfig::shortenSymbol(i->text(0));
557 
558  if (!i->text(1).isEmpty())
559  itemTip += " (" + i->text(1) + ')';
560 
561  if (!tip.isEmpty()) tip += '\n';
562 
563  tip += itemTip;
564  i = i->parent();
565  count++;
566  }
567  if (count == GlobalConfig::maxSymbolCount()) tip += "\n...";
568 
569  return tip;
570 }
571 
572 
573 ProfileCostArray* CallMapView::totalCost()
574 {
575  TraceFunction* f = ((CallMapBaseItem*)base())->function();
576  if (!f) return 0;
577 
578  return GlobalConfig::showExpanded() ? f->inclusive() : f->data();
579 }
580 
581 
582 
583 
584 // CallMapBaseItem
585 
586 CallMapBaseItem::CallMapBaseItem()
587 {
588  _f = 0;
589 }
590 
591 void CallMapBaseItem::setFunction(TraceFunction* f)
592 {
593  if (f == _f) return;
594 
595  _f = f;
596  refresh();
597 }
598 
599 
600 QString CallMapBaseItem::text(int textNo) const
601 {
602  if (textNo == 0) {
603  if (!_f)
604  return QObject::tr("(no function)");
605 
606  return _f->prettyName();
607  }
608 
609  if (!_f) return QString();
610 
611  if (textNo == 2) return _f->prettyLocation();
612  if (textNo == 3) return _f->calledCount().pretty();
613  if (textNo != 1) return QString();
614 
615  EventType* ct = ((CallMapView*)widget())->eventType();
616  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
617 
618  if (GlobalConfig::showPercentage()) {
619  double sum, total = t->subCost(ct);
620  if (total == 0.0)
621  sum = 100.0;
622  else
623  sum = 100.0 * _f->inclusive()->subCost(ct) / total;
624 
625  return QString("%1 %")
626  .arg(sum, 0, 'f', GlobalConfig::percentPrecision());
627  }
628  return _f->inclusive()->prettySubCost(ct);
629 }
630 
631 QPixmap CallMapBaseItem::pixmap(int i) const
632 {
633  if ((i != 1) || !_f) return QPixmap();
634 
635  EventType* ct = ((CallMapView*)widget())->eventType();
636  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
637 
638  // colored level meter with frame
639  return costPixmap( ct, _f->inclusive(), (double) (t->subCost(ct)), true);
640 }
641 
642 
643 double CallMapBaseItem::value() const
644 {
645  if (!_f) return 0.0;
646 
647  EventType* ct;
648  ct = ((CallMapView*)widget())->eventType();
649  return (double) _f->inclusive()->subCost(ct);
650 }
651 
652 
653 double CallMapBaseItem::sum() const
654 {
655  if (!_f) return 0.0;
656 
657  CallMapView* w = (CallMapView*)widget();
658 
659  if (w->showCallers())
660  return 0.0;
661  else
662  return (double) _f->inclusive()->subCost(w->eventType());
663 }
664 
665 
666 bool CallMapBaseItem::isMarked(int) const
667 {
668  return ((CallMapView*)widget())->selectedItem() == _f;
669 }
670 
671 TreeMapItemList* CallMapBaseItem::children()
672 {
673  if (_f && !initialized()) {
674  CallMapView* w = (CallMapView*)widget();
675 
676  if (0) qDebug("Create Function %s (%s)",
677  w->showCallers() ? "Callers":"Callees",
678  qPrintable(text(0)));
679 
680  setSorting(-1);
681  if (w->showCallers()) {
682  foreach(TraceCall* call, _f->callers()) {
683  // do not show calls inside of a cycle
684  if (call->inCycle()>0) continue;
685  if (call->isRecursion()) continue;
686 
687  addItem(new CallMapCallerItem(1.0, call));
688  }
689 
690  setSum(0);
691  }
692  else {
693  foreach(TraceCall* call, _f->callings()) {
694  // do not show calls inside of a cycle
695  if (call->inCycle()>0) continue;
696  if (call->isRecursion()) continue;
697 
698  CallMapCallingItem* i = new CallMapCallingItem(1.0, call);
699  i->init();
700  addItem(i);
701  }
702 
703  setSum(_f->inclusive()->subCost(w->eventType()));
704  }
705  setSorting(-2, false);
706  }
707 
708  return _children;
709 }
710 
711 QColor CallMapBaseItem::backColor() const
712 {
713  return ((CallMapView*)widget())->groupColor(_f);
714 }
715 
716 
717 
718 // CallMapCallingItems
719 
720 CallMapCallingItem::CallMapCallingItem(double factor, TraceCall* c)
721 {
722  _factor = factor;
723  _c = c;
724 }
725 
726 void CallMapCallingItem::init()
727 {
728 #if 0
729  // create assoziation: if not possible, i.e. an ass. already exists
730  // for the function, we need to draw the recursive version
731  _recursive = !setFunction(_c->called());
732  _valid = true;
733 #endif
734 }
735 
736 QString CallMapCallingItem::text(int textNo) const
737 {
738  if (textNo == 0) {
739  if (!_c)
740  return QObject::tr("(no call)");
741 
742  return _c->calledName();
743  }
744 
745  if (textNo == 2) return _c->called()->prettyLocation();
746  if (textNo == 3) return SubCost(_factor * _c->callCount()).pretty();
747  if (textNo != 1) return QString();
748 
749  EventType* ct;
750  ct = ((CallMapView*)widget())->eventType();
751 
752  SubCost val = SubCost(_factor * _c->subCost(ct));
753  if (GlobalConfig::showPercentage()) {
754  // percentage relative to function cost
755  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
756  double p = 100.0 * _factor * _c->subCost(ct) / t->subCost(ct);
757  return QString("%1 %")
758  .arg(p, 0, 'f', GlobalConfig::percentPrecision());
759  }
760  return val.pretty();
761 }
762 
763 QPixmap CallMapCallingItem::pixmap(int i) const
764 {
765  if (i != 1) return QPixmap();
766 
767  // Cost pixmap
768  EventType* ct = ((CallMapView*)widget())->eventType();
769  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
770 
771  // colored level meter with frame
772  return costPixmap( ct, _c, t->subCost(ct) / _factor, true);
773 }
774 
775 
776 double CallMapCallingItem::value() const
777 {
778  EventType* ct;
779  ct = ((CallMapView*)widget())->eventType();
780  return _factor * _c->subCost(ct);
781 }
782 
783 double CallMapCallingItem::sum() const
784 {
785  return value();
786 }
787 
788 bool CallMapCallingItem::isMarked(int) const
789 {
790  return ((CallMapView*)widget())->selectedItem() == _c->called();
791 }
792 
793 
794 TreeMapItemList* CallMapCallingItem::children()
795 {
796  if (!initialized()) {
797  if (0) qDebug("Create Calling subitems (%s)",
798  qPrintable(path(0).join("/")));
799 
800  EventType* ct;
801  ct = ((CallMapView*)widget())->eventType();
802 
803  // same as sum()
804  SubCost s = _c->called()->inclusive()->subCost(ct);
805  SubCost v = _c->subCost(ct);
806  if (v>s) {
807  qDebug("Warning: CallingItem subVal %u > Sum %u (%s)",
808  (unsigned)v, (unsigned)s, qPrintable(_c->called()->prettyName()));
809  v = s;
810  }
811  double newFactor = _factor * v / s;
812 
813 #if 0
814  qDebug("CallingItem: Subitems of %s => %s, factor %f * %d/%d => %f",
815  qPrintable(_c->caller()->prettyName()),
816  qPrintable(_c->called()->prettyName()),
817  _factor, v, s, newFactor);
818 #endif
819  setSorting(-1);
820  foreach(TraceCall* call, _c->called()->callings()) {
821  // do not show calls inside of a cycle
822  if (call->inCycle()>0) continue;
823  if (call->isRecursion()) continue;
824 
825  CallMapCallingItem* i = new CallMapCallingItem(newFactor, call);
826  i->init();
827  addItem(i);
828  }
829  setSorting(-2, false);
830  }
831 
832  return _children;
833 }
834 
835 
836 QColor CallMapCallingItem::backColor() const
837 {
838  CallMapView* w = (CallMapView*)widget();
839  return w->groupColor(_c->called());
840 }
841 
842 
843 // CallMapCallerItem
844 
845 CallMapCallerItem::CallMapCallerItem(double factor, TraceCall* c)
846 {
847  _factor = factor;
848  _c = c;
849 }
850 
851 QString CallMapCallerItem::text(int textNo) const
852 {
853  if (textNo == 0) {
854  if (!_c)
855  return QObject::tr("(no call)");
856 
857  return _c->callerName();
858  }
859 
860  if (textNo == 2) return _c->caller()->prettyLocation();
861  if (textNo == 3) return SubCost(_factor * _c->callCount()).pretty();
862  if (textNo != 1) return QString();
863 
864  EventType* ct;
865  ct = ((CallMapView*)widget())->eventType();
866 
867  SubCost val = SubCost(_factor * _c->subCost(ct));
868  if (GlobalConfig::showPercentage()) {
869  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
870  double p = 100.0 * _factor * _c->subCost(ct) / t->subCost(ct);
871  return QString("%1 %")
872  .arg(p, 0, 'f', GlobalConfig::percentPrecision());
873  }
874  return val.pretty();
875 }
876 
877 
878 QPixmap CallMapCallerItem::pixmap(int i) const
879 {
880  if (i != 1) return QPixmap();
881 
882  // Cost pixmap
883  EventType* ct = ((CallMapView*)widget())->eventType();
884  ProfileCostArray* t = ((CallMapView*)widget())->totalCost();
885 
886  // colored level meter with frame
887  return costPixmap( ct, _c, t->subCost(ct) / _factor, true );
888 }
889 
890 
891 double CallMapCallerItem::value() const
892 {
893  EventType* ct;
894  ct = ((CallMapView*)widget())->eventType();
895  return (double) _c->subCost(ct);
896 }
897 
898 bool CallMapCallerItem::isMarked(int) const
899 {
900  return ((CallMapView*)widget())->selectedItem() == _c->caller();
901 }
902 
903 
904 TreeMapItemList* CallMapCallerItem::children()
905 {
906  if (!initialized()) {
907  //qDebug("Create Caller subitems (%s)", name().toAscii());
908 
909  EventType* ct;
910  ct = ((CallMapView*)widget())->eventType();
911 
912  SubCost s = _c->caller()->inclusive()->subCost(ct);
913  SubCost v = _c->subCost(ct);
914  double newFactor = _factor * v / s;
915 
916 
917 #if 0
918  qDebug("CallerItem: Subitems of %s => %s, factor %f * %d/%d => %f",
919  qPrintable(_c->caller()->prettyName()),
920  qPrintable(_c->called()->prettyName()),
921  _factor, v, s, newFactor);
922 #endif
923  setSorting(-1);
924 
925  foreach(TraceCall* call, _c->caller()->callers()) {
926  // do not show calls inside of a cycle
927  if (call->inCycle()>0) continue;
928  if (call->isRecursion()) continue;
929 
930  TreeMapItem* i = new CallMapCallerItem(newFactor, call);
931  addItem(i);
932  }
933  setSorting(-2, false);
934  }
935 
936  return _children;
937 }
938 
939 QColor CallMapCallerItem::backColor() const
940 {
941  CallMapView* w = (CallMapView*)widget();
942  return w->groupColor(_c->caller());
943 }
944 
945 void CallMapView::restoreOptions(const QString& prefix, const QString& postfix)
946 {
947  ConfigGroup* g = ConfigStorage::group(prefix, postfix);
948 
949  setSplitMode(g->value("SplitMode", QString(DEFAULT_SPLITMODE)).toString());
950 
951  setFieldVisible(0, g->value("DrawName", DEFAULT_DRAWNAME).toBool());
952  setFieldVisible(1, g->value("DrawCost", DEFAULT_DRAWCOST).toBool());
953  setFieldVisible(2, g->value("DrawLocation", DEFAULT_DRAWLOCATION).toBool());
954  setFieldVisible(3, g->value("DrawCalls", DEFAULT_DRAWCALLS).toBool());
955 
956  bool enable = g->value("ForceStrings", DEFAULT_FORCESTRINGS).toBool();
957  setFieldForced(0, enable);
958  setFieldForced(1, enable);
959  setFieldForced(2, enable);
960  setFieldForced(3, enable);
961 
962  setAllowRotation(g->value("AllowRotation", DEFAULT_ROTATION).toBool());
963  setShadingEnabled(g->value("Shading", DEFAULT_SHADING).toBool());
964  setFieldStop(0, g->value("StopName", QString(DEFAULT_STOPNAME)).toString());
965  setMaxDrawingDepth(g->value("MaxDepth", DEFAULT_MAXDEPTH).toInt());
966  setMinimalArea(g->value("MaxArea", DEFAULT_MAXAREA).toInt());
967 
968  delete g;
969 }
970 
971 void CallMapView::saveOptions(const QString& prefix, const QString& postfix)
972 {
973  ConfigGroup* g = ConfigStorage::group(prefix + postfix);
974 
975  g->setValue("SplitMode", splitModeString(), QString(DEFAULT_SPLITMODE));
976  g->setValue("DrawName", fieldVisible(0), DEFAULT_DRAWNAME);
977  g->setValue("DrawCost", fieldVisible(1), DEFAULT_DRAWCOST);
978  g->setValue("DrawLocation", fieldVisible(2), DEFAULT_DRAWLOCATION);
979  g->setValue("DrawCalls", fieldVisible(3), DEFAULT_DRAWCALLS);
980  // when option for all text (0-3)
981  g->setValue("ForceStrings", fieldForced(0), DEFAULT_FORCESTRINGS);
982 
983  g->setValue("AllowRotation", allowRotation(), DEFAULT_ROTATION);
984  g->setValue("Shading", isShadingEnabled(), DEFAULT_SHADING);
985 
986  g->setValue("StopName", fieldStop(0), QString(DEFAULT_STOPNAME));
987  g->setValue("MaxDepth", maxDrawingDepth(), DEFAULT_MAXDEPTH);
988  g->setValue("MaxArea", minimalArea(), DEFAULT_MAXAREA);
989 
990  delete g;
991 }
992 
993 #include "callmapview.moc"
TreeMapWidget::base
TreeMapItem * base() const
Returns the TreeMapItem filling out the widget space.
Definition: treemap.h:411
TreeMapItem::initialized
bool initialized()
Definition: treemap.cpp:973
TraceItemView::selectedItemChanged
Definition: traceitemview.h:86
DEFAULT_ROTATION
#define DEFAULT_ROTATION
Definition: callmapview.cpp:48
TraceCall::isRecursion
bool isRecursion()
Definition: tracedata.h:844
TraceItemView::_topLevel
TopLevelBase * _topLevel
Definition: traceitemview.h:207
CallMapView::setData
void setData(TraceData *)
Definition: callmapview.cpp:138
CallMapBaseItem::backColor
QColor backColor() const
Definition: callmapview.cpp:711
TreeMapWidget::setFieldStop
void setFieldStop(int, const QString &)
Stop drawing at item with name.
Definition: treemap.cpp:1388
TraceItemView::_selectedItem
CostItem * _selectedItem
Definition: traceitemview.h:211
GlobalConfig::showPercentage
static bool showPercentage()
Definition: globalconfig.cpp:328
TreeMapWidget::setFieldPosition
void setFieldPosition(int, DrawParams::Position)
Set the field position in the area.
Definition: treemap.cpp:1442
ProfileCostArray::subCost
SubCost subCost(EventType *)
Returns a sub cost.
Definition: costitem.cpp:591
TreeMapWidget::setSplitMode
void setSplitMode(TreeMapItem::SplitMode m)
for setting/getting global split direction
Definition: treemap.cpp:1209
ProfileContext::FunctionCycle
Definition: context.h:46
TreeMapWidget::minimalArea
int minimalArea() const
Definition: treemap.h:551
TraceItemView::eventType
EventType * eventType() const
Definition: traceitemview.h:151
TreeMapItem::setSum
void setSum(double s)
Definition: treemap.h:320
TreeMapWidget::allowRotation
bool allowRotation() const
Definition: treemap.h:602
TreeMapWidget::addSplitDirectionItems
void addSplitDirectionItems(QMenu *)
Populate given menu with option items.
Definition: treemap.cpp:2848
CallMapBaseItem::sum
double sum() const
Definition: callmapview.cpp:653
TraceFunction::callings
const TraceCallList & callings(bool skipCycle=false) const
Definition: tracedata.cpp:2302
CallMapCallingItem::text
QString text(int) const
Definition: callmapview.cpp:736
TreeMapWidget::setShadingEnabled
void setShadingEnabled(bool s)
Definition: treemap.cpp:1257
TraceCall::caller
TraceFunction * caller(bool skipCycle=false) const
Definition: tracedata.cpp:1230
CostItem::type
ProfileContext::Type type() const
Definition: costitem.h:45
GlobalGUIConfig::functionColor
static QColor functionColor(ProfileContext::Type gt, TraceFunction *)
Definition: globalguiconfig.cpp:205
TraceItemView::configChanged
Definition: traceitemview.h:88
ProfileCostArray::prettySubCost
QString prettySubCost(EventType *)
Returns a cost attribute converted to a string (with space after every 3 digits)
Definition: costitem.cpp:601
QWidget
TraceFunction
A traced function.
Definition: tracedata.h:1122
CallMapBaseItem::value
double value() const
Definition: callmapview.cpp:643
CallMapCallingItem::sum
double sum() const
Definition: callmapview.cpp:783
TraceItemView::addGoMenu
void addGoMenu(QMenu *)
Definition: traceitemview.cpp:461
TraceCallCost::callCount
SubCost callCount()
Definition: tracedata.cpp:125
CallMapView::totalCost
ProfileCostArray * totalCost()
Definition: callmapview.cpp:573
ConfigGroup::setValue
virtual void setValue(const QString &key, const QVariant &value, const QVariant &defaultValue=QVariant())
Definition: config.cpp:57
TreeMapItem::rtti
virtual int rtti() const
Definition: treemap.cpp:1084
TreeMapItem::height
int height() const
Definition: treemap.h:296
CallMapView
Definition: callmapview.h:35
CostItem
Base class for cost items.
Definition: costitem.h:37
config.h
TreeMapWidget::setMinimalArea
void setMinimalArea(int area)
Minimal area for rectangles to draw.
Definition: treemap.cpp:1492
CallMapCallingItem::pixmap
QPixmap pixmap(int) const
Definition: callmapview.cpp:763
CallMapView::CallMapView
CallMapView(bool showCallers, TraceItemView *parentView, QWidget *parent=0, const char *name=0)
Definition: callmapview.cpp:55
TreeMapWidget::skipIncorrectBorder
bool skipIncorrectBorder() const
Definition: treemap.h:539
TreeMapWidget::setFieldVisible
void setFieldVisible(int, bool)
Should the text with number textNo be visible? This is only done if remaining space is enough to allo...
Definition: treemap.cpp:1404
TreeMapWidget::setBorderWidth
void setBorderWidth(int w)
Definition: treemap.cpp:1306
TraceItemView::_groupType
ProfileContext::Type _groupType
Definition: traceitemview.h:213
DEFAULT_MAXAREA
#define DEFAULT_MAXAREA
Definition: callmapview.cpp:52
TraceFunction::callers
TraceCallList callers(bool skipCycle=false) const
Definition: tracedata.cpp:2278
EventType
A cost type, e.g.
Definition: eventtype.h:43
CallMapCallerItem
Definition: callmapview.h:129
TreeMapWidget::fieldForced
bool fieldForced(int) const
Definition: treemap.cpp:1434
DrawParams::TopLeft
Definition: treemap.h:68
ConfigStorage::group
static ConfigGroup * group(const QString &group, const QString &optSuffix=QString())
Definition: config.cpp:80
TraceItemView
Abstract Base Class for KCachegrind Views.
Definition: traceitemview.h:70
TraceItemView::setData
virtual void setData(TraceData *d)
Definition: traceitemview.cpp:165
TreeMapWidget::fieldStop
QString fieldStop(int) const
Definition: treemap.cpp:1398
CallMapCallerItem::children
TreeMapItemList * children()
Definition: callmapview.cpp:904
TreeMapWidget::returnPressed
void returnPressed(TreeMapItem *)
TraceCall::callerName
QString callerName(bool skipCycle=false) const
Definition: tracedata.cpp:1248
CallMapView::showCallers
bool showCallers() const
Definition: callmapview.h:51
CallMapCallingItem
Definition: callmapview.h:108
CallMapCallerItem::isMarked
bool isMarked(int) const
Definition: callmapview.cpp:898
TraceItemView::partsChanged
Definition: traceitemview.h:84
TreeMapItem::parent
TreeMapItem * parent() const
Parent Item.
Definition: treemap.h:286
TreeMapWidget::redraw
void redraw()
Definition: treemap.h:631
ProfileCostArray
An array of basic cost metrics for a trace item.
Definition: costitem.h:144
toplevelbase.h
TreeMapWidget
Class for visualization of a metric of hierarchically nested items as 2D areas.
Definition: treemap.h:393
TraceItemView::dataChanged
Definition: traceitemview.h:87
TreeMapWidget::setAllowRotation
void setAllowRotation(bool)
Do we allow the texts to be rotated by 90 degrees for better fitting?
Definition: treemap.cpp:1281
TreeMapWidget::resort
void resort()
Resort all TreeMapItems.
Definition: treemap.h:636
TreeMapItem::refresh
void refresh()
Definition: treemap.cpp:942
TreeMapWidget::fieldVisible
bool fieldVisible(int) const
Definition: treemap.cpp:1415
TreeMapWidget::currentChanged
void currentChanged(TreeMapItem *, bool keyboard)
This signal is emitted if the current item changes.
CallMapView::whatsThis
QString whatsThis() const
Definition: callmapview.cpp:98
listutils.h
CallMapView::tipString
QString tipString(TreeMapItem *) const
Return tooltip string to show for a item (can be rich text) Default implementation gives lines with "...
Definition: callmapview.cpp:547
GlobalConfig::showCycles
static bool showCycles()
Definition: globalconfig.cpp:338
DrawParams::TopRight
Definition: treemap.h:68
StoredDrawParams::text
QString text(int) const
Definition: treemap.cpp:79
DEFAULT_DRAWCOST
#define DEFAULT_DRAWCOST
Definition: callmapview.cpp:44
DEFAULT_MAXDEPTH
#define DEFAULT_MAXDEPTH
Definition: callmapview.cpp:51
TraceFunction::prettyName
QString prettyName() const
Similar to name, but prettyfied = more descriptive to humans.
Definition: tracedata.cpp:1889
CostItem::data
virtual TraceData * data()
Definition: costitem.cpp:111
CallMapCallingItem::backColor
QColor backColor() const
Definition: callmapview.cpp:836
TraceItemView::_activeItem
CostItem * _activeItem
Definition: traceitemview.h:211
CallMapCallingItem::children
TreeMapItemList * children()
Definition: callmapview.cpp:794
TreeMapWidget::setFieldType
void setFieldType(int, const QString &)
Set the type name of a field.
Definition: treemap.cpp:1373
globalguiconfig.h
TreeMapItem::width
int width() const
Definition: treemap.h:295
DEFAULT_SPLITMODE
#define DEFAULT_SPLITMODE
Definition: callmapview.cpp:42
GlobalConfig::shortenSymbol
static QString shortenSymbol(const QString &)
Definition: globalconfig.cpp:395
TraceCall::inCycle
int inCycle()
Definition: tracedata.cpp:1202
ConfigGroup
A group of configuration settings.
Definition: config.h:35
CallMapCallingItem::CallMapCallingItem
CallMapCallingItem(double factor, TraceCall *c)
Definition: callmapview.cpp:720
TreeMapWidget::borderWidth
int borderWidth() const
Definition: treemap.h:605
TraceItemView::eventTypeChanged
Definition: traceitemview.h:81
TraceItemView::selected
virtual void selected(TraceItemView *sender, CostItem *)
Notification from child views.
Definition: traceitemview.cpp:313
TraceItemView::activated
virtual void activated(TraceItemView *sender, CostItem *)
Definition: traceitemview.cpp:342
CallMapCallingItem::function
TraceFunction * function()
Definition: callmapview.h:115
CallMapCallerItem::text
QString text(int) const
Definition: callmapview.cpp:851
CallMapCallingItem::value
double value() const
Definition: callmapview.cpp:776
DEFAULT_DRAWLOCATION
#define DEFAULT_DRAWLOCATION
Definition: callmapview.cpp:45
TreeMapWidget::setSkipIncorrectBorder
void setSkipIncorrectBorder(bool enable=true)
If a children value() is almost the parents sum(), it can happen that the border to be drawn for visi...
Definition: treemap.cpp:1298
CallMapView::restoreOptions
void restoreOptions(const QString &prefix, const QString &postfix)
Definition: callmapview.cpp:945
callmapview.h
TreeMapWidget::isShadingEnabled
bool isShadingEnabled() const
Definition: treemap.h:506
CallMapBaseItem::function
TraceFunction * function()
Definition: callmapview.h:93
CallMapCallerItem::pixmap
QPixmap pixmap(int) const
Definition: callmapview.cpp:878
DEFAULT_STOPNAME
#define DEFAULT_STOPNAME
Definition: callmapview.cpp:50
GlobalConfig::showExpanded
static bool showExpanded()
Definition: globalconfig.cpp:333
CallMapBaseItem
Definition: callmapview.h:87
TreeMapItem::depth
int depth() const
Depth of this item.
Definition: treemap.cpp:963
CallMapCallingItem::init
void init()
Definition: callmapview.cpp:726
CallMapView::groupColor
QColor groupColor(TraceFunction *) const
Definition: callmapview.cpp:538
TraceItemView::activeItemChanged
Definition: traceitemview.h:85
TreeMapItem::_children
TreeMapItemList * _children
Definition: treemap.h:366
GlobalConfig::percentPrecision
static int percentPrecision()
Definition: globalconfig.cpp:385
ProfileContext::Type
Type
Definition: context.h:36
DEFAULT_DRAWNAME
#define DEFAULT_DRAWNAME
Definition: callmapview.cpp:43
SubCost
Cost event counter, simple wrapper around a 64bit entity.
Definition: subcost.h:32
DEFAULT_SHADING
#define DEFAULT_SHADING
Definition: callmapview.cpp:49
TraceFunction::calledCount
SubCost calledCount()
Definition: tracedata.cpp:2239
TreeMapWidget::setMarked
void setMarked(int markNo=1, bool redraw=true)
Switches on the marking .
Definition: treemap.cpp:1647
TreeMapWidget::doubleClicked
void doubleClicked(TreeMapItem *)
TreeMapWidget::splitModeString
QString splitModeString() const
Definition: treemap.cpp:1238
TraceCall::called
TraceFunction * called(bool skipCycle=false) const
Definition: tracedata.cpp:1235
TreeMapItem::path
QStringList path(int) const
Returns a list of text strings of specified text number, from root up to this item.
Definition: treemap.cpp:949
TreeMapItem::setSorting
void setSorting(int textNo, bool ascending=true)
Set the sorting for child drawing.
Definition: treemap.cpp:1046
SubCost::pretty
QString pretty(char sep= ' ') const
Convert SubCost value into a QString, spaced every 3 digits.
Definition: subcost.cpp:46
CallMapBaseItem::isMarked
bool isMarked(int) const
Definition: callmapview.cpp:666
TopLevelBase::showMessage
virtual void showMessage(const QString &, int msec)=0
CallMapView::saveOptions
void saveOptions(const QString &prefix, const QString &postfix)
Definition: callmapview.cpp:971
CallMapBaseItem::children
TreeMapItemList * children()
Definition: callmapview.cpp:671
CallMapCallerItem::function
TraceFunction * function()
Definition: callmapview.h:135
TraceItemView::eventType2Changed
Definition: traceitemview.h:82
TreeMapWidget::maxDrawingDepth
int maxDrawingDepth() const
Definition: treemap.h:545
CallMapBaseItem::CallMapBaseItem
CallMapBaseItem()
Definition: callmapview.cpp:586
TraceFunction::prettyLocation
QString prettyLocation(int maxFiles=0) const
Definition: tracedata.cpp:2047
TraceData
This class holds profiling data of multiple tracefiles generated with cachegrind on one command...
Definition: tracedata.h:1363
CallMapBaseItem::text
QString text(int) const
Definition: callmapview.cpp:600
DEFAULT_FORCESTRINGS
#define DEFAULT_FORCESTRINGS
Definition: callmapview.cpp:47
TraceCall
A call from one to another function.
Definition: tracedata.h:835
TreeMapItem
Base class of items in TreeMap.
Definition: treemap.h:221
TreeMapItem::addItem
void addItem(TreeMapItem *)
Adds an item to a parent.
Definition: treemap.cpp:982
TreeMapItem::widget
TreeMapWidget * widget() const
TreeMap widget this item is put in.
Definition: treemap.h:316
costPixmap
QPixmap costPixmap(EventType *ct, ProfileCostArray *cost, double total, bool framed)
Definition: listutils.cpp:217
DEFAULT_DRAWCALLS
#define DEFAULT_DRAWCALLS
Definition: callmapview.cpp:46
TraceCall::calledName
QString calledName(bool skipCycle=false) const
Definition: tracedata.cpp:1264
CallMapBaseItem::pixmap
QPixmap pixmap(int) const
Definition: callmapview.cpp:631
CallMapBaseItem::setFunction
void setFunction(TraceFunction *f)
Definition: callmapview.cpp:591
GlobalConfig::maxSymbolCount
static int maxSymbolCount()
Definition: globalconfig.cpp:407
CallMapCallerItem::CallMapCallerItem
CallMapCallerItem(double factor, TraceCall *c)
Definition: callmapview.cpp:845
TreeMapWidget::setMaxDrawingDepth
void setMaxDrawingDepth(int d)
Maximal nesting depth.
Definition: treemap.cpp:1314
TreeMapWidget::setFieldForced
void setFieldForced(int, bool)
Should the drawing of the name into the rectangle be forced? This enables drawing of the name before ...
Definition: treemap.cpp:1423
TraceInclusiveCost::inclusive
ProfileCostArray * inclusive()
Definition: tracedata.cpp:163
TreeMapWidget::contextMenuRequested
void contextMenuRequested(TreeMapItem *, const QPoint &)
TreeMapItemList
Definition: treemap.h:202
CallMapCallingItem::isMarked
bool isMarked(int) const
Definition: callmapview.cpp:788
ProfileContext::Function
Definition: context.h:46
ProfileContext::InvalidType
Definition: context.h:37
ConfigGroup::value
virtual QVariant value(const QString &key, const QVariant &defaultValue) const
Definition: config.cpp:60
CallMapCallerItem::backColor
QColor backColor() const
Definition: callmapview.cpp:939
CallMapCallerItem::value
double value() const
Definition: callmapview.cpp:891
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kcachegrind

Skip menu "kcachegrind"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal