intel/perf: simplify pass computation loop
We don't need to go through all the metric sets as we're already built a bitset matching per counter to figure out in which metric set a particular counter is. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
This commit is contained in:
committed by
Marge Bot
parent
4d19685a99
commit
7fbfa694a8
+13
-18
@@ -898,28 +898,23 @@ get_passes_mask(struct intel_perf_config *perf,
|
||||
/* Now go through each metric set and find one that contains this
|
||||
* counter.
|
||||
*/
|
||||
for (uint32_t q = 0; q < perf->n_queries; q++) {
|
||||
bool found = false;
|
||||
bool found = false;
|
||||
for (uint32_t w = 0; w < BITSET_WORDS(INTEL_PERF_MAX_METRIC_SETS); w++) {
|
||||
if (!counter_info->query_mask[w])
|
||||
continue;
|
||||
|
||||
for (uint32_t w = 0; w < BITSET_WORDS(INTEL_PERF_MAX_METRIC_SETS); w++) {
|
||||
if (!counter_info->query_mask[w])
|
||||
continue;
|
||||
uint32_t query_idx = w * BITSET_WORDBITS + ffsll(counter_info->query_mask[w]) - 1;
|
||||
|
||||
uint32_t query_idx = w * BITSET_WORDBITS + ffsll(counter_info->query_mask[w]) - 1;
|
||||
/* Since we already looked for this in the query_mask, it should not
|
||||
* be set.
|
||||
*/
|
||||
assert(!BITSET_TEST(queries_mask, query_idx));
|
||||
|
||||
/* Since we already looked for this in the query_mask, it should
|
||||
* not be set.
|
||||
*/
|
||||
assert(!BITSET_TEST(queries_mask, query_idx));
|
||||
|
||||
BITSET_SET(queries_mask, query_idx);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (found)
|
||||
break;
|
||||
BITSET_SET(queries_mask, query_idx);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
assert(found);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user