-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkernel-autofdo.sh
executable file
·80 lines (61 loc) · 2.45 KB
/
kernel-autofdo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
set -euo pipefail
#-------------------------------------------------------------------------------
# CachyOS Benchmarker & Profiling Setup
#-------------------------------------------------------------------------------
# Allow to profile with branch sampling
sudo sh -c "echo 0 > /proc/sys/kernel/kptr_restrict"
sudo sh -c "echo 0 > /proc/sys/kernel/perf_event_paranoid"
# Variables
WORKDIR="${HOME}/profiling"
NPROC="$(nproc)"
echo "CachyOS Benchmarker"
# Create and enter the working directory
mkdir -p "${WORKDIR}"
cd "${WORKDIR}"
# Run the CachyOS benchmarker
cachyos-benchmarker "${WORKDIR}"
#-------------------------------------------------------------------------------
# Sysbench Tests
#-------------------------------------------------------------------------------
echo "Running Sysbench tests..."
# CPU Test
echo "CPU Test:"
sysbench --time=30 cpu --cpu-max-prime=50000 --threads="${NPROC}" run
# Memory Tests
echo "Memory Test:"
sysbench memory --memory-block-size=1M --memory-total-size=16G run
sysbench memory --memory-block-size=1M --memory-total-size=16G --memory-oper=read --num-threads=16 run
# I/O Tests
echo "I/O Test:"
sysbench fileio --file-total-size=5G --file-num=5 prepare
sysbench fileio --file-total-size=5G --file-num=5 \
--file-fsync-freq=0 --file-test-mode=rndrd --file-block-size=4K run
sysbench fileio --file-total-size=5G --file-num=5 \
--file-fsync-freq=0 --file-test-mode=seqwr --file-block-size=1M run
sysbench fileio --file-total-size=5G --file-num=5 cleanup
#-------------------------------------------------------------------------------
# Git and Kernel Compilation
#-------------------------------------------------------------------------------
echo "Cloning and compiling kernel..."
# Adjust the repository URL and branch as necessary
git clone --depth=1 -b 6.12/base [email protected]:CachyOS/linux.git linux
cd linux
git pull
zcat /proc/config.gz > .config
make prepare
make defconfig
make -j"${NPROC}"
cd .. && rm -rf linux
#-------------------------------------------------------------------------------
# Miscellaneous Tests
#-------------------------------------------------------------------------------
echo "Running miscellaneous tests..."
# Find all .conf files on the system (silenced output, may take a while)
find / -type f -name "*.conf" > /dev/null 2>&1 || true
# Using ripgrep (rg) to search for various terms
rg test || true
rg KERNEL || true
rg sched || true
rg fair || true
echo "All tests completed."