@@ -41,12 +41,19 @@ enum class TraceStatus {
4141};
4242
4343/* DeviceInfo:
44- * Can be used to specify process name, PID and device label
44+ * Can be used to specify process name, sort order, PID and device label.
45+ * The sort order is determined by the sortIndex field to handle ordering of
46+ * processes and gpu rows in the trace viewer.
4547 */
4648struct DeviceInfo {
47- DeviceInfo (int64_t id, const std::string& name, const std::string& label)
48- : id(id), name(name), label(label) {}
49+ DeviceInfo (
50+ int64_t id,
51+ int64_t sortIndex,
52+ const std::string& name,
53+ const std::string& label)
54+ : id(id), sortIndex(sortIndex), name(name), label(label) {}
4955 int64_t id; // process id
56+ int64_t sortIndex; // position in trace view
5057 const std::string name; // process name
5158 const std::string label; // device label
5259};
@@ -66,6 +73,10 @@ struct ResourceInfo {
6673 int64_t deviceId; // id of device which owns this resource (specified in DeviceInfo.id)
6774 const std::string name; // resource name
6875};
76+
77+ using getLinkedActivityCallback =
78+ std::function<const ITraceActivity*(int32_t )>;
79+
6980/* IActivityProfilerSession:
7081 * an opaque object that can be used by a high level profiler to
7182 * start/stop and return trace events.
@@ -91,6 +102,12 @@ class IActivityProfilerSession {
91102 // processes trace activities using logger
92103 virtual void processTrace (ActivityLogger& logger) = 0;
93104
105+ virtual void processTrace (ActivityLogger& logger,
106+ getLinkedActivityCallback /* getLinkedActivity*/ ,
107+ int64_t /* startTime*/ , int64_t /* endTime*/ ) {
108+ processTrace (logger);
109+ }
110+
94111 // returns device info used in this trace, could be nullptr
95112 virtual std::unique_ptr<DeviceInfo> getDeviceInfo () = 0;
96113
@@ -103,6 +120,12 @@ class IActivityProfilerSession {
103120 // XXX define trace formats
104121 // virtual save(string name, TraceFormat format)
105122
123+ virtual void pushCorrelationId (uint64_t /* id*/ ) {}
124+ virtual void popCorrelationId () {}
125+
126+ virtual void pushUserCorrelationId (uint64_t /* id*/ ) {}
127+ virtual void popUserCorrelationId () {}
128+
106129 protected:
107130 TraceStatus status_ = TraceStatus::READY;
108131};
0 commit comments