User Tools

Site Tools


cdc:nos2.source:nam5871:kptrace

KPTRACE

Table Of Contents

  • [00008] PRGM KPTRACE
  • [00018] PROC MGETS
  • [00019] PROC XTRACE

Source Code

KPTRACE.txt
  1. *DECK KPTRACE
  2. USETEXT NIPDEF
  3. USETEXT DRHDR
  4. USETEXT FREETAB
  5. USETEXT NBT
  6. USETEXT PARAMS
  7.  
  8. PRGM KPTRACE; # PROCESS PIP TRACE K DISPLAY COMMANDS #
  9.  
  10. STARTIMS;
  11. STOPIMS;
  12.  
  13. #
  14.   EXTERNAL REFERENCES
  15. #
  16. XREF
  17. BEGIN
  18. PROC MGETS; # GET A BUFFER #
  19. PROC XTRACE; # TRACE CALL #
  20. LABEL RJMAIN;
  21. END
  22. #
  23.   LOCAL DEFINITIONS
  24. #
  25. DEF PTBSIZE #1001#; # PIP TRACE BUFFER SIZE #
  26. DEF PTBID #63#; # PIP TRACE BUFFER ID #
  27. DEF PTBFETI #5#; # PIP TRACE BUFFER NBT FET INDEX #
  28. #
  29.   LOCAL VARIABLES
  30. #
  31. ITEM FOUND B; # NBT ENTRY FOUND INDICATOR #
  32. ITEM I I; # FOR LOOP INDEX #
  33. ITEM KRC U; # ERROR RETURN CODE #
  34. ITEM HNODE U; # HOST NODE NUMBER #
  35. ITEM TEMP U; # TEMPORARY #
  36.  
  37. CONTROL EJECT;
  38.  
  39. BEGIN # KPTRACE #
  40.  
  41. CONTROL IFEQ DEBUG,1;
  42. XTRACE("KPIPT"); # TRACE CALL #
  43. CONTROL FI;
  44.  
  45. KRC = 0; # INITIALIZE RETURN CODE #
  46. HNODE = 0; # INITIALIZE HOST NODE NUMBER #
  47.  
  48. FOR I=0 STEP 1 WHILE I LS WC
  49. AND KRC EQ 0
  50. AND C<I>PARAMS6 NQ " "
  51. DO # CONVERT HOST NODE TO BINARY #
  52. BEGIN
  53. TEMP = C<I>PARAMS6; # ONE DIGIT #
  54. IF TEMP GQ "0"
  55. AND TEMP LQ "9"
  56. THEN # ALLOW ONLY DECIMAL VALUE #
  57. HNODE = HNODE*10 + (TEMP-O"33");
  58. ELSE # ERROR, MUST BE IN DECIMAL #
  59. KRC = 12; # UNKNOWN HOST NODE #
  60. END
  61.  
  62. IF KRC EQ 0
  63. THEN # GOOD HOST NODE ENTERED #
  64. BEGIN # LOCATE NBT FOR INDICATED HOST NODE #
  65. FOUND = FALSE;
  66.  
  67. FOR I=0 STEP NBTFETNO WHILE NOT FOUND
  68. AND I LQ NBTMAXID
  69. DO # SEARCH NBT FOR MATCHING HOST NODE #
  70. BEGIN
  71. IF NBTIUF[I]
  72. AND NBTHN[I] EQ HNODE
  73. THEN # FOUND MATCH #
  74. BEGIN
  75. FOUND = TRUE;
  76.  
  77. IF PARAMS8 # TRACE OPTION IS TURNED ON #
  78. AND NBTFIRST[I+PTBFETI] EQ 0 # NO TRACE BUFFER #
  79. THEN
  80. BEGIN # ALLOCATE A PIP TRACE BUFFER #
  81. IF HRL LS HRLV3
  82. THEN # NAM IN BUFFER REGULATION, NO PIP TRACE ALLOWED #
  83. KRC = 11; # DAYFILE PIP TRACE OPTION NOT AVAILABLE #
  84.  
  85. ELSE # BUFFER OK, ALLOCATE PIP TRACE BUFFER #
  86. BEGIN
  87. MGETS(PTBSIZE,P<DRHDRWD>,FALSE);
  88. BLKID[0] = PTBID; # SET PTB BUFFER ID #
  89. BLKBS[0] = PTBSIZE; # SET PTB BUFFER SIZE #
  90. NEXTPTR[0] = I+PTBFETI; # NBT PTB FET INDEX #
  91. NBTFIRST[I+PTBFETI] = P<DRHDRWD>+BLKHSIZE;
  92. NBTIN[I+PTBFETI] = P<DRHDRWD>+BLKHSIZE;
  93. NBTOUT[I+PTBFETI] = P<DRHDRWD>+BLKHSIZE;
  94. NBTLIMIT[I+PTBFETI] = P<DRHDRWD>+PTBSIZE;
  95. END
  96. END
  97.  
  98. NBTPIPTF[I+PTBFETI] = PARAMS8; # SET SELECTED TRACE OPTION #
  99. END
  100. END # END FOR LOOP #
  101.  
  102. IF NOT FOUND
  103. THEN # INDICATED HOST NODE NOT FOUND #
  104. KRC = 12;
  105. END
  106.  
  107. PARAMS7 = KRC; # SET RETURN CODE #
  108. GOTO RJMAIN;
  109. END # KPTRACE #
  110. TERM
cdc/nos2.source/nam5871/kptrace.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator