Skip to content

Commit

Permalink
Switch PERF to PERF_COUNT_HW_REF_CPU_CYCLES
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias J. Kannwischer <[email protected]>
  • Loading branch information
mkannwischer committed Nov 20, 2024
1 parent 798844c commit 9fe8f05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,25 @@ jobs:
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
perf: PERF
- name: Intel Xeon 4th gen (c7i)
ec2_instance_type: c7i.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
perf: PERF
- name: AMD EPYC 3rd gen (c6a)
ec2_instance_type: c7a.medium
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
perf: PERF
- name: Intel Xeon 3rd gen (c6i)
ec2_instance_type: c7i.large
ec2_ami: ubuntu-latest (x86_64)
archflags: -mavx2 -mbmi2 -mpopcnt -maes
cflags: "-flto -DFORCE_X86_64"
perf: PMU
perf: PERF
uses: ./.github/workflows/bench_ec2_reusable.yml
if: github.repository_owner == 'pq-code-package' && (github.event.label.name == 'benchmark' || github.ref == 'refs/heads/main')
with:
Expand Down
5 changes: 5 additions & 0 deletions test/hal/hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ void enable_cyclecounter(void) {
memset(&pe, 0, sizeof(struct perf_event_attr));
pe.type = PERF_TYPE_HARDWARE;
pe.size = sizeof(struct perf_event_attr);

#if defined(__x86_64__)
pe.config = PERF_COUNT_HW_REF_CPU_CYCLES;
#else
pe.config = PERF_COUNT_HW_CPU_CYCLES;
#endif
pe.disabled = 1;
pe.exclude_kernel = 1;
pe.exclude_hv = 1;
Expand Down

0 comments on commit 9fe8f05

Please sign in to comment.