Skip to content

Added a timeout to pin_thread. #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025
Merged
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
21 changes: 19 additions & 2 deletions scripts/remote-benchmarks-runner
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,27 @@ function pin_thread()
local pid=${1}
local thread_name=${2}
local core=${3}
local tid="\$(ps Ho tid,comm -p ${pid} | awk '/${thread_name}/{print \$1}' | head -1)"
echo "echo 'Pinning thread: $thread_name'; tid=${tid}; while [ -z \"\${tid}\" ]; do sleep 0.1; tid=${tid}; done; echo \"tid_${thread_name}='\${tid}'\"; taskset -p -c ${core} \${tid}"
local tid_cmd="\$(ps Ho tid,comm -p ${pid} | awk '/${thread_name}/{print \$1}' | head -1)"
echo "
set -e
echo 'Pinning thread: ${thread_name}'
count=0
tid=${tid_cmd}
while [ -z \"\${tid}\" ] && [ \${count} -lt 600 ]; do
sleep 0.1
tid=${tid_cmd}
count=\$((count + 1))
done
if [ -z \"\${tid}\" ]; then
echo 'Timeout: thread ${thread_name} not found after 60 seconds.'
exit 1
fi
echo \"tid_${thread_name}='\${tid}'\"
taskset -p -c ${core} \${tid}
"
}


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra empty line

function kill_java_process()
{
local class_name=${1}
Expand Down