File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
tools/unitrace/src/levelzero Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -854,7 +854,7 @@ class ZeMetricProfiler {
854854
855855 uint64_t cur_sampling_ts = 0 ;
856856 auto kit = kinfo.begin ();
857- while (!inf.eof ()) {
857+ while (!inf.eof () && kit != kinfo. end () ) {
858858 // Read metric data in two stages, first actual size (in bytes), followed by actual metrics
859859 uint64_t data_size;
860860 inf.read (reinterpret_cast <char *>(&data_size), sizeof (data_size));
@@ -1177,6 +1177,8 @@ class ZeMetricProfiler {
11771177 std::cerr << " [ERROR] Failed to write to sampling metrics file " << desc->metric_file_name_ << std::endl;
11781178 break ;
11791179 }
1180+ if (size < MAX_METRIC_BUFFER)
1181+ break ;
11801182 size = ReadMetrics (streamer, raw_metrics, MAX_METRIC_BUFFER);
11811183 }
11821184 free (raw_metrics);
You can’t perform that action at this time.
0 commit comments