#!/bin/bash
# Roles:
# - perf_profile.sh: full perf/c2c profiling for the bench binary.
# - perf_bench_bin.sh: perf profiling of bench binary (no lake exec overhead).
# - perf_bench_lake.sh: perf profiling via lake exe (includes lake overhead).
# Configuration
ITERATIONS=
OUTPUT_DIR=".lake/build/bin"
BENCH_EXE="/bench"
BENCH_ARGS=""
# Results directory configuration
RESULTS_ROOT=""
RUN_LABEL=""
DATE_DIR="/"
REPORT_DIR="/report"
FLAME_DIR="/flamegraph"
PERF_DATA="/perf-.data"
PERF_REPORT="/perf-.log"
PERF_FOLDED="/perf-.folded"
FLAMEGRAPH_SVG="/flamegraph-.svg"
FLAMEGRAPH_DIR=""
STACKCOLLAPSE_BIN=""
FLAMEGRAPH_BIN=""
# Mode: perf | c2c | both
PERF_MODE=""
C2C_DIR="/c2c"
C2C_DATA="/c2c-.data"
C2C_REPORT="/c2c-.log"
# 1. Build the benchmark executable
if [; then
fi
if [; then
fi
# 2. Check for perf
if ! ; then
fi
# 3. Prepare output directories
# 3. Run perf record (mode: perf/both)
if [ || [; then
if [; then
if { [ && [; } || \
{ && ; }; then
if [ && [; then
|
else
|
fi
else
fi
else
fi
fi
# 4. Run perf c2c record/report (mode: c2c/both)
if [ || [; then
if ; then
if [; then
else
fi
else
fi
fi