Skip to content
Snippets Groups Projects
Commit 30ca6df2 authored by Peter Cai's avatar Peter Cai
Browse files

Support overriding CPU core location

parent 52e189d2
No related branches found
No related tags found
No related merge requests found
perf_stat_start() { perf_stat_start() {
local opt_args="" local opt_args=""
if [ "$PERF_STAT_NO_CORES" != "true" ]; then if [ "$PERF_STAT_NO_CORES" != "true" ]; then
opt_args="$opt_args -C 0-$((THREADS - 1))" if [ ! -z "$OVERRIDE_CPUS" ]; then
opt_args="$opt_args -C $OVERRIDE_CPUS"
else
opt_args="$opt_args -C 0-$((THREADS - 1))"
fi
fi fi
$PERF stat $PERF_EXTRA_ARGS $opt_args -e LLC-load-misses:u,LLC-load-misses:k,LLC-loads:u,LLC-loads:k,LLC-store-misses:u,LLC-store-misses:k,LLC-stores:u,LLC-stores:k,task-clock,cycles:u,cycles:k,instructions:u,instructions:k -o "$DATA_OUT/stat_$1$EXP_AUX_SUFFIX.txt" & $PERF stat $PERF_EXTRA_ARGS $opt_args -e LLC-load-misses:u,LLC-load-misses:k,LLC-loads:u,LLC-loads:k,LLC-store-misses:u,LLC-store-misses:k,LLC-stores:u,LLC-stores:k,task-clock,cycles:u,cycles:k,instructions:u,instructions:k -o "$DATA_OUT/stat_$1$EXP_AUX_SUFFIX.txt" &
PERF_STAT_PID=$! PERF_STAT_PID=$!
...@@ -14,7 +18,11 @@ perf_stat_stop() { ...@@ -14,7 +18,11 @@ perf_stat_stop() {
perf_record_start() { perf_record_start() {
local opt_args="" local opt_args=""
if [ "$PERF_STAT_NO_CORES" != "true" ]; then if [ "$PERF_STAT_NO_CORES" != "true" ]; then
opt_args="$opt_args -C 0-$((THREADS - 1))" if [ ! -z "$OVERRIDE_CPUS" ]; then
opt_args="$opt_args -C $OVERRIDE_CPUS"
else
opt_args="$opt_args -C 0-$((THREADS - 1))"
fi
fi fi
pushd "$DATA_OUT" pushd "$DATA_OUT"
......
...@@ -28,8 +28,12 @@ cleanup_memcached() { ...@@ -28,8 +28,12 @@ cleanup_memcached() {
start_memcached() { start_memcached() {
echo "Starting memcached" echo "Starting memcached"
echo "taskset -c 0-$((THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler" local cpus="0-$((THREADS - 1 - THREAD_TAIL_OFFSET))"
taskset -c 0-$((THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler & if [ ! -z "$OVERRIDE_CPUS" ]; then
cpus="$OVERRIDE_CPUS"
fi
echo "taskset -c $OVERRIDE_CPUS $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler"
taskset -c $OVERRIDE_CPUS $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler &
MEMCACHED_PID=$! MEMCACHED_PID=$!
if [ "$PERF_STAT_ONLY_MEMCACHED" == "true" ]; then if [ "$PERF_STAT_ONLY_MEMCACHED" == "true" ]; then
PERF_EXTRA_ARGS_ORIG="$PERF_EXTRA_ARGS" PERF_EXTRA_ARGS_ORIG="$PERF_EXTRA_ARGS"
......
...@@ -38,6 +38,11 @@ while [[ $# -gt 0 ]]; do ...@@ -38,6 +38,11 @@ while [[ $# -gt 0 ]]; do
shift shift
shift shift
;; ;;
--override-cpus)
OVERRIDE_CPUS="$2"
shift
shift
;;
--fstack) --fstack)
FSTACK=true FSTACK=true
USERSTACK=true USERSTACK=true
...@@ -122,6 +127,9 @@ if [ "${#EXTRA_TUNING[@]}" -gt 0 ]; then ...@@ -122,6 +127,9 @@ if [ "${#EXTRA_TUNING[@]}" -gt 0 ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.$tuning" EXPERIMENT_NAME="$EXPERIMENT_NAME.$tuning"
done done
fi fi
if [ ! -z "$OVERRIDE_CPUS" ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.override_cpus$OVERRIDE_CPUS"
fi
if [ "$FSTACK" == "true" ]; then if [ "$FSTACK" == "true" ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.fstack" EXPERIMENT_NAME="$EXPERIMENT_NAME.fstack"
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment