]> git.proxmox.com Git - mirror_zfs-debian.git/blame - scripts/profile-kpios-post.sh
Removed build system from master branch, will relocate to linux-zfs-branch
[mirror_zfs-debian.git] / scripts / profile-kpios-post.sh
CommitLineData
34dc7c2f
BB
1#!/bin/bash
2
3prog=profile-kpios-post.sh
4. ../.script-config
5
6RUN_POST=${0}
7RUN_PHASE=${1}
8RUN_LOG_DIR=${2}
9RUN_ID=${3}
10RUN_POOL=${4}
11RUN_CHUNK_SIZE=${5}
12RUN_REGION_SIZE=${6}
13RUN_THREAD_COUNT=${7}
14RUN_REGION_COUNT=${8}
15RUN_OFFSET=${9}
16RUN_REGION_NOISE=${10}
17RUN_CHUNK_NOISE=${11}
18RUN_THREAD_DELAY=${12}
19RUN_FLAGS=${13}
20RUN_RESULT=${14}
21
22PROFILE_KPIOS_PIDS_BIN=/home/behlendo/src/zfs/scripts/profile-kpios-pids.sh
23PROFILE_KPIOS_PIDS_LOG=${RUN_LOG_DIR}/${RUN_ID}/pids-summary.csv
24
25PROFILE_KPIOS_DISK_BIN=/home/behlendo/src/zfs/scripts/profile-kpios-disk.sh
26PROFILE_KPIOS_DISK_LOG=${RUN_LOG_DIR}/${RUN_ID}/disk-summary.csv
27
28PROFILE_KPIOS_ARC_LOG=${RUN_LOG_DIR}/${RUN_ID}/arcstats
29PROFILE_KPIOS_VDEV_LOG=${RUN_LOG_DIR}/${RUN_ID}/vdev_cache_stats
30
31KERNEL_BIN="/lib/modules/`uname -r`/kernel/"
32SPL_BIN="${SPLBUILD}/modules/spl/"
33ZFS_BIN="${ZFSBUILD}/lib/"
34
35OPROFILE_SHORT_ARGS="-a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
36OPROFILE_LONG_ARGS="-d -a -g -l -p ${KERNEL_BIN},${SPL_BIN},${ZFS_BIN}"
37
38OPROFILE_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile.txt
39OPROFILE_SHORT_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-short.txt
40OPROFILE_LONG_LOG=${RUN_LOG_DIR}/${RUN_ID}/oprofile-long.txt
41PROFILE_PID=${RUN_LOG_DIR}/${RUN_ID}/pid
42
43if [ "${RUN_PHASE}" != "post" ]; then
44 exit 1
45fi
46
47# opcontrol --stop >>${OPROFILE_LOG} 2>&1
48# opcontrol --dump >>${OPROFILE_LOG} 2>&1
49
50kill -s SIGHUP `cat ${PROFILE_PID}`
51rm -f ${PROFILE_PID}
52
53# opreport ${OPROFILE_SHORT_ARGS} >${OPROFILE_SHORT_LOG} 2>&1
54# opreport ${OPROFILE_LONG_ARGS} >${OPROFILE_LONG_LOG} 2>&1
55
56# opcontrol --deinit >>${OPROFILE_LOG} 2>&1
57
58cat /proc/spl/kstat/zfs/arcstats >${PROFILE_KPIOS_ARC_LOG}
59cat /proc/spl/kstat/zfs/vdev_cache_stats >${PROFILE_KPIOS_VDEV_LOG}
60
61# Summarize system time per pid
62${PROFILE_KPIOS_PIDS_BIN} ${RUN_LOG_DIR} ${RUN_ID} >${PROFILE_KPIOS_PIDS_LOG}
63
64# Summarize per device performance
65${PROFILE_KPIOS_DISK_BIN} ${RUN_LOG_DIR} ${RUN_ID} >${PROFILE_KPIOS_DISK_LOG}
66
67exit 0