Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracepoint hover #684

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Tracepoint hover #684

wants to merge 11 commits into from

Conversation

lievenhey
Copy link
Contributor

@lievenhey lievenhey commented Nov 18, 2024

This PR expands the tracepoint PR to show additional information when hovering over a tracepoint.
This requires the perfparser PR to be merged.
image

This is still wip. The following things are planned:

  • Cache for tracepoint formats
  • Custom Tracepoint formatters (some format strings execute code which we don't support)

@lievenhey lievenhey force-pushed the tracepoint-hover branch 3 times, most recently from a4eef75 to f434e6d Compare December 2, 2024 12:19
Copy link
Member

@milianw milianw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really great work @lievenhey and sorry for the overly long delay in reviewing. there are only a few minor things left from the code POV, I'll now look at the CI failure and also test-run it locally a bit

@@ -1145,6 +1151,10 @@ class PerfParserPrivate : public QObject
{
Q_ASSERT(string.id == strings.size());
strings.push_back(QString::fromUtf8(string.string));

if (string.string == QByteArray("sched:sched_switch")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QByteArrayLiteral or just compare to a string literal? your code forced an unneeded allocation

});

const auto format = results.tracePointFormats[tracepoint.tracepointFormat];
qDebug() << format.systemId << format.nameId << format.format;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove debug output

});

for (auto it = tracepointFormat.cbegin(), end = tracepointFormat.cend(); it != end; it++) {
qDebug() << "FORMAT" << strings.value(it->format.id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dito

std::transform(tracepointData.cbegin(), tracepointData.cend(), std::back_inserter(eventResult.tracePointData),
[this](const TracePointData& data) -> Data::TracePointData {
QHash<QString, QVariant> tracepointData;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tracepointData.reserve(data.data.size())


#include "data.h"

class TracePointFormatter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only used by formatTracepoint, so this can move to the .cpp file (into an anon namespace there?)

@@ -0,0 +1,83 @@
#include "tracepointformat.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing license header

lievenhey and others added 11 commits January 25, 2025 20:14
The tracepoints are getting a better visual representation on the
timelinewidget so this is no longer necessary.
Move the tracepoints from TimeAxisHeaderView to TimeLineWidget so that
we can use the header for cpu usage.
This also improves usability since the tracepoints are no longer bundles
in one line. They now each have their own line.
Enum automatically counts up so there is no need to manually set these
values.
this allows the user to group important timelines together so that he
can compare them better
The favourites and tracepoint patches include some rows in the model
that may be empty. To keep the code simple an readable all rows will be
shown. Then a proxy model is put ontop to remove empty rows.
This way we can more easily find them and changing the sort order
doesn't move them to the bottom.
Showing only one cost is fine if we only show a hardware event, but
since we now support tracepoints and some come in an enter/exit pair it
requires us to rework the timeline delegate.
This patch makes the event source combobox multi select and allows to
select multiple event sources.
This patch allows hotspot to correctly parse most format string from the
tracepoint definition. If that fails every entry in the tracepoint will
be printed unformatted. In this case it is possible to add a custom
formatter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants