#!/usr/bin/env sh # Run a command on one kind of core of a hybrid Intel CI host: # tools/ci-cores.sh performance|efficiency command [args...] # The deploy's release build goes on the performance cores and the workflows # that do not gate a deploy (ARMv6, campaigns) on the efficiency cores, so they # stop slowing it down. Without taskset or a hybrid CPU the command runs as is. set -eu case "${1:-}" in performance) cpus=/sys/devices/cpu_core/cpus ;; efficiency) cpus=/sys/devices/cpu_atom/cpus ;; *) echo "usage: $0 performance|efficiency command [args...]" >&2; exit 2 ;; esac shift set_=$(cat "$cpus" 2>/dev/null || true) if [ -n "$set_" ] && command -v taskset >/dev/null 2>&1 && taskset -c "$set_" true 2>/dev/null; then echo "running on cpus $set_: $1" >&2 exec taskset -c "$set_" "$@" fi exec "$@"