Skip to content

Commit 79c1498

Browse files
Sending Metric Tracer activity flag to Metrics Library.
Needed to make Metrics Library aware of Metric Tracer presence. Change-Id: I3e3108e6b303adfcf5ab56ccadc2a8acc58f7ff5
1 parent d5875b0 commit 79c1498

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

level_zero/tools/source/metrics/metric_query_imp.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ bool MetricsLibrary::createContext() {
202202
const auto &hwHelper = device.getHwHelper();
203203
const auto &asyncComputeEngines = hwHelper.getGpgpuEngineInstances(device.getHwInfo());
204204
ContextCreateData_1_0 createData = {};
205-
ClientOptionsData_1_0 clientOptions[1] = {};
205+
ClientOptionsData_1_0 clientOptions[2] = {};
206206
ClientData_1_0 clientData = {};
207207
ClientType_1_0 clientType = {};
208208
ClientDataLinuxAdapter_1_0 adapter = {};
@@ -227,6 +227,9 @@ bool MetricsLibrary::createContext() {
227227
clientOptions[0].Type = ClientOptionsType::Compute;
228228
clientOptions[0].Compute.Asynchronous = asyncComputeEngine != asyncComputeEngines.end();
229229

230+
clientOptions[1].Type = ClientOptionsType::Tbs;
231+
clientOptions[1].Tbs.Enabled = metricContext.getMetricTracer() != nullptr;
232+
230233
clientData.Linux.Adapter = &adapter;
231234
clientData.ClientOptions = clientOptions;
232235
clientData.ClientOptionsCount = sizeof(clientOptions) / sizeof(ClientOptionsData_1_0);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e2d02d00770720096d3c97aaeae5eefbe3642d88
1+
I0cb6316de4bac5f9243a0b305043045cb853f0ff

third_party/metrics_library/metrics_library_api_1_0.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ enum class ClientOptionsType : uint32_t
130130
Posh = 0,
131131
Ptbr,
132132
Compute,
133+
Tbs,
133134
// ...
134135
Last
135136
};
@@ -157,6 +158,7 @@ enum class StatusCode : uint32_t
157158
ReportNotReady,
158159
ReportLost,
159160
ReportInconsistent,
161+
CannotOpenFile,
160162
// ...
161163
Last
162164
};
@@ -638,6 +640,14 @@ struct ClientOptionsComputeData_1_0
638640
bool Asynchronous;
639641
};
640642

643+
//////////////////////////////////////////////////////////////////////////
644+
/// @brief Client options time based sampling data.
645+
//////////////////////////////////////////////////////////////////////////
646+
struct ClientOptionsTbsData_1_0
647+
{
648+
bool Enabled;
649+
};
650+
641651
//////////////////////////////////////////////////////////////////////////
642652
/// @brief Client options data.
643653
//////////////////////////////////////////////////////////////////////////
@@ -650,6 +660,7 @@ struct ClientOptionsData_1_0
650660
ClientOptionsPoshData_1_0 Posh;
651661
ClientOptionsPtbrData_1_0 Ptbr;
652662
ClientOptionsComputeData_1_0 Compute;
663+
ClientOptionsTbsData_1_0 Tbs;
653664
};
654665
};
655666

@@ -694,6 +705,6 @@ using ContextDeleteFunction_1_0 = StatusCode ( ML_STDCALL* ) ( const ContextHand
694705
//////////////////////////////////////////////////////////////////////////
695706
#define METRICS_LIBRARY_MAJOR_NUMBER 1
696707
#define METRICS_LIBRARY_MINOR_NUMBER 0
697-
#define METRICS_LIBRARY_BUILD_NUMBER 3
708+
#define METRICS_LIBRARY_BUILD_NUMBER 6
698709

699710
} // namespace MetricsLibraryApi

0 commit comments

Comments
 (0)