Commit fdc277e6 authored by leszeks's avatar leszeks Committed by Commit bot

[tools] run-perf: ensure command line arguments are prepended

This change to run-perf.sh ensures that command line arguments are
prepended rather than appended to the passed in command. This is to
ensure that the arguments to d8 aren't accidentally passed through to
the js instead, as would be in the case:

tools/run-perf.sh d8 main.js -- --js-arg

A real-life example is passing --predictable to Octane's run.js

Review-Url: https://codereview.chromium.org/2391193003
Cr-Commit-Position: refs/heads/master@{#39999}
parent e90a79c6
......@@ -45,9 +45,14 @@ if [ "$ACTUAL_KERNEL_MAP_RESTRICTION" -ne "0" ] ; then
echo 0 | sudo tee $KERNEL_MAP_CONFIG_FILE
fi
# Extract the command being perfed, so that we can prepend arguments to the
# arguments that the user supplied.
COMMAND=$1
shift 1
echo "Running..."
perf record -R \
-e $EVENT_TYPE \
-c $SAMPLE_EVERY_N_CYCLES \
--call-graph $CALL_GRAPH_METHOD \
-i $@ --perf_basic_prof
-i "$COMMAND" --perf_basic_prof "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment