Skip to content

Commit fae17db

Browse files
committed
attempt to use perf in ci again
1 parent fae13b6 commit fae17db

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
runs-on: ubuntu-latest
5757
container:
5858
image: acheronfail/count
59+
options: --privileged
5960
steps:
6061
- name: Checkout
6162
uses: actions/checkout@v3

justfile

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,10 @@ measure what: (_check "bc hyperfine max_rss jq sponge")
100100
max_rss -ro STATS -- $(cat CMD)
101101
jq '. += {"max_rss": '$(cat STATS)'}' "$out" | sponge "$out"
102102

103-
if [ -z ${CI:-} ]; then
104-
perf_out=$(perf stat -x, -e cycles,instructions $(cat CMD) 2>&1 >/dev/null)
105-
echo "$perf_out" | awk -F, '$3~/^cycles/{print $1}' > CYCLES
106-
echo "$perf_out" | awk -F, '$3~/^instructions/{print $1}' > INSTRUCTIONS
107-
jq '. += {"cycles": '$(cat CYCLES)',"instructions": '$(cat INSTRUCTIONS)'}' "$out" | sponge "$out"
108-
else
109-
jq '. += {"cycles": null,"instructions": null}' "$out" | sponge "$out"
110-
fi
103+
perf_out=$(perf stat -x, -e cycles,instructions $(cat CMD) 2>&1 >/dev/null)
104+
echo "$perf_out" | awk -F, '$3~/^cycles/{print $1}' > CYCLES
105+
echo "$perf_out" | awk -F, '$3~/^instructions/{print $1}' > INSTRUCTIONS
106+
jq '. += {"cycles": '$(cat CYCLES)',"instructions": '$(cat INSTRUCTIONS)'}' "$out" | sponge "$out"
111107

112108
measure-all:
113109
#!/usr/bin/env bash

0 commit comments

Comments
 (0)