#!/usr/bin/env bash set -euo pipefail script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" root="$(cd "${script_dir}/.." && pwd)" mode="${1:-fastpt-C}" device="${2:-${DEVICE:-0}}" out_root="${OUT_ROOT:-${root}/results-probe}" log="${FASTPT_MRE_PROBE_LOG:-${out_root}/${mode}/runtime_probe.csv}" probe_lib="${root}/build-probe/libruntime_probe.so" mkdir -p "${root}/build-probe" c++ -std=c++17 -O2 -fPIC -shared \ "${root}/src/runtime_probe.cpp" \ -ldl \ -o "${probe_lib}" mkdir -p "$(dirname "${log}")" echo "pid,api,calls,total_ns,avg_ns" > "${log}" FASTPT_MRE_PROBE_LOG="${log}" \ OUT_ROOT="${out_root}" \ LD_PRELOAD="${probe_lib}${LD_PRELOAD:+:${LD_PRELOAD}}" \ bash "${script_dir}/run_one.sh" "${mode}" "${device}" echo "PROBE_LOG,${log}"