dbginfo: collect qdisc statistics

This can be helpful in diagnosing network-related issues.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Julian Wiedmann
2019-10-07 13:18:12 +02:00
committed by Jan Höppner
parent 852fb9dfb8
commit 125df52887
3 changed files with 54 additions and 24 deletions

View File

@@ -176,6 +176,9 @@ readonly OUTPUT_FILE_OSAOAT="${WORKPATH}osa_oat"
# File that includes content of Ethtool commands
readonly OUTPUT_FILE_ETHTOOL="${WORKPATH}ethtool.out"
# File that includes content of tc commands
readonly OUTPUT_FILE_TC="${WORKPATH}tc.out"
# File that includes the output of journalctl
readonly OUTPUT_FILE_JOURNALCTL="${WORKPATH}journalctl.out"
@@ -195,7 +198,7 @@ readonly OUTPUT_FILE_NVME="${WORKPATH}nvme.out"
readonly MOUNT_POINT_DEBUGFS="/sys/kernel/debug"
# The amount of steps running the whole collections
readonly COLLECTION_COUNT=13
readonly COLLECTION_COUNT=14
# The kernel version (e.g. '2' from 2.6.32 or '3' from 3.2.1)
readonly KERNEL_VERSION=$(uname -r 2>/dev/null | cut -d'.' -f1)
@@ -792,6 +795,28 @@ collect_ethtool() {
pr_log_stdout " "
}
########################################
collect_tc() {
local network_devices
local network_device
network_devices=$(ls /sys/class/net 2>/dev/null)
if which tc >/dev/null 2>&1; then
if test -n "${network_devices}"; then
pr_syslog_stdout "9 of ${COLLECTION_COUNT}: Collecting tc output"
for network_device in ${network_devices}; do
call_run_command "tc -s qdisc show dev ${network_device}" "${OUTPUT_FILE_TC}"
done
else
pr_syslog_stdout "9 of ${COLLECTION_COUNT}: Collecting tc output skipped - no devices"
fi
else
pr_syslog_stdout "9 of ${COLLECTION_COUNT}: Collecting tc output skipped - not available"
fi
pr_log_stdout " "
}
########################################
# OpenVSwitch
collect_ovs() {
@@ -808,7 +833,7 @@ collect_ovs() {
:ovsdb-client dump\
"
if test -n "${br_list}"; then
pr_syslog_stdout "9 of ${COLLECTION_COUNT}: Collecting OpenVSwitch output"
pr_syslog_stdout "10 of ${COLLECTION_COUNT}: Collecting OpenVSwitch output"
IFS=:
for ovscmd in ${ovscmds}; do
IFS=${ifs_orig} call_run_command "${ovscmd}" "${OUTPUT_FILE_OVS}.out"
@@ -827,7 +852,7 @@ collect_ovs() {
IFS="${ifs_orig}"
done
else
pr_syslog_stdout "9 of ${COLLECTION_COUNT}: Collecting OpenVSwitch output skipped"
pr_syslog_stdout "10 of ${COLLECTION_COUNT}: Collecting OpenVSwitch output skipped"
fi
pr_log_stdout " "
@@ -840,12 +865,12 @@ collect_domain_xml() {
domain_list=$(virsh list --all --name)
if test -n "${domain_list}"; then
pr_syslog_stdout "10 of ${COLLECTION_COUNT}: Collecting domain xml files"
pr_syslog_stdout "11 of ${COLLECTION_COUNT}: Collecting domain xml files"
for domain in ${domain_list}; do
call_run_command "virsh dumpxml ${domain}" "${OUTPUT_FILE_XML}_${domain}.xml"
done
else
pr_syslog_stdout "10 of ${COLLECTION_COUNT}: Collecting domain xml files skipped"
pr_syslog_stdout "11 of ${COLLECTION_COUNT}: Collecting domain xml files skipped"
fi
pr_log_stdout " "
@@ -859,23 +884,23 @@ collect_docker() {
# call docker inspect for all containers
item_list=$(docker ps -qa)
if test -n "${item_list}"; then
pr_syslog_stdout "11a of ${COLLECTION_COUNT}: Collecting docker container output"
pr_syslog_stdout "12a of ${COLLECTION_COUNT}: Collecting docker container output"
for item in ${item_list}; do
call_run_command "docker inspect ${item}" "${OUTPUT_FILE_DOCKER}"
done
else
pr_syslog_stdout "11a of ${COLLECTION_COUNT}: Collecting docker container output skipped"
pr_syslog_stdout "12a of ${COLLECTION_COUNT}: Collecting docker container output skipped"
fi
# call docker inspect for all networks
item_list=$(docker network ls -q)
if test -n "${item_list}"; then
pr_syslog_stdout "11b of ${COLLECTION_COUNT}: Collecting docker network output"
pr_syslog_stdout "12b of ${COLLECTION_COUNT}: Collecting docker network output"
for item in ${item_list}; do
call_run_command "docker network inspect ${item}" "${OUTPUT_FILE_DOCKER}"
done
else
pr_syslog_stdout "11b of ${COLLECTION_COUNT}: Collecting docker network output skipped"
pr_syslog_stdout "12b of ${COLLECTION_COUNT}: Collecting docker network output skipped"
fi
pr_log_stdout " "
@@ -885,7 +910,7 @@ collect_docker() {
collect_nvme() {
local NVME
pr_syslog_stdout "12 of ${COLLECTION_COUNT}: Collecting nvme output"
pr_syslog_stdout "13 of ${COLLECTION_COUNT}: Collecting nvme output"
call_run_command "nvme list" "${OUTPUT_FILE_NVME}"
for NVME in /dev/nvme[0-9]*; do
@@ -1194,6 +1219,8 @@ collect_osaoat
collect_ethtool
collect_tc
collect_ovs
collect_domain_xml

View File

@@ -60,32 +60,34 @@ Kernel version = <kernel\-version>
.br
Runtime environment = z/VM
.PP
1 of 13: Collecting command output
1 of 14: Collecting command output
.PP
2 of 13: Collecting z/VM command output
2 of 14: Collecting z/VM command output
.PP
3 of 13: Collecting procfs
3 of 14: Collecting procfs
.PP
4 of 13: Collecting sysfs
4 of 14: Collecting sysfs
.PP
5 of 13: Collecting log files
5 of 14: Collecting log files
.PP
6 of 13: Collecting config files
6 of 14: Collecting config files
.PP
7 of 13: Collecting osa oat output skipped \- not available
7 of 14: Collecting osa oat output skipped \- not available
.PP
8 of 13: Collecting ethtool output
8 of 14: Collecting ethtool output
.PP
9 of 13: Collecting OpenVSwitch output
9 of 14: Collecting tc output
.pp
10 of 14: Collecting OpenVSwitch output
.PP
10 of 13: Collecting domain xml files
11 of 14: Collecting domain xml files
.PP
11a of 13: Collecting docker container output
11b of 13: Collecting docker network output
12a of 14: Collecting docker container output
12b of 14: Collecting docker network output
.PP
12 of 13: Collecting nvme output
13 of 14: Collecting nvme output
.PP
13 of 13: Postprocessing
14 of 14: Postprocessing
.PP
Finalizing: Creating archive with collected data
.PP