Skip to content

Commit ff97c99

Browse files
committed
Profile steady-state block workloads
1 parent 495253a commit ff97c99

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

.github/workflows/phase2-runtime-ab.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ on:
3838
default: "180"
3939
type: string
4040
spark_profile_mode:
41-
description: "Optional 4-run Spark diagnostic for block-direct-write"
41+
description: "Optional 4-run Spark diagnostic (cpu=slow ticks, cpu-all=steady-state)"
4242
required: true
4343
default: "none"
4444
type: choice
45-
options: ["none", "cpu", "alloc"]
45+
options: ["none", "cpu", "cpu-all", "alloc"]
4646

4747
permissions:
4848
contents: read
@@ -139,9 +139,15 @@ jobs:
139139
[[ "$WARMUP_SECONDS" =~ ^[0-9]+$ ]] && (( WARMUP_SECONDS >= 10 ))
140140
[[ "$SETTLE_SECONDS" =~ ^[0-9]+$ ]] && (( SETTLE_SECONDS >= 5 ))
141141
[[ "$MEASURE_SECONDS" =~ ^[0-9]+$ ]] && (( MEASURE_SECONDS >= 10 ))
142-
[[ "$SPARK_PROFILE_MODE" =~ ^(none|cpu|alloc)$ ]]
143-
if [[ "$SPARK_PROFILE_MODE" != none && "$SCENARIO" != block-direct-write ]]; then
144-
echo "Spark profiling is currently isolated to block-direct-write" >&2
142+
[[ "$SPARK_PROFILE_MODE" =~ ^(none|cpu|cpu-all|alloc)$ ]]
143+
if [[ "$SPARK_PROFILE_MODE" == cpu-all && \
144+
"$SCENARIO" != block-active && "$SCENARIO" != block-direct-write ]]; then
145+
echo "Spark cpu-all profiling is isolated to block-active or block-direct-write" >&2
146+
exit 64
147+
fi
148+
if [[ "$SPARK_PROFILE_MODE" != none && "$SPARK_PROFILE_MODE" != cpu-all && \
149+
"$SCENARIO" != block-direct-write ]]; then
150+
echo "Spark cpu/alloc profiling is isolated to block-direct-write" >&2
145151
exit 64
146152
fi
147153
if [[ "$SPARK_PROFILE_MODE" != none && "$RUNS" != 4 ]]; then

tools/perf/run-phase2-runtime-once.sh

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,17 @@ fi
8686
[[ "$protocol_trace_enabled" == 0 || "$protocol_trace_enabled" == 1 ]] \
8787
|| { echo "PHASE2_PROTOCOL_TRACE_ENABLED must be 0 or 1" >&2; exit 64; }
8888
case "$spark_profile_mode" in
89-
none|cpu|alloc) ;;
90-
*) echo "PHASE2_SPARK_PROFILE_MODE must be none, cpu, or alloc" >&2; exit 64 ;;
89+
none|cpu|cpu-all|alloc) ;;
90+
*) echo "PHASE2_SPARK_PROFILE_MODE must be none, cpu, cpu-all, or alloc" >&2; exit 64 ;;
9191
esac
92-
if [[ "$spark_profile_mode" != none && "$scenario" != block-direct-write ]]; then
93-
echo "Spark profiling is currently isolated to block-direct-write" >&2
92+
if [[ "$spark_profile_mode" == cpu-all && \
93+
"$scenario" != block-active && "$scenario" != block-direct-write ]]; then
94+
echo "Spark cpu-all profiling is isolated to block-active or block-direct-write" >&2
95+
exit 64
96+
fi
97+
if [[ "$spark_profile_mode" != none && "$spark_profile_mode" != cpu-all && \
98+
"$scenario" != block-direct-write ]]; then
99+
echo "Spark cpu/alloc profiling is isolated to block-direct-write" >&2
94100
exit 64
95101
fi
96102
[[ -f "$plugin_jar" && -f "$paper_jar" ]] \
@@ -638,6 +644,12 @@ if [[ "$spark_profile_mode" != none ]]; then
638644
spark_profile_interval_unit="milliseconds"
639645
spark_profile_only_ticks_over_ms="40"
640646
;;
647+
cpu-all)
648+
spark_profile_start_command="spark profiler start --interval 1"
649+
spark_profile_interval="1"
650+
spark_profile_interval_unit="milliseconds"
651+
spark_profile_only_ticks_over_ms=""
652+
;;
641653
alloc)
642654
spark_profile_start_command="spark profiler start --alloc --interval 32768"
643655
spark_profile_interval="32768"

0 commit comments

Comments
 (0)