SWDEV-355896 - Fix a data corruption error in post processing

The post-processing script cannot handle HIP ops without a correlation
ID. The correlation ID is needed to connect the record to a HIP stream
and originating thread.

This issue was exposed by a change to the tracer API to report
asynchronous activities even if their originating synchronous API
activity (callback) is not enabled. This was a flow in the API.

Also fix an issue with the API filtering. Undefined API names should
not cause an exception, they should be ignored.

Change-Id: Iab2221af6180ade2b9c2eb10c256c3a73d872e9f
This commit is contained in:
Laurent Morichetti
2022-09-09 10:04:16 -07:00
parent 900d5e0a64
commit 4856d33959
2 changed files with 30 additions and 11 deletions
+6
View File
@@ -283,6 +283,12 @@ class file_plugin_t {
switch (begin->domain) {
case ACTIVITY_DOMAIN_HIP_OPS: {
// The post-processing script cannot handle HIP ops without a correlation ID. The
// correlation ID is needed to connect the record to a HIP stream and originating thread.
// The script could be modified to handle ops without correlation IDs, but for backward
// compatibilty, we are simply dropping the records here.
if (begin->correlation_id == 0) break;
output_file = get_output_file(ACTIVITY_DOMAIN_HIP_OPS);
*output_file << std::dec << begin->begin_ns << ":" << begin->end_ns << " "
<< begin->device_id << ":" << begin->queue_id << " " << name << ":"