Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/performance/perfcollect/perfcollect
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,24 @@ RunSilent()
fi
}

# Forwards SIGINT to the child process
RunForwardSilent()
{
$* > /dev/null 2>&1 & sleep 1
pid=$!

for (( ; ; ))
do
if [ "$handlerInvoked" == "1" ]
then
kill -INT $pid
break;
else
sleep 1
fi
done
}

InitializeLog()
{
# Pick the log file name.
Expand Down Expand Up @@ -1734,7 +1752,7 @@ DoCollect()
# Start perf record.
if [ "$usePerf" == "1" ]
then
RunSilent $perfcmd $collectionArgs
RunForwardSilent $perfcmd $collectionArgs
else
# Wait here until CTRL+C handler gets called when user types CTRL+C.
LogAppend "Waiting for CTRL+C handler to get called."
Expand Down