summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2011-01-24 10:58:36 +0000
committerrwatson <rwatson@FreeBSD.org>2011-01-24 10:58:36 +0000
commit5616240f6baae7ebdeba7c85053a371b4a8c6b08 (patch)
treee4cd0eb58422a539235fd1cfc34d8979b7b5928f /usr.bin
parent04c7cf2af2e29199942fa596ca1e4872a5896be9 (diff)
downloadFreeBSD-src-5616240f6baae7ebdeba7c85053a371b4a8c6b08.zip
FreeBSD-src-5616240f6baae7ebdeba7c85053a371b4a8c6b08.tar.gz
While printing out the WSID and CPU ID only the first time it appears for
each workstream, rather than on every protocol, is prettier, it makes machine-parsing of netstat -Q output a lot harder. Repeat the information and hope that the user forgives us slightly dense formatting. MFC after: 3 days Reported by: bz Sponsored by: Juniper Networks
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/netisr.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/usr.bin/netstat/netisr.c b/usr.bin/netstat/netisr.c
index 58f2902..25f341c 100644
--- a/usr.bin/netstat/netisr.c
+++ b/usr.bin/netstat/netisr.c
@@ -436,20 +436,14 @@ static void
netisr_print_workstream(struct sysctl_netisr_workstream *snwsp)
{
struct sysctl_netisr_work *snwp;
- int first;
u_int i;
- first = 1;
for (i = 0; i < work_array_len; i++) {
snwp = &work_array[i];
if (snwp->snw_wsid != snwsp->snws_wsid)
continue;
- if (first) {
- printf("%4u ", snwsp->snws_wsid);
- printf("%3u ", snwsp->snws_cpu);
- first = 0;
- } else
- printf("%4s %3s ", "", "");
+ printf("%4u ", snwsp->snws_wsid);
+ printf("%3u ", snwsp->snws_cpu);
printf("%2s", "");
printf("%-6s", netisr_proto2name(snwp->snw_proto));
printf(" %5u", snwp->snw_len);
OpenPOWER on IntegriCloud