File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -359,6 +359,18 @@ DEFINE_TEST(test_perf_hardware_multi) {
359359 }
360360}
361361
362+ // INSTRUMENT_PERF: identical counter combination at two call sites — must reuse
363+ // the same group FD without error.
364+ DEFINE_TEST (test_perf_identical_groups) {
365+ INSTRUMENT_FUNCTION ();
366+ INSTRUMENT_PERF (" task-clock" , " page-faults" );
367+ std::vector<size_t > v (1000 );
368+ std::iota (v.begin (), v.end (), 0 );
369+ size_t sum = std::accumulate (v.begin (), v.end (), size_t {0 });
370+ (void )sum;
371+ INSTRUMENT_PERF (" task-clock" , " page-faults" );
372+ }
373+
362374// INSTRUMENT_PERF: two groups sharing a counter name — must throw profilerError
363375// on the second group's first use, because the same counter in two groups would
364376// produce independent FDs with different reset points, making values incomparable.
You can’t perform that action at this time.
0 commit comments