Skip to content

Commit

Permalink
Move kpep reading out of profiler's initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhinkin committed Mar 23, 2024
1 parent 4b49fa5 commit c79e77b
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@
*/
public class XCTraceNormProfiler implements ExternalProfiler {
private static final XCTraceTableDesc.TableType SUPPORTED_TABLE_TYPE = XCTraceTableDesc.TableType.COUNTERS_PROFILE;
private static final List<String> INSTRUCTIONS_COUNTERS
= KpepUtils.supportedEvents().aliases(KpepUtils.PerfEvents.INSTRUCTIONS);
private static final List<String> CYCLES_COUNTERS
= KpepUtils.supportedEvents().aliases(KpepUtils.PerfEvents.CYCLES);

private final String tracingTemplate;
private final Path temporaryFolder;
Expand Down Expand Up @@ -339,17 +335,18 @@ private Collection<? extends Result> processResults(BenchmarkResult br) {

Collection<Result<?>> results = new ArrayList<>();
{
KpepUtils.PerfEvents supportedEvents = KpepUtils.supportedEvents();
Double insts = null;
String instsName = null;
for (String name : INSTRUCTIONS_COUNTERS) {
for (String name : supportedEvents.aliases(KpepUtils.PerfEvents.INSTRUCTIONS)) {
if ((insts = aggregator.getCountOrNull(name)) != null) {
instsName = name;
break;
}
}
Double cycles = null;
String cyclesName = null;
for (String name : CYCLES_COUNTERS) {
for (String name : supportedEvents.aliases(KpepUtils.PerfEvents.CYCLES)) {
if ((cycles = aggregator.getCountOrNull(name)) != null) {
cyclesName = name;
break;
Expand Down

0 comments on commit c79e77b

Please sign in to comment.