Skip to content
Open
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions bandwidth-latency/bandwidth-latency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function get_io {
fio_outfile=$1-stats.txt

value=$(tail -n 5 $fio_outfile | head -n 2 | \
egrep io= | awk '{print $7}')
grep -E io= | awk '{print $7}')
echo $value | sed 's/(//' | sed 's/),//'
}

Expand Down Expand Up @@ -630,23 +630,23 @@ function compute_statistics {
i_tot_lat_avg=$(awk '{print $11+$15}' < interfered-stats.txt)
i_tot_lat_dev=$(awk '{print $12+$16}' < interfered-stats.txt)

if [[ "$(echo $i_IO_type | egrep read)" != "" ]]; then
if [[ "$(echo $i_IO_type | grep -E read)" != "" ]]; then
i_what=reader
else
i_what=writer
fi

if [[ "$(echo $i_IO_type | egrep rand)" != "" ]]; then
if [[ "$(echo $i_IO_type | grep -E rand)" != "" ]]; then
i_what="rand $i_what"
else
i_what="seq $i_what"
fi

I_mix=$(echo ${I_IO_types[@]} | egrep read)
I_mix=$(echo ${I_IO_types[@]} | grep -E read)

if [[ "$I_mix" == "" ]]; then
I_mix=writers
elif [[ "$(echo ${I_IO_types[@]} | egrep write)" != "" ]]; then
elif [[ "$(echo ${I_IO_types[@]} | grep -E write)" != "" ]]; then
I_mix="readers/writers"
else
I_mix=readers
Expand Down Expand Up @@ -947,12 +947,12 @@ controller=blkio

# prefer v2 also for prop policy
if [[ ( "$type_bw_control" == prop && \
"$(mount | egrep "type cgroup2")" != "" ) || \
"$(mount | grep -E "type cgroup2")" != "" ) || \
"$type_bw_control" == low || "$type_bw_control" == lat || \
"$type_bw_control" == cost ]]; then
# NOTE: cgroups-v2 needed to use low limits or latency/cost controller
# (cgroups-v2 must be enabled in the kernel)
groupdirs=$(mount | egrep ".* on .*blkio.*" | awk '{print $3}')
groupdirs=$(mount | grep -E ".* on .*blkio.*" | awk '{print $3}')
if [[ "$groupdirs" != "" ]]; then
umount $groupdirs >/dev/null 2>&1 # to make the io controller available
fi
Expand Down
32 changes: 16 additions & 16 deletions process_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ function get_partition_info
{
PART_INFO=
if [[ -e $1 ]]; then
PART_INFO=$(df $1 | egrep $1)
PART_INFO=$(df $1 | grep -E $1)
else
# most likely linux live os
PART_INFO=$(df | egrep $1)
PART_INFO=$(df | grep -E $1)
fi
echo $PART_INFO
}
Expand Down Expand Up @@ -87,28 +87,28 @@ function find_dev_for_dir
REALPART=$(basename $REALPATH)

BACKING_DEVS=
if [[ "$(echo $BASEPART | egrep loop)" != "" ]]; then
if [[ "$(echo $BASEPART | grep -E loop)" != "" ]]; then
# loopback device: $BASEPART is already equal to the device name
BACKING_DEVS=$BASEPART
elif cat /proc/1/cgroup | tail -1 | egrep -q "container"; then
elif cat /proc/1/cgroup | tail -1 | grep -E -q "container"; then
# is container. lsblk will return block devices of the host
# so let's use the host drive.
BACKING_DEVS=$(lsblk | egrep -m 1 "disk" | awk '{print $1;}')
elif ! egrep -q $BASEPART /proc/partitions; then
BACKING_DEVS=$(lsblk | grep -E -m 1 "disk" | awk '{print $1;}')
elif ! grep -E -q $BASEPART /proc/partitions; then
# is linux live OS. Use cd drive
BACKING_DEVS=$(lsblk | egrep -m 1 "rom" | awk '{print $1;}')
BACKING_DEVS=$(lsblk | grep -E -m 1 "rom" | awk '{print $1;}')
else
# get devices from partition
for dev in $(ls /sys/block/); do
if ! lsblk /dev/$dev | egrep -q "$BASEPART|$REALPART"; then
if ! lsblk /dev/$dev | grep -E -q "$BASEPART|$REALPART"; then
# the block device does not contain the partition we're
# attempting to run benchmarks on.
continue
fi
disk_line=$(lsblk -n -i /dev/$dev | egrep disk | egrep -v "^ |^\`|\|")
disk_line=$(lsblk -n -i /dev/$dev | grep -E disk | grep -E -v "^ |^\`|\|")
if [[ "$disk_line" != "" && \
( "$(lsblk -n -o TRAN /dev/$dev 2> /dev/null)" != "" || \
$(echo $dev | egrep "mmc|sda|nvme") != "" \
$(echo $dev | grep -E "mmc|sda|nvme") != "" \
) ]]; then
BACKING_DEVS="$BACKING_DEVS $dev"

Expand All @@ -118,7 +118,7 @@ function find_dev_for_dir
fi

if lsblk /dev/$dev | grep -q "md.*raid"; then
if [[ "$(echo $HIGH_LEV_DEV | egrep md)" != "" ]]; then
if [[ "$(echo $HIGH_LEV_DEV | grep -E md)" != "" ]]; then
echo -n Stacked raids not supported
echo " ($HIGH_LEV_DEV + $dev), sorry."
print_dev_help
Expand All @@ -141,7 +141,7 @@ function find_dev_for_dir

function check_create_mount_part
{
if [[ $(echo $BACKING_DEVS | egrep "mmc|nvme") != "" ]]; then
if [[ $(echo $BACKING_DEVS | grep -E "mmc|nvme") != "" ]]; then
extra_char=p
fi

Expand All @@ -160,7 +160,7 @@ function check_create_mount_part
fi

BASE_DIR=$1
if [[ "$(mount | egrep $BASE_DIR)" == "" ]]; then
if [[ "$(mount | grep -E $BASE_DIR)" == "" ]]; then
fsck.ext4 -n $TARGET_PART
if [[ $? -ne 0 ]]; then
mkfs.ext4 -F $TARGET_PART
Expand Down Expand Up @@ -212,7 +212,7 @@ function use_scsi_debug_dev
exit 1
fi

if [[ "$(lsmod | egrep scsi_debug)" == "" ]]; then
if [[ "$(lsmod | grep -E scsi_debug)" == "" ]]; then
echo -n Setting up scsi_debug, this may take a little time ...
sudo modprobe scsi_debug ndelay=1600000 dev_size_mb=1000 max_queue=4
if [[ $? -ne 0 ]]; then
Expand All @@ -223,7 +223,7 @@ function use_scsi_debug_dev
echo " done"
fi

BACKING_DEVS=$(lsscsi | egrep scsi_debug | sed 's<\(.*\)/dev/</dev/<')
BACKING_DEVS=$(lsscsi | grep -E scsi_debug | sed 's<\(.*\)/dev/</dev/<')
BACKING_DEVS=$(echo $BACKING_DEVS | awk '{print $1}')

check_create_mount_part /mnt/scsi_debug
Expand Down Expand Up @@ -343,7 +343,7 @@ function prepare_basedir
TEST_DEV=$(echo $TEST_DEV | sed 's</dev/<<')
fi

DISK=$(lsblk -o TYPE /dev/$TEST_DEV | egrep disk)
DISK=$(lsblk -o TYPE /dev/$TEST_DEV | grep -E disk)

if [[ "$DISK" != "" ]]; then
FORMAT_DISK=$FORMAT
Expand Down
8 changes: 4 additions & 4 deletions run_multiple_benchmarks/run_main_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function repeat

if [ "$test_suffix" == startup ] ; then
bash $2 "$3" $RES_DIR/$1/repetition$i $4
else if [[ "$(echo $1 | egrep latency)" != "" ]]; then
else if [[ "$(echo $1 | grep -E latency)" != "" ]]; then
# use eval to handle double quotes in $2
eval $2 -o $RES_DIR/$1/repetition$i
else
Expand Down Expand Up @@ -779,7 +779,7 @@ if [[ "${#kern_wl[@]}" -eq "0" ]]; then
echo "WARNING: no kernel-devel workload left after filtering" >&2
fi

if [[ "$(echo $BENCHMARKS | egrep replayed)" != "" ]]; then
if [[ "$(echo $BENCHMARKS | grep -E replayed)" != "" ]]; then
../utilities/check_dependencies.sh dd fio iostat bc g++

if [[ $? -ne 0 ]]; then
Expand All @@ -800,7 +800,7 @@ if [[ "$(echo $BENCHMARKS | egrep replayed)" != "" ]]; then
fi
fi
cd $OLDPWD
elif [[ "$(echo $BENCHMARKS | egrep startup)" != "" ]]; then
elif [[ "$(echo $BENCHMARKS | grep -E startup)" != "" ]]; then
../utilities/check_dependencies.sh dd fio iostat \
xterm gnome-terminal lowriter
if [[ $? -ne 0 ]]; then
Expand Down Expand Up @@ -916,7 +916,7 @@ for sched in $SCHEDULERS; do
echo "for $benchmark ($bench_id/$num_benchs)"
send_email "$benchmark tests beginning"

policy_part=$(echo $sched | egrep '^prop-|^low-|^max-|^none-|^lat-')
policy_part=$(echo $sched | grep -E '^prop-|^low-|^max-|^none-|^lat-')

if [[ $benchmark != bandwidth-latency && $benchmark != latency && \
$benchmark != bw-lat-equal-weights && \
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/prev_impl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function original_find_partition_for_dir
do
curpart=$(echo "$var" | cut -f 1 -d " ")

if [[ "$(echo $curpart | egrep '/')" == "" ]] && [[ -z "$2" ]]; then
if [[ "$(echo $curpart | grep -E '/')" == "" ]] && [[ -z "$2" ]]; then
continue
fi

Expand Down
2 changes: 1 addition & 1 deletion unit_tests/test_config_scripts.bats
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ load prev_impl
[ -n "$free_space" ]

# assert is number
echo $free_space | egrep -q "^[0-9]+$"
echo $free_space | grep -E -q "^[0-9]+$"
}
4 changes: 2 additions & 2 deletions utilities/calc_overall_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function file_loop

if [[ $res_type =~ latency ]]; then
in_files=$(find $1 -name "bw_lat-$sched---*---${workload_filter}*.txt")
in_files=$(echo $in_files | egrep $sched)
in_files=$(echo $in_files | grep -E $sched)
else
in_files=$(find $1 -name "*$sched[-]${workload_filter}*.txt")
fi
Expand Down Expand Up @@ -351,7 +351,7 @@ function per_subdirectory_loop
cat line_file$cur_quant | tee -a $out_file > $REDIRECT
second_field=`tail -n 1 $out_file | awk '{print $2}'`

if [[ $(egrep X number_file$cur_quant) != "" ]]; then
if [[ $(grep -E X number_file$cur_quant) != "" ]]; then
echo " min max avg std_dev" | \
tee -a $out_file > $REDIRECT
echo " X X X X" | \
Expand Down
10 changes: 5 additions & 5 deletions utilities/lib_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function test_X_access {
# off, save previous access-control state, to re-enable it
# again at the end of the test, if needed.
XHOST_CONTROL=$($SUDO_PREFIX xhost 2> /dev/null |\
egrep "enabled")
grep -E "enabled")
$SUDO_PREFIX xhost + > /dev/null 2>&1

if [[ $? -ne 0 ]]; then
Expand Down Expand Up @@ -92,7 +92,7 @@ function enable_X_access_and_test_cmd {
# off, save previous access-control state, to re-enable it
# again at the end of the benchmark, if needed.
XHOST_CONTROL=$($SUDO_PREFIX xhost 2> /dev/null |\
egrep "enabled")
grep -E "enabled")
$SUDO_PREFIX xhost + > /dev/null 2>&1

if [[ $? -ne 0 && "$COMMAND" == "" ]]; then
Expand All @@ -110,7 +110,7 @@ function enable_X_access_and_test_cmd {

$COMMAND >comm_out 2>&1
COM_OUT=$?
fail_str=$(egrep -i "fail|error|can\'t open display" comm_out)
fail_str=$(grep -E -i "fail|error|can\'t open display" comm_out)
if [[ $COM_OUT -ne 0 || "$fail_str" != "" ]]; then
continue
fi
Expand Down Expand Up @@ -176,7 +176,7 @@ function restore_scheduler
echo &> /dev/null
PIPE_STATUS=${PIPESTATUS[0]}
NEW_SCHED=$(cat /sys/block/$dev/queue/scheduler | \
egrep "\[$SAVEDSCHED\]")
grep -E "\[$SAVEDSCHED\]")
if [[ $PIPE_STATUS -ne 0 || "$NEW_SCHED" == "" ]]; then
echo "Restore of $SAVEDSCHED failed:" > /dev/tty
cat /sys/block/$dev/queue/scheduler > /dev/tty
Expand All @@ -196,7 +196,7 @@ function set_scheduler
PIPE_STATUS=${PIPESTATUS[0]}
if [[ $(cat /sys/block/$dev/queue/scheduler | wc -w) -gt 1 ]]; then
NEW_SCHED=$(cat /sys/block/$dev/queue/scheduler | \
egrep "\[$sched\]")
grep -E "\[$sched\]")
else
NEW_SCHED=$(cat /sys/block/$dev/queue/scheduler)
fi
Expand Down
12 changes: 6 additions & 6 deletions utilities/plot_stats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ function parse_table
fi

if [[ "$(echo $in_filename | \
egrep ".*latency.*-bw-table.txt")" != "" ]]; then
grep -E ".*latency.*-bw-table.txt")" != "" ]]; then
plot_bw_lat_bars plot_stacked_bar_subplots.py
return
elif [[ "$(echo $in_filename | \
egrep ".*latency.*-lat-table.txt")" != "" ]]; then
grep -E ".*latency.*-lat-table.txt")" != "" ]]; then
plot_bw_lat_bars plot_bar_errbar_subplots.py
return
fi
Expand Down Expand Up @@ -383,9 +383,9 @@ else
if [ -d "$1" ]; then
num_tables_parsed=0
for table_file in "$1"/*-table.txt; do
thr_component=$(echo $table_file | egrep throughput)
startup_component=$(echo $table_file | egrep startup)
video_component=$(echo $table_file | egrep video)
thr_component=$(echo $table_file | grep -E throughput)
startup_component=$(echo $table_file | grep -E startup)
video_component=$(echo $table_file | grep -E video)

if [[ "$thr_component" != "" && \
( "$startup_component" != "" || "$video_component" != "" ) ]]
Expand Down Expand Up @@ -425,7 +425,7 @@ else
fi

if [[ "$(echo $1 | \
egrep ".*latency.*-bw-table.txt")" != "" ]]; then
grep -E ".*latency.*-bw-table.txt")" != "" ]]; then
exit
fi
type gnuplot >/dev/null 2>&1
Expand Down