Skip to content

Commit

Permalink
show tracepoints in the timelinewidget
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lievenhey committed Sep 29, 2023
1 parent fb22403 commit b8dc4a1
Show file tree
Hide file tree
Showing 8 changed files with 273 additions and 134 deletions.
34 changes: 16 additions & 18 deletions src/models/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -826,36 +826,37 @@ struct ThreadNames
QHash<qint32, QHash<qint32, QString>> names;
};

struct TracepointEvents
{
QString name;
Events events;
bool operator==(const TracepointEvents& rhs) const
{
return std::tie(name, events) == std::tie(rhs.name, rhs.events);
}
};

struct EventResults
{
QVector<ThreadEvents> threads;
QVector<CpuEvents> cpus;
QVector<TracepointEvents> tracepoints;
QVector<QVector<qint32>> stacks;
QVector<CostSummary> totalCosts;
qint32 offCpuTimeCostId = -1;
qint32 lostEventCostId = -1;
qint32 tracepointEventCostId = -1;

ThreadEvents* findThread(qint32 pid, qint32 tid);
const ThreadEvents* findThread(qint32 pid, qint32 tid) const;

bool operator==(const EventResults& rhs) const
{
return std::tie(threads, cpus, stacks, totalCosts, offCpuTimeCostId)
== std::tie(rhs.threads, rhs.cpus, rhs.stacks, rhs.totalCosts, rhs.offCpuTimeCostId);
return std::tie(threads, cpus, tracepoints, stacks, totalCosts, offCpuTimeCostId)
== std::tie(rhs.threads, rhs.cpus, rhs.tracepoints, rhs.stacks, rhs.totalCosts, rhs.offCpuTimeCostId);
}
};

struct Tracepoint
{
quint64 time = 0;
QString name;
};

struct TracepointResults
{
QVector<Tracepoint> tracepoints;
};

struct FilterAction
{
TimeRange time;
Expand Down Expand Up @@ -962,11 +963,8 @@ Q_DECLARE_TYPEINFO(Data::ThreadNames, Q_MOVABLE_TYPE);
Q_DECLARE_METATYPE(Data::EventResults)
Q_DECLARE_TYPEINFO(Data::EventResults, Q_MOVABLE_TYPE);

Q_DECLARE_METATYPE(Data::Tracepoint)
Q_DECLARE_TYPEINFO(Data::Tracepoint, Q_MOVABLE_TYPE);

Q_DECLARE_METATYPE(Data::TracepointResults)
Q_DECLARE_TYPEINFO(Data::TracepointResults, Q_MOVABLE_TYPE);
Q_DECLARE_METATYPE(Data::TracepointEvents)
Q_DECLARE_TYPEINFO(Data::TracepointEvents, Q_MOVABLE_TYPE);

Q_DECLARE_METATYPE(Data::TimeRange)
Q_DECLARE_TYPEINFO(Data::TimeRange, Q_MOVABLE_TYPE);
Expand Down
Loading

0 comments on commit b8dc4a1

Please sign in to comment.