deepanjalimishra99's picture
Add SQLite steady-state query SimPoint traces
cf6b956 verified
Raw
History Blame Contribute Delete
1.32 kB
#!/bin/bash
# Build the SQLite trace workload from the official amalgamation.
#
# SQLite 3.53.4, source id
# 2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc
# https://www.sqlite.org/2026/sqlite-amalgamation-3530400.zip
#
# -no-pie is used so runtime PCs in the trace equal link-time addresses, which
# makes mapping trace PCs back to functions/source straightforward (modules.log
# still records the mapping for every module).
set -euo pipefail
AMALG=${1:-/work/src/sqlite-amalgamation-3530400}
OUT=${2:-/work/bin}
CFLAGS="-O2 -g -fno-omit-frame-pointer -no-pie -fno-pie \
-DSQLITE_THREADSAFE=0 \
-DSQLITE_OMIT_LOAD_EXTENSION \
-DSQLITE_DEFAULT_MEMSTATUS=0 \
-DSQLITE_MAX_MMAP_SIZE=4294967296"
mkdir -p "$OUT"
gcc $CFLAGS -c "$AMALG/sqlite3.c" -o "$OUT/sqlite3.o"
gcc $CFLAGS -I"$AMALG" /work/src/sqlite_setup.c "$OUT/sqlite3.o" \
-o "$OUT/sqlite_setup" -lm -lpthread -ldl
gcc $CFLAGS -I"$AMALG" /work/src/sqlite_query.c "$OUT/sqlite3.o" \
-o "$OUT/sqlite_query" -lm -lpthread -ldl
# Phase 1+2 (excluded from all traces): build the database and load the dataset.
# $OUT/sqlite_setup /work/db/records.db 3000000
# Phase 3 (the only phase that is traced): steady-state query execution.
# $OUT/sqlite_query /work/db/records.db 3 60000 50000 4900 5000 3000000