3 PROG
=zpios-profile-post.sh
15 RUN_REGION_NOISE
=${10}
21 # Summarize system time per process
22 zpios_profile_post_pids
() {
23 ${PROFILE_PIDS} ${PROFILE_RUN_CR_PIDS_LOG} >${PROFILE_RUN_CR_PIDS_CSV}
24 ${PROFILE_PIDS} ${PROFILE_RUN_WR_PIDS_LOG} >${PROFILE_RUN_WR_PIDS_CSV}
25 ${PROFILE_PIDS} ${PROFILE_RUN_RD_PIDS_LOG} >${PROFILE_RUN_RD_PIDS_CSV}
26 ${PROFILE_PIDS} ${PROFILE_RUN_RM_PIDS_LOG} >${PROFILE_RUN_RM_PIDS_CSV}
29 zpios_profile_post_disk
() {
30 ${PROFILE_DISK} ${PROFILE_RUN_CR_DISK_LOG} >${PROFILE_RUN_CR_DISK_CSV}
31 ${PROFILE_DISK} ${PROFILE_RUN_WR_DISK_LOG} >${PROFILE_RUN_WR_DISK_CSV}
32 ${PROFILE_DISK} ${PROFILE_RUN_RD_DISK_LOG} >${PROFILE_RUN_RD_DISK_CSV}
33 ${PROFILE_DISK} ${PROFILE_RUN_RM_DISK_LOG} >${PROFILE_RUN_RM_DISK_CSV}
36 # Summarize per device performance
38 # Stop a user defined profiling script which is gathering additional data
39 zpios_profile_post_stop
() {
42 kill -s SIGHUP
`cat ${PROFILE_PID}`
45 # Sleep waiting for profile script to exit
46 while [ -f ${PROFILE_PID} ]; do
51 zpios_profile_post_proc_stop
() {
54 if [ -f ${PROFILE_ARC_PROC} ]; then
55 cat ${PROFILE_ARC_PROC} >${PROC_DIR}/arcstats.txt
58 if [ -f ${PROFILE_VDEV_CACHE_PROC} ]; then
59 cat ${PROFILE_VDEV_CACHE_PROC} >${PROC_DIR}/vdev_cache_stats.txt
63 zpios_profile_post_oprofile_stop
() {
65 local OPROFILE_ARGS
="-a -g -l -p ${OPROFILE_KERNEL_DIR},${OPROFILE_SPL_DIR},${OPROFILE_ZFS_DIR}"
67 /usr
/bin
/opcontrol
--stop >>${OPROFILE_LOG} 2>&1
68 /usr
/bin
/opcontrol
--dump >>${OPROFILE_LOG} 2>&1
69 /usr
/bin
/opreport
${OPROFILE_ARGS} >${OPROFILE_LOG} 2>&1
73 zpios_profile_post_create
() {
74 zpios_profile_post_oprofile_stop
${PROFILE_RUN_CR_OPROFILE_LOG}
75 zpios_profile_post_proc_stop
${PROFILE_RUN_CR_DIR}
76 zpios_profile_post_stop
${PROFILE_RUN_CR_PID}
79 zpios_profile_post_write
() {
80 zpios_profile_post_oprofile_stop
${PROFILE_RUN_WR_OPROFILE_LOG}
81 zpios_profile_post_proc_stop
${PROFILE_RUN_WR_DIR}
82 zpios_profile_post_stop
${PROFILE_RUN_WR_PID}
85 zpios_profile_post_read
() {
86 zpios_profile_post_oprofile_stop
${PROFILE_RUN_CR_RD_LOG}
87 zpios_profile_post_proc_stop
${PROFILE_RUN_RD_DIR}
88 zpios_profile_post_stop
${PROFILE_RUN_RD_PID}
91 zpios_profile_post_remove
() {
92 zpios_profile_post_oprofile_stop
${PROFILE_RUN_RM_OPROFILE_LOG}
93 zpios_profile_post_proc_stop
${PROFILE_RUN_RM_DIR}
94 zpios_profile_post_stop
${PROFILE_RUN_RM_PID}
97 # Source global zpios test configuration
98 if [ -f ${RUN_DIR}/zpios-config.sh
]; then
99 .
${RUN_DIR}/zpios-config.sh
102 # Source global per-run test configuration
103 if [ -f ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh
]; then
104 .
${RUN_DIR}/${RUN_ID}/zpios-config-run.sh
107 case "${RUN_PHASE}" in
109 zpios_profile_post_pids
110 zpios_profile_post_disk
113 zpios_profile_post_create
116 zpios_profile_post_write
119 zpios_profile_post_read
122 zpios_profile_post_remove
125 echo "Usage: ${PROG} {post-run|post-create|post-write|post-read|post-remove}"