Skip to content

Commit 6f0ede3

Browse files
authored
exposing branch misses under macos (#587)
* exposing branch misses under macos * formatting
1 parent 2e3db5f commit 6f0ede3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

benchmarks/performancecounters/apple_arm_events.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ struct AppleEvents {
11021102
printf("%14s: %llu\n", alias->alias, val);
11031103
}*/
11041104
return performance_counters{
1105-
counters_0[counter_map[0]], counters_0[counter_map[3]],
1105+
counters_0[counter_map[0]], counters_0[counter_map[2]],
11061106
counters_0[counter_map[2]], counters_0[counter_map[1]]};
11071107
}
11081108
};

benchmarks/performancecounters/event_counter.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct event_count {
3535
enum event_counter_types {
3636
CPU_CYCLES,
3737
INSTRUCTIONS,
38+
BRANCH_MISSES = 2,
39+
BRANCH = 4
3840
};
3941

4042
double elapsed_sec() const {
@@ -49,7 +51,10 @@ struct event_count {
4951
double instructions() const {
5052
return static_cast<double>(event_counts[INSTRUCTIONS]);
5153
}
52-
54+
double branches() const { return static_cast<double>(event_counts[BRANCH]); }
55+
double branch_misses() const {
56+
return static_cast<double>(event_counts[BRANCH_MISSES]);
57+
}
5358
event_count& operator=(const event_count& other) {
5459
this->elapsed = other.elapsed;
5560
this->event_counts = other.event_counts;

0 commit comments

Comments
 (0)