@@ -302,7 +302,8 @@ if [ -d "$cstate_dir" ]; then
302302 done
303303else
304304 echo "C-state directory not found."
305- fi` ,
305+ fi
306+ ` ,
306307 },
307308 SpecTurboCoresScriptName : {
308309 Name : SpecTurboCoresScriptName ,
@@ -495,8 +496,7 @@ rdmsr 0x1ad # MSR_TURBO_RATIO_LIMIT: Maximum Ratio Limit of Turbo Mode
495496 },
496497 ElcScriptName : {
497498 Name : ElcScriptName ,
498- ScriptTemplate : `
499- # Script derived from bhs-power-mode script in Intel PCM repository
499+ ScriptTemplate : `# Script derived from bhs-power-mode script in Intel PCM repository
500500# Run the pcm-tpmi command to determine I/O and compute dies
501501output=$(pcm-tpmi 2 0x10 -d -b 26:26)
502502
@@ -560,7 +560,7 @@ for die in "${!die_types[@]}"; do
560560 fi
561561 done <<< "$output"
562562done
563- ` ,
563+ ` ,
564564 Architectures : []string {x86_64 },
565565 Families : []string {"6" }, // Intel
566566 Models : []string {"173" , "175" }, // GNR, SRF
@@ -654,7 +654,8 @@ echo "" # finish the line
654654 Name : ChaCountScriptName ,
655655 ScriptTemplate : `rdmsr 0x396
656656rdmsr 0x702
657- rdmsr 0x2FFE` , // uncore client cha count, uncore cha count, uncore cha count spr
657+ rdmsr 0x2FFE
658+ ` , // uncore client cha count, uncore cha count, uncore cha count spr
658659 Architectures : []string {x86_64 },
659660 Families : []string {"6" }, // Intel
660661 Lkms : []string {"msr" },
@@ -707,7 +708,7 @@ rdmsr 0x2FFE`, // uncore client cha count, uncore cha count, uncore cha count sp
707708 echo -n "IRQ Balance: "
708709 pgrep irqbalance >/dev/null && echo "Enabled" || echo "Disabled"
709710done
710- ` ,
711+ ` ,
711712 Depends : []string {"lshw" },
712713 Superuser : true ,
713714 },
756757 fi
757758 fi
758759 echo "$name|$model|$size|$mountpoint|$fstype|$rqsize|$minio|$fw|$addr|$numa|$curlinkspeed|$curlinkwidth|$maxlinkspeed|$maxlinkwidth"
759- done` ,
760+ done
761+ ` ,
760762 },
761763 HdparmScriptName : {
762764 Name : HdparmScriptName ,
763765 ScriptTemplate : `lsblk -d -r -o NAME -e7 -e1 -n | while read -r device ; do
764766 hdparm -i /dev/"$device"
765- done` ,
767+ done
768+ ` ,
766769 Superuser : true ,
767770 },
768771 DfScriptName : {
@@ -859,7 +862,8 @@ for i in "${pmu_counters[@]}"; do
859862 fi
860863 # print the full list of PMU values
861864 echo "Values: ${pmu_values[$i]}"
862- done` ,
865+ done
866+ ` ,
863867 Superuser : true ,
864868 Architectures : []string {x86_64 },
865869 Families : []string {"6" }, // Intel
@@ -897,7 +901,8 @@ if [ $needed_num_huge_pages -gt $orig_num_huge_pages ]; then
897901 echo $needed_num_huge_pages > /proc/sys/vm/nr_hugepages
898902fi
899903mlc --loaded_latency
900- echo $orig_num_huge_pages > /proc/sys/vm/nr_hugepages` ,
904+ echo $orig_num_huge_pages > /proc/sys/vm/nr_hugepages
905+ ` ,
901906 Architectures : []string {x86_64 },
902907 Superuser : true ,
903908 Lkms : []string {"msr" },
@@ -917,7 +922,8 @@ if [ $needed_num_huge_pages -gt $orig_num_huge_pages ]; then
917922 echo $needed_num_huge_pages > /proc/sys/vm/nr_hugepages
918923fi
919924mlc --bandwidth_matrix
920- echo $orig_num_huge_pages > /proc/sys/vm/nr_hugepages` ,
925+ echo $orig_num_huge_pages > /proc/sys/vm/nr_hugepages
926+ ` ,
921927 Architectures : []string {x86_64 },
922928 Superuser : true ,
923929 Lkms : []string {"msr" },
@@ -930,7 +936,8 @@ echo $orig_num_huge_pages > /proc/sys/vm/nr_hugepages`,
930936for method in $methods; do
931937 printf "%s " "$method"
932938 stress-ng --cpu 0 -t 1 --cpu-method "$method" --metrics-brief 2>&1 | tail -1 | awk '{print $9}'
933- done` ,
939+ done
940+ ` ,
934941 Superuser : false ,
935942 Depends : []string {"stress-ng" },
936943 Sequential : true ,
@@ -1005,7 +1012,8 @@ interleaved_core_list=$(IFS=,; echo "${interleaved_cores[*]}")
10051012num_cores_per_socket=$( lscpu | grep 'Core(s) per socket:' | head -1 | awk '{print $4}' )
10061013
10071014# Run the avx-turbo benchmark
1008- avx-turbo --min-threads=1 --max-threads=$num_cores_per_socket --test scalar_iadd,avx128_fma,avx256_fma,avx512_fma --iters=100000 --cpuids=$interleaved_core_list` ,
1015+ avx-turbo --min-threads=1 --max-threads=$num_cores_per_socket --test scalar_iadd,avx128_fma,avx256_fma,avx512_fma --iters=100000 --cpuids=$interleaved_core_list
1016+ ` ,
10091017 Superuser : true ,
10101018 Lkms : []string {"msr" },
10111019 Depends : []string {"avx-turbo" },
@@ -1079,7 +1087,8 @@ if [ $duration -ne 0 ] && [ $interval -ne 0 ]; then
10791087fi
10801088mpstat -u -T -I SCPU -P ALL $interval $count &
10811089echo $! > {{.ScriptName}}_cmd.pid
1082- wait` ,
1090+ wait
1091+ ` ,
10831092 Superuser : true ,
10841093 Lkms : []string {},
10851094 Depends : []string {"mpstat" },
@@ -1094,7 +1103,8 @@ if [ $duration -ne 0 ] && [ $interval -ne 0 ]; then
10941103fi
10951104S_TIME_FORMAT=ISO iostat -d -t $interval $count | sed '/^loop/d' &
10961105echo $! > {{.ScriptName}}_cmd.pid
1097- wait` ,
1106+ wait
1107+ ` ,
10981108 Superuser : true ,
10991109 Lkms : []string {},
11001110 Depends : []string {"iostat" },
@@ -1109,7 +1119,8 @@ if [ $duration -ne 0 ] && [ $interval -ne 0 ]; then
11091119fi
11101120sar -r $interval $count &
11111121echo $! > {{.ScriptName}}_cmd.pid
1112- wait` ,
1122+ wait
1123+ ` ,
11131124 Superuser : true ,
11141125 Lkms : []string {},
11151126 Depends : []string {"sar" , "sadc" },
@@ -1124,7 +1135,8 @@ if [ $duration -ne 0 ] && [ $interval -ne 0 ]; then
11241135fi
11251136sar -n DEV $interval $count &
11261137echo $! > {{.ScriptName}}_cmd.pid
1127- wait` ,
1138+ wait
1139+ ` ,
11281140 Superuser : true ,
11291141 Lkms : []string {},
11301142 Depends : []string {"sar" , "sadc" },
@@ -1140,7 +1152,8 @@ if [ $duration -ne 0 ] && [ $interval -ne 0 ]; then
11401152fi
11411153turbostat -S -s PkgWatt,RAMWatt -q -i $interval $count | awk '{ print strftime("%H:%M:%S"), $0 }' &
11421154echo $! > {{.ScriptName}}_cmd.pid
1143- wait` ,
1155+ wait
1156+ ` ,
11441157 Superuser : true ,
11451158 Lkms : []string {"msr" },
11461159 Depends : []string {"turbostat" },
@@ -1173,21 +1186,35 @@ done
11731186
11741187processwatch -c $arg_sampling_rate $arg_pid $arg_interval $arg_count $arg_filter &
11751188echo $! > {{.ScriptName}}_cmd.pid
1176- wait` ,
1189+ wait
1190+ ` ,
11771191 Superuser : true ,
11781192 Lkms : []string {"msr" },
11791193 Depends : []string {"processwatch" },
11801194 NeedsKill : true ,
11811195 },
11821196 GaudiStatsScriptName : {
11831197 Name : GaudiStatsScriptName ,
1184- ScriptTemplate : `hl-smi --query-aip=timestamp,name,temperature.aip,module_id,utilization.aip,memory.total,memory.free,memory.used,power.draw --format=csv,nounits -l {{.Interval}} &
1185- echo $! > {{.ScriptName}}_cmd.pid
1186- sleep {{.Duration}}
1187- kill -SIGINT $(cat {{.ScriptName}}_cmd.pid)` ,
1198+ ScriptTemplate : `
1199+ # if the hl-smi program is in the path
1200+ if command -v hl-smi &> /dev/null; then
1201+ hl-smi --query-aip=timestamp,name,temperature.aip,module_id,utilization.aip,memory.total,memory.free,memory.used,power.draw --format=csv,nounits -l {{.Interval}} &
1202+ echo $! > {{.ScriptName}}_cmd.pid
1203+ # if duration is set, sleep for the duration then kill the process
1204+ if [ {{.Duration}} -ne 0 ]; then
1205+ sleep {{.Duration}}
1206+ kill -SIGINT $(cat {{.ScriptName}}_cmd.pid)
1207+ fi
1208+ wait
1209+ else
1210+ echo "hl-smi not found in the path" >&2
1211+ exit 1
1212+ fi
1213+ ` ,
11881214 Superuser : true ,
11891215 NeedsKill : true ,
11901216 },
1217+ // profile (flamegraph) scripts
11911218 ProfileJavaScriptName : {
11921219 Name : ProfileJavaScriptName ,
11931220 ScriptTemplate : `interval={{.Interval}}
@@ -1287,6 +1314,7 @@ rm -f "$perf_fp_data" "$perf_dwarf_data" "$perf_dwarf_folded" "$perf_fp_folded"
12871314 Superuser : true ,
12881315 Depends : []string {"perf" , "stackcollapse-perf.pl" },
12891316 },
1317+ // lock analysis scripts
12901318 ProfileKernelLockScriptName : {
12911319 Name : ProfileKernelLockScriptName ,
12921320 ScriptTemplate : `frequency={{.Frequency}}
0 commit comments