@@ -161,7 +161,6 @@ void TimeLineDelegate::paint(QPainter* painter, const QStyleOptionViewItem& opti
161161 const auto results = index.data (EventModel::EventResultsRole).value <Data::EventResults>();
162162 const auto offCpuCostId = results.offCpuTimeCostId ;
163163 const auto lostEventCostId = results.lostEventCostId ;
164- const auto tracepointEventCostId = results.tracepointEventCostId ;
165164 const bool is_alternate = option.features & QStyleOptionViewItem::Alternate;
166165 const auto & palette = option.palette ;
167166
@@ -231,10 +230,6 @@ void TimeLineDelegate::paint(QPainter* painter, const QStyleOptionViewItem& opti
231230 // see also: https://www.spinics.net/lists/linux-perf-users/msg03486.html
232231 for (const auto & event : data.events ) {
233232 const auto isLostEvent = event.type == lostEventCostId;
234- const auto isTracepointEvent = event.type == tracepointEventCostId;
235- if (event.type != m_eventType && !isLostEvent && !isTracepointEvent) {
236- continue ;
237- }
238233
239234 const auto x = data.mapTimeToX (event.time );
240235 if (x < TimeLineData::padding || x >= data.w ) {
@@ -334,14 +329,22 @@ bool TimeLineDelegate::helpEvent(QHelpEvent* event, QAbstractItemView* view, con
334329 Util::formatTimeString (found.totalCost ),
335330 Util::formatTimeString (found.maxCost )));
336331 } 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+ }
342346 } 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));
345348 }
346349 return true ;
347350 }
@@ -390,6 +393,12 @@ bool TimeLineDelegate::eventFilter(QObject* watched, QEvent* event)
390393
391394 const auto time = data.mapXToTime (pos.x () - visualRect.left () - TimeLineData::padding);
392395 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+
393402 auto findSamples = [&](int costType, bool contains) {
394403 bool foundAny = false ;
395404 data.findSamples (hoverX, costType, results.lostEventCostId , contains, start,
0 commit comments