| 454 | } |
| 455 | |
| 456 | void |
| 457 | netisr_stats(void) |
| 458 | { |
| 459 | struct sysctl_netisr_workstream *snwsp; |
| 460 | struct sysctl_netisr_proto *snpp; |
| 461 | u_int i; |
| 462 | |
| 463 | if (live) { |
| 464 | netisr_load_sysctl_config(); |
| 465 | netisr_load_sysctl_proto(); |
| 466 | netisr_load_sysctl_workstream(); |
| 467 | netisr_load_sysctl_work(); |
| 468 | } else { |
| 469 | #ifndef FSTACK |
| 470 | netisr_load_kvm_config(); |
| 471 | netisr_load_kvm_proto(); |
| 472 | netisr_load_kvm_workstream(); /* Also does work. */ |
| 473 | #endif |
| 474 | } |
| 475 | |
| 476 | xo_open_container("netisr"); |
| 477 | |
| 478 | xo_emit("{T:Configuration}:\n"); |
| 479 | xo_emit("{T:/%-25s} {T:/%12s} {T:/%12s}\n", |
| 480 | "Setting", "Current", "Limit"); |
| 481 | xo_emit("{T:/%-25s} {T:/%12u} {T:/%12u}\n", |
| 482 | "Thread count", numthreads, maxthreads); |
| 483 | xo_emit("{T:/%-25s} {T:/%12u} {T:/%12u}\n", |
| 484 | "Default queue limit", defaultqlimit, maxqlimit); |
| 485 | xo_emit("{T:/%-25s} {T:/%12s} {T:/%12s}\n", |
| 486 | "Dispatch policy", dispatch_policy, "n/a"); |
| 487 | xo_emit("{T:/%-25s} {T:/%12s} {T:/%12s}\n", |
| 488 | "Threads bound to CPUs", bindthreads ? "enabled" : "disabled", |
| 489 | "n/a"); |
| 490 | xo_emit("\n"); |
| 491 | |
| 492 | xo_emit("{T:Protocols}:\n"); |
| 493 | xo_emit("{T:/%-6s} {T:/%5s} {T:/%6s} {T:/%-6s} {T:/%-8s} {T:/%-5s}\n", |
| 494 | "Name", "Proto", "QLimit", "Policy", "Dispatch", "Flags"); |
| 495 | xo_open_list("protocol"); |
| 496 | for (i = 0; i < proto_array_len; i++) { |
| 497 | xo_open_instance("protocol"); |
| 498 | snpp = &proto_array[i]; |
| 499 | netisr_print_proto(snpp); |
| 500 | xo_close_instance("protocol"); |
| 501 | } |
| 502 | xo_close_list("protocol"); |
| 503 | xo_emit("\n"); |
| 504 | |
| 505 | xo_emit("{T:Workstreams}:\n"); |
| 506 | xo_emit("{T:/%4s} {T:/%3s} ", "WSID", "CPU"); |
| 507 | xo_emit("{P:/%2s}", ""); |
| 508 | xo_emit("{T:/%-6s} {T:/%5s} {T:/%5s} {T:/%8s} {T:/%8s} {T:/%8s} " |
| 509 | "{T:/%8s} {T:/%8s}\n", |
| 510 | "Name", "Len", "WMark", "Disp'd", "HDisp'd", "QDrops", "Queued", |
| 511 | "Handled"); |
| 512 | xo_open_list("workstream"); |
| 513 | for (i = 0; i < workstream_array_len; i++) { |
no test coverage detected