Leaked source code of windows server 2003
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.

96 lines
2.4 KiB

  1. //
  2. // stats.c dump statistics about the database
  3. //
  4. #include <string.h>
  5. #include <stdio.h>
  6. #if defined(OS2)
  7. #define INCL_NOCOMMON
  8. #define INCL_DOSPROCESS
  9. #define INCL_DOSSEMAPHORES
  10. #define INCL_DOSFILEMGR
  11. #define INCL_DOSERRORS
  12. #define INCL_DOSMISC
  13. #include <os2.h>
  14. #else
  15. #include <windows.h>
  16. #endif
  17. #include <dos.h>
  18. #include "hungary.h"
  19. #include "bsc.h"
  20. #include "bscsup.h"
  21. VOID BSC_API
  22. StatsBSC()
  23. // Dump statistics about the BSC using the output function
  24. //
  25. {
  26. IMOD imod, imodMac;
  27. IMS ims, imsMac;
  28. ISYM isym, isymMac, isymT;
  29. IINST iinst, iinstMac;
  30. IDEF idef, idefMac;
  31. IREF iref, irefMac;
  32. IUSE iuse, iuseMac;
  33. IUBY iuby, iubyMac;
  34. TYP typ;
  35. ATR atr;
  36. isymMac = IsymMac();
  37. imodMac = ImodMac();
  38. MsRangeOfMod((IMOD)(imodMac-1), &ims, &imsMac);
  39. InstRangeOfSym((ISYM)(isymMac-1), &iinst, &iinstMac);
  40. RefRangeOfInst((IINST)(iinstMac-1), &iref, &irefMac);
  41. DefRangeOfInst((IINST)(iinstMac-1), &idef, &idefMac);
  42. UseRangeOfInst((IINST)(iinstMac-1), &iuse, &iuseMac);
  43. UbyRangeOfInst((IINST)(iinstMac-1), &iuby, &iubyMac);
  44. BSCPrintf("Totals\n------\n");
  45. BSCPrintf("MOD : %d\n", imodMac);
  46. BSCPrintf("MODSYM : %d\n", imsMac);
  47. BSCPrintf("SYM : %d\n", isymMac);
  48. BSCPrintf("INST : %d\n", iinstMac);
  49. BSCPrintf("REF : %l\n", irefMac);
  50. BSCPrintf("DEF : %d\n", idefMac);
  51. BSCPrintf("USE : %d\n", iuseMac);
  52. BSCPrintf("UBY : %d\n", iubyMac);
  53. BSCPrintf("\n\nDetail\n\n");
  54. for (imod = 0; imod < imodMac; imod++) {
  55. MsRangeOfMod(imod, &ims, &imsMac);
  56. BSCPrintf("%s Modsyms:%d\n", LszNameFrMod(imod), imsMac-ims);
  57. }
  58. isymMac = IsymMac();
  59. for (isym = 0; isym < isymMac; isym++) {
  60. InstRangeOfSym(isym, &iinst, &iinstMac);
  61. for ( ;iinst < iinstMac; iinst++) {
  62. DumpInst(iinst);
  63. BSCPrintf(" ");
  64. InstInfo(iinst, &isymT, &typ, &atr);
  65. if (isym != isymT)
  66. BSCPrintf("\t ERROR instance points back to wrong symbol!\n");
  67. DefRangeOfInst(iinst, &idef, &idefMac);
  68. BSCPrintf ("DEF %d ", idefMac-idef);
  69. RefRangeOfInst(iinst, &iref, &irefMac);
  70. BSCPrintf ("REF %d ", irefMac-iref);
  71. UseRangeOfInst(iinst, &iuse, &iuseMac);
  72. BSCPrintf ("USE %d ", iuseMac-iuse);
  73. UbyRangeOfInst(iinst, &iuby, &iubyMac);
  74. BSCPrintf ("UBY %d\n", iubyMac-iuby);
  75. }
  76. }
  77. }