@@ -161,7 +161,6 @@ void TimeLineDelegate::paint(QPainter* painter, const QStyleOptionViewItem& opti
161
161
const auto results = index.data (EventModel::EventResultsRole).value <Data::EventResults>();
162
162
const auto offCpuCostId = results.offCpuTimeCostId ;
163
163
const auto lostEventCostId = results.lostEventCostId ;
164
- const auto tracepointEventCostId = results.tracepointEventCostId ;
165
164
const bool is_alternate = option.features & QStyleOptionViewItem::Alternate;
166
165
const auto & palette = option.palette ;
167
166
@@ -231,10 +230,6 @@ void TimeLineDelegate::paint(QPainter* painter, const QStyleOptionViewItem& opti
231
230
// see also: https://www.spinics.net/lists/linux-perf-users/msg03486.html
232
231
for (const auto & event : data.events ) {
233
232
const auto isLostEvent = event.type == lostEventCostId;
234
- const auto isTracepointEvent = event.type == tracepointEventCostId;
235
- if (event.type != m_eventType && !isLostEvent && !isTracepointEvent) {
236
- continue ;
237
- }
238
233
239
234
const auto x = data.mapTimeToX (event.time );
240
235
if (x < TimeLineData::padding || x >= data.w ) {
@@ -334,14 +329,22 @@ bool TimeLineDelegate::helpEvent(QHelpEvent* event, QAbstractItemView* view, con
334
329
Util::formatTimeString (found.totalCost ),
335
330
Util::formatTimeString (found.maxCost )));
336
331
} else if (found.numSamples > 0 ) {
337
- QToolTip::showText (event->globalPos (),
338
- tr (" time: %1\n %5 samples: %2\n total sample cost: %3\n max sample cost: %4" )
339
- .arg (formattedTime, QString::number (found.numSamples ),
340
- Util::formatCost (found.totalCost ), Util::formatCost (found.maxCost ),
341
- totalCosts.value (found.type ).label ));
332
+ if (m_eventType == results.tracepointEventCostId ) {
333
+ // currently tracepoint cost is saying nothig, so don't show it
334
+ QToolTip::showText (
335
+ event->globalPos (),
336
+ tr (" time: %1\n %3 samples: %2" )
337
+ .arg (formattedTime, QString::number (found.numSamples ), results.tracepoints [index.row ()].name ));
338
+
339
+ } else {
340
+ QToolTip::showText (event->globalPos (),
341
+ tr (" time: %1\n %5 samples: %2\n total sample cost: %3\n max sample cost: %4" )
342
+ .arg (formattedTime, QString::number (found.numSamples ),
343
+ Util::formatCost (found.totalCost ), Util::formatCost (found.maxCost ),
344
+ totalCosts.value (found.type ).label ));
345
+ }
342
346
} else {
343
- QToolTip::showText (event->globalPos (),
344
- tr (" time: %1 (no %2 samples)" ).arg (formattedTime, totalCosts.value (m_eventType).label ));
347
+ QToolTip::showText (event->globalPos (), tr (" time: %1 (no samples)" ).arg (formattedTime));
345
348
}
346
349
return true ;
347
350
}
@@ -390,6 +393,12 @@ bool TimeLineDelegate::eventFilter(QObject* watched, QEvent* event)
390
393
391
394
const auto time = data.mapXToTime (pos.x () - visualRect.left () - TimeLineData::padding);
392
395
const auto start = findEvent (data.events .constBegin (), data.events .constEnd (), time);
396
+
397
+ // we can show multiple events in one row so we need to dynamically figure out which costId is needed
398
+ auto hoveringEntry = std::find_if (start, data.events .cend (),
399
+ [time](const Data::Event& event) { return event.time >= time; });
400
+ setEventType (hoveringEntry != data.events .cend () ? hoveringEntry->type : 0 );
401
+
393
402
auto findSamples = [&](int costType, bool contains) {
394
403
bool foundAny = false ;
395
404
data.findSamples (hoverX, costType, results.lostEventCostId , contains, start,
0 commit comments