diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 42d457113..72fe38ee6 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -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: diff --git a/test/hal/hal.c b/test/hal/hal.c index 8a1e99079..2f1ee1b22 100644 --- a/test/hal/hal.c +++ b/test/hal/hal.c @@ -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;