-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add simple script that grabs some information about CPU, memory, etc (everything that doesn't require root privileges)
- Loading branch information
Showing
2 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env bash | ||
|
||
source common.sh | ||
RESULT_DIR="../results/${current_arch}" | ||
mkdir -p "${RESULT_DIR}" | ||
|
||
echo "Recording output of uname" | ||
uname -mrsv > "${RESULT_DIR}/linux_uname.log" | ||
|
||
if [[ -d /sys/devices/system/cpu/ ]]; then | ||
echo "Obtaining cpu information from /sys" | ||
for i in /sys/devices/system/cpu/cpu[0-9]*; do | ||
CPU=$(basename "${i}") | ||
if [[ -d "${i}/cache" ]]; then | ||
for idx in ${i}/cache/index*; do | ||
IDX_NAME=$(basename ${idx}) | ||
LEVEL=$(cat "${idx}/level") | ||
TYPE=$(cat "${idx}/type") | ||
for parameter in ${idx}/*; do | ||
p_base="$(basename ${parameter})" | ||
if [[ "${p_base}" == "uevent" ]] || [[ "${p_base}" == "level" ]] || [[ "${p_base}" == "type" ]]; then | ||
continue | ||
fi | ||
echo -n "${CPU}_L${LEVEL}${TYPE}_${p_base}=" >> "${RESULT_DIR}/linux_cpu_sys.log" | ||
cat "${parameter}" >> "${RESULT_DIR}/linux_cpu_sys.log" | ||
done | ||
done | ||
fi | ||
if [[ -d "${i}/cpufreq" ]]; then | ||
for freq in cur_freq max_freq min_freq; do | ||
echo -n "${CPU}_${freq}=" >> "${RESULT_DIR}/linux_cpu_sys.log" | ||
cat "${i}/cpufreq/scaling_${freq}" >> "${RESULT_DIR}/linux_cpu_sys.log" | ||
done | ||
fi | ||
done | ||
fi | ||
|
||
echo "Saving numactl information..." | ||
numactl -H &>> "${RESULT_DIR}/linux_numactl.log" | ||
|
||
echo "Getting information from current compiler" | ||
cc --version >> "${RESULT_DIR}/linux_compiler.log" | ||
|
||
# compile test code and do heruistics to detect cpu frequency | ||
echo "Compiling code to detect CPU frequency..." | ||
cc -ocpu_freq -std=gnu99 -Wall -Wextra -O2 utilities/cpu_freq.c -lpthread | ||
echo "Running tool to attempt to detect real sustained frequency... This might take a while..." | ||
echo "To make results more accurate please don't touch your computer while tools are running" | ||
CORES=${cpus_count} | ||
rm -f "${RESULT_DIR}/linux_freq.log" | ||
for i in $(seq 1 "${CORES}"); do | ||
echo "Running code to detect CPU frequency for ${i} cores" | ||
nice -19 ./cpu_freq "${i}" >> "${RESULT_DIR}/linux_freq.log" | ||
echo >> "${RESULT_DIR}/linux_freq.log" | ||
done | ||
echo "Saving cpuinfo and meminfo" | ||
cat /proc/cpuinfo > "${RESULT_DIR}/linux_cpuinfo.log" | ||
cat /proc/meminfo > "${RESULT_DIR}/linux_meminfo.log" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters