#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # # Author: Steve Sistare # # Usage: feat [feature1] [feature2] ... # Enable/disable one or more sched_features. # With no arguments, print the currently enabled features. if [[ ! -r /sys/kernel/debug ]]; then echo "Permission denied. You must be root." exit 1 elif [[ ! -r /sys/kernel/debug/sched_features ]]; then echo "debugfs not mounted. Please run as root:" echo " mount -t debugfs none /sys/kernel/debug" exit 1 fi if [ $# == 0 ] ; then cat /sys/kernel/debug/sched_features | sed 's/ /\n/g' else for feat in $* ; do if ! echo $feat > /sys/kernel/debug/sched_features ; then echo Unrecognized feature $feat fi done fi exit 0