Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1995-1997 Microsoft Corporation
  3. Module Name:
  4. spud.cxx
  5. Abstract:
  6. This module contains an NTSD debugger extension for dumping the
  7. SPUD counters.
  8. Author:
  9. Keith Moore (keithmo) 21-Oct-1997
  10. Revision History:
  11. --*/
  12. #include "inetdbgp.h"
  13. extern "C" {
  14. #include <tdikrnl.h>
  15. #include <afd.h>
  16. #include <uspud.h>
  17. } // extern "C"
  18. /************************************************************
  19. * Dump SPUD Counters
  20. ************************************************************/
  21. DECLARE_API( spud )
  22. /*++
  23. Routine Description:
  24. This function is called as an NTSD extension to format and dump
  25. the SPUD counters.
  26. Arguments:
  27. hCurrentProcess - Supplies a handle to the current process (at the
  28. time the extension was called).
  29. hCurrentThread - Supplies a handle to the current thread (at the
  30. time the extension was called).
  31. CurrentPc - Supplies the current pc at the time the extension is
  32. called.
  33. lpExtensionApis - Supplies the address of the functions callable
  34. by this extension.
  35. lpArgumentString - Supplies the asciiz string that describes the
  36. ansi string to be dumped.
  37. Return Value:
  38. None.
  39. --*/
  40. {
  41. SPUD_COUNTERS counters;
  42. NTSTATUS status;
  43. INIT_API();
  44. status = SPUDGetCounts( &counters );
  45. if( NT_SUCCESS(status) ) {
  46. dprintf(
  47. "CtrTransmitfileAndRecv = %lu\n"
  48. "CtrTrasnRecvFastTrans = %lu\n"
  49. "CtrTransRecvFastRecv = %lu\n"
  50. "CtrTransRecvSlowTrans = %lu\n"
  51. "CtrTransRecvSlowRecv = %lu\n"
  52. "CtrSendAndRecv = %lu\n"
  53. "CtrSendRecvFastSend = %lu\n"
  54. "CtrSendRecvFastRecv = %lu\n"
  55. "CtrSendRecvSlowSend = %lu\n"
  56. "CtrSendRecvSlowRecv = %lu\n",
  57. counters.CtrTransmitfileAndRecv,
  58. counters.CtrTransRecvFastTrans,
  59. counters.CtrTransRecvFastRecv,
  60. counters.CtrTransRecvSlowTrans,
  61. counters.CtrTransRecvSlowRecv,
  62. counters.CtrSendAndRecv,
  63. counters.CtrSendRecvFastSend,
  64. counters.CtrSendRecvFastRecv,
  65. counters.CtrSendRecvSlowSend,
  66. counters.CtrSendRecvSlowRecv
  67. );
  68. } else {
  69. dprintf( "error %08lx retrieving SPUD counters\n", status );
  70. }
  71. } // DECLARE_API( spud )