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.

706 lines
22 KiB

  1. /*++
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. LookAsid.c
  5. Abstract:
  6. WinDbg Extension Api
  7. Author:
  8. Gary Kimura [GaryKi] 22-Feb-96
  9. Environment:
  10. User Mode.
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. //
  16. // A quick macro to dump a lookaside list given its variable name
  17. //
  18. #define Dump(S,R) { ULONG64 _a; \
  19. if( (_a = GetExpression( S )) == 0) { \
  20. dprintf("Failed GetExpression(\"%s\")\n", S); \
  21. } else if ((R)) { \
  22. ResetLookaside( _a, S ); \
  23. } else { \
  24. DumpLookaside( _a, S ); \
  25. } \
  26. }
  27. #define GetAddressFromName(A,N) { \
  28. if (((A) = GetExpression( (N) )) == 0) { \
  29. dprintf("Failed GetExpression(\"%s\")\n", N); \
  30. return; \
  31. } \
  32. }
  33. #define ReadAtAddress(A,V,S) { ULONG _r; \
  34. if (!ReadMemory((A), &(V), (S), &_r ) || (_r < (S))) { \
  35. dprintf("Can't Read Memory at %08p\n", (A)); \
  36. return; \
  37. } \
  38. }
  39. #define WriteAtAddress(A,V,S) { ULONG _r; \
  40. if (!WriteMemory( (A), &(V), (S), &_r ) || (_r < (S))) { \
  41. dprintf("Can't Write Memory at %08p\n", (A)); \
  42. return; \
  43. } \
  44. }
  45. ULONG TotalPagedPotential;
  46. ULONG TotalPagedUsed;
  47. ULONG TotalNPagedPotential;
  48. ULONG TotalNPagedUsed;
  49. VOID
  50. DumpLookaside (
  51. IN ULONG64 Address,
  52. IN PUCHAR Name
  53. )
  54. /*++
  55. Routine Description:
  56. Dump a specific lookaside list.
  57. Arguments:
  58. Address - Gives the address of the lookaside list to dump
  59. Name - Gives an optional name of to print next to the lookaside list
  60. Return Value:
  61. None
  62. --*/
  63. {
  64. ULONG Results;
  65. ULONG AllocationHitRate;
  66. ULONG FreeHitRate;
  67. UCHAR Str[64];
  68. ULONG TotalAllocates, Depth, TotalFrees, Type, Size, Tag;
  69. //
  70. // Read the lookaside list from memory
  71. //
  72. if (GetFieldValue( Address, "NPAGED_LOOKASIDE_LIST",
  73. "L.TotalAllocates", TotalAllocates)) {
  74. dprintf("Can't read lookaside \"%s\" at 0x%08p\n", Name, Address);
  75. }
  76. //
  77. // Dump it out. Note that for purposes of dumping a paged and nonpaged lookaside are
  78. // the same. I.e., the fields we're interested are at identical offsets
  79. //
  80. InitTypeRead(Address, NPAGED_LOOKASIDE_LIST);
  81. //
  82. // Compute the hit rate
  83. //
  84. TotalFrees = (ULONG) ReadField(L.TotalFrees);
  85. AllocationHitRate = (TotalAllocates > 0 ? (((TotalAllocates - (ULONG) ReadField(L.AllocateMisses))*100)/TotalAllocates) : 0);
  86. FreeHitRate = (TotalFrees > 0 ? (((TotalFrees - (ULONG) ReadField(L.FreeMisses))*100)/TotalFrees) : 0);
  87. //
  88. // Decide what type of pool is behind the lookaside list
  89. //
  90. Type = (ULONG) ReadField(L.Type);
  91. switch (Type & 0x7) {
  92. case NonPagedPool: sprintf(Str, "NonPagedPool"); break;
  93. case PagedPool: sprintf(Str, "PagedPool"); break;
  94. case NonPagedPoolMustSucceed: sprintf(Str, "NonPagedPoolMustSucceed"); break;
  95. case DontUseThisType: sprintf(Str, "DontUseThisType"); break;
  96. case NonPagedPoolCacheAligned: sprintf(Str, "NonPagedPoolCacheAligned"); break;
  97. case PagedPoolCacheAligned: sprintf(Str, "PagedPoolCacheAligned"); break;
  98. case NonPagedPoolCacheAlignedMustS: sprintf(Str, "NonPagedPoolCacheAlignedMustS"); break;
  99. default: sprintf(Str, "Unknown pool type"); break;
  100. }
  101. //
  102. // Add to the total usage and potential based on pool type
  103. //
  104. Depth = (ULONG) ReadField(L.Depth);
  105. Size = (ULONG) ReadField(L.Size);
  106. if (Type & 0x1) {
  107. TotalPagedUsed += (ULONG) ReadField(L.ListHead.Depth) * Size;
  108. TotalPagedPotential += Depth * Size;
  109. } else {
  110. TotalNPagedUsed += (ULONG) ReadField(ListHead.Depth) * Size;
  111. TotalNPagedPotential += Depth * Size;
  112. }
  113. //
  114. // Now print everything
  115. //
  116. Tag = (ULONG) ReadField(L.Tag);
  117. dprintf("\nLookaside \"%s\" @ %08p \"%c%c%c%c\"\n", Name, Address, ((PUCHAR)&Tag)[0],
  118. ((PUCHAR)&Tag)[1],
  119. ((PUCHAR)&Tag)[2],
  120. ((PUCHAR)&Tag)[3]);
  121. dprintf(" Type = %04x %s", Type, Str);
  122. if (Type & POOL_QUOTA_FAIL_INSTEAD_OF_RAISE) { dprintf(" QuotaFailInsteadOrRaise"); }
  123. if (Type & POOL_RAISE_IF_ALLOCATION_FAILURE) { dprintf(" RaiseIfAllocationFailure"); }
  124. dprintf("\n");
  125. dprintf(" Current Depth = %8ld Max Depth = %8ld\n", (ULONG) ReadField(L.ListHead.Depth), Depth);
  126. dprintf(" Size = %8ld Max Alloc = %8ld\n", Size, Depth * Size);
  127. dprintf(" AllocateMisses = %8ld FreeMisses = %8ld\n", (ULONG) ReadField(L.AllocateMisses), (ULONG) ReadField(L.FreeMisses));
  128. dprintf(" TotalAllocates = %8ld TotalFrees = %8ld\n", TotalAllocates, TotalFrees);
  129. dprintf(" Hit Rate = %3d%% Hit Rate = %3d%%\n", AllocationHitRate, FreeHitRate);
  130. return;
  131. }
  132. VOID
  133. ResetLookaside (
  134. IN ULONG64 Address,
  135. IN PUCHAR Name
  136. )
  137. /*++
  138. Routine Description:
  139. Resets the counters in a specific lookaside list.
  140. Arguments:
  141. Address - Gives the address of the lookaside list to reset
  142. Name - Gives an optional name of to print in case of errors
  143. Return Value:
  144. None
  145. --*/
  146. {
  147. // NPAGED_LOOKASIDE_LIST Lookaside;
  148. ULONG Results, Off=0, Zero=0;
  149. //
  150. // Get offset
  151. //
  152. GetFieldOffset("NPAGED_LOOKASIDE_LIST", "L.TotalAllocates", &Off);
  153. //
  154. // Zero out the counters
  155. //
  156. if (!WriteMemory( Address + Off, &Zero, sizeof(ULONG), &Results ) ||
  157. (Results < sizeof(ULONG))) {
  158. dprintf("Can't write lookaside \"%s\" at 0x%08p\n", Name, Address);
  159. }
  160. GetFieldOffset("NPAGED_LOOKASIDE_LIST", "L.AllocateMisses", &Off);
  161. if (!WriteMemory( Address + Off, &Zero, sizeof(ULONG), &Results ) ||
  162. (Results < sizeof(ULONG))) {
  163. dprintf("Can't write lookaside \"%s\" at 0x%08p\n", Name, Address);
  164. }
  165. GetFieldOffset("NPAGED_LOOKASIDE_LIST", "L.TotalFrees", &Off);
  166. if (!WriteMemory( Address + Off, &Zero, sizeof(ULONG), &Results ) ||
  167. (Results < sizeof(ULONG))) {
  168. dprintf("Can't write lookaside \"%s\" at 0x%08p\n", Name, Address);
  169. }
  170. GetFieldOffset("NPAGED_LOOKASIDE_LIST", "L.FreeMisses", &Off);
  171. if (!WriteMemory( Address + Off, &Zero, sizeof(ULONG), &Results ) ||
  172. (Results < sizeof(ULONG))) {
  173. dprintf("Can't write lookaside \"%s\" at 0x%08p\n", Name, Address);
  174. }
  175. return;
  176. }
  177. VOID
  178. SetDepthLookaside (
  179. IN ULONG64 Address,
  180. IN PUCHAR Name,
  181. IN ULONG Depth
  182. )
  183. /*++
  184. Routine Description:
  185. Set the depth of a specific lookaside list.
  186. Arguments:
  187. Address - Gives the address of the lookaside list to reset
  188. Name - Gives an optional name of to print in case of errors
  189. Depth - Supplies the depth to set the lookaside list to
  190. Return Value:
  191. None
  192. --*/
  193. {
  194. ULONG Results, Off=0;
  195. //
  196. // Get offset
  197. //
  198. GetFieldOffset("NPAGED_LOOKASIDE_LIST", "L.Depth", &Off);
  199. //
  200. // Set the depth
  201. //
  202. if (!WriteMemory( Address + Off, &Depth, sizeof(USHORT), &Results ) ||
  203. (Results < sizeof(USHORT))) {
  204. dprintf("Can't write lookaside \"%s\" at 0x%08p\n", Name, Address);
  205. }
  206. return;
  207. }
  208. DECLARE_API( lookaside )
  209. /*++
  210. Routine Description:
  211. Dump lookaside lists
  212. Arguments:
  213. arg - [Address] [options]
  214. Return Value:
  215. None
  216. --*/
  217. {
  218. ULONG64 LookasideToDump;
  219. ULONG Options;
  220. ULONG Depth;
  221. //
  222. // If the caller specified an address then that the the lookaside list we dump
  223. //
  224. LookasideToDump = 0;
  225. Options = 0;
  226. Depth = 0;
  227. if (GetExpressionEx(args,&LookasideToDump, &args)) {
  228. if (!sscanf(args, "%lx %lx",&Options, &Depth)) {
  229. Options = 0;
  230. Depth = 0;
  231. }
  232. }
  233. if (LookasideToDump != 0) {
  234. if (Options == 0) {
  235. DumpLookaside( LookasideToDump, "");
  236. } else if (Options == 1) {
  237. ResetLookaside( LookasideToDump, "");
  238. } else if (Options == 2) {
  239. SetDepthLookaside( LookasideToDump, "", Depth );
  240. }
  241. return E_INVALIDARG;
  242. }
  243. //
  244. // Reset the counters we use to sum up the potential pool usage
  245. //
  246. TotalPagedPotential = 0;
  247. TotalPagedUsed = 0;
  248. TotalNPagedPotential = 0;
  249. TotalNPagedUsed = 0;
  250. //
  251. // Otherwise we'll dump a built in set of lookaside lists
  252. //
  253. Dump("nt!CcTwilightLookasideList", Options == 1);
  254. Dump("nt!IopSmallIrpLookasideList", Options == 1);
  255. Dump("nt!IopLargeIrpLookasideList", Options == 1);
  256. Dump("nt!IopMdlLookasideList", Options == 1);
  257. Dump("nt!FsRtlFastMutexLookasideList", Options == 1);
  258. Dump("nt!TunnelLookasideList", Options == 1);
  259. Dump("nt!ObpCreateInfoLookasideList", Options == 1);
  260. Dump("nt!ObpNameBufferLookasideList", Options == 1);
  261. Dump("afd!AfdWorkQueueLookasideList", Options == 1);
  262. Dump("Fastfat!FatIrpContextLookasideList", Options == 1);
  263. Dump("Ntfs!NtfsIoContextLookasideList", Options == 1);
  264. Dump("Ntfs!NtfsIrpContextLookasideList", Options == 1);
  265. Dump("Ntfs!NtfsKeventLookasideList", Options == 1);
  266. Dump("Ntfs!NtfsScbNonpagedLookasideList", Options == 1);
  267. Dump("Ntfs!NtfsScbSnapshotLookasideList", Options == 1);
  268. Dump("Ntfs!NtfsCcbLookasideList", Options == 1);
  269. Dump("Ntfs!NtfsCcbDataLookasideList", Options == 1);
  270. Dump("Ntfs!NtfsDeallocatedRecordsLookasideList", Options == 1);
  271. Dump("Ntfs!NtfsFcbDataLookasideList", Options == 1);
  272. Dump("Ntfs!NtfsFcbIndexLookasideList", Options == 1);
  273. Dump("Ntfs!NtfsIndexContextLookasideList", Options == 1);
  274. Dump("Ntfs!NtfsLcbLookasideList", Options == 1);
  275. Dump("Ntfs!NtfsNukemLookasideList", Options == 1);
  276. Dump("Ntfs!NtfsScbDataLookasideList", Options == 1);
  277. if (Options != 1) {
  278. dprintf("\n");
  279. dprintf("Total NonPaged currently allocated for above lists = %8ld\n", TotalNPagedUsed);
  280. dprintf("Total NonPaged potential for above lists = %8ld\n", TotalNPagedPotential);
  281. dprintf("Total Paged currently allocated for above lists = %8ld\n", TotalPagedUsed);
  282. dprintf("Total Paged potential for above lists = %8ld\n", TotalPagedPotential);
  283. TotalPagedPotential = 0;
  284. TotalPagedUsed = 0;
  285. TotalNPagedPotential = 0;
  286. TotalNPagedUsed = 0;
  287. }
  288. /*
  289. //
  290. // Now dump out the small pool lookaside lists or zero their
  291. // counters.
  292. //
  293. if (Options == 1) {
  294. ULONG Address;
  295. ULONG Results;
  296. ULONG i;
  297. //
  298. // Get the location of the nonpaged list
  299. //
  300. GetAddressFromName( Address, "ExpSmallNPagedPoolLookasideLists" );
  301. //
  302. // Read in each list, zero out it counters and write it back out
  303. //
  304. for ( i = 0; i < POOL_SMALL_LISTS; i += 1) {
  305. ULONG Location;
  306. SMALL_POOL_LOOKASIDE LookasideList;
  307. Location = Address + i * sizeof(SMALL_POOL_LOOKASIDE);
  308. ReadAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  309. LookasideList.TotalAllocates = 0;
  310. LookasideList.AllocateHits = 0;
  311. LookasideList.TotalFrees = 0;
  312. LookasideList.FreeHits = 0;
  313. WriteAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  314. }
  315. //
  316. // Get the location of the paged list
  317. //
  318. #ifndef TARGET_PPC
  319. GetAddressFromName( Address, "ExpSmallPagedPoolLookasideLists" );
  320. //
  321. // Read in each list, zero out it counters and write it back out
  322. //
  323. for ( i = 0; i < POOL_SMALL_LISTS; i += 1) {
  324. ULONG Location;
  325. SMALL_POOL_LOOKASIDE LookasideList;
  326. Location = Address + i * sizeof(SMALL_POOL_LOOKASIDE);
  327. ReadAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  328. LookasideList.TotalAllocates = 0;
  329. LookasideList.AllocateHits = 0;
  330. LookasideList.TotalFrees = 0;
  331. LookasideList.FreeHits = 0;
  332. WriteAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  333. }
  334. #endif // TARGET_PPC
  335. } else {
  336. ULONG Address;
  337. ULONG Results;
  338. ULONG i;
  339. //
  340. // Get the location of the nonpaged list
  341. //
  342. GetAddressFromName( Address, "ExpSmallNPagedPoolLookasideLists" );
  343. dprintf("\nExpSmallNPagedLookasideLists @ %08lx\n", Address);
  344. //
  345. // Read in each list and dump it out
  346. //
  347. for ( i = 0; i < POOL_SMALL_LISTS; i += 1) {
  348. ULONG Location;
  349. SMALL_POOL_LOOKASIDE LookasideList;
  350. ULONG AllocationHitRate;
  351. ULONG FreeHitRate;
  352. Location = Address + i * sizeof(SMALL_POOL_LOOKASIDE);
  353. ReadAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  354. TotalNPagedUsed += LookasideList.SListHead.Depth * (i+1)*32;
  355. TotalNPagedPotential += LookasideList.Depth * (i+1)*32;
  356. AllocationHitRate = (LookasideList.TotalAllocates > 0 ? ((LookasideList.AllocateHits*100)/LookasideList.TotalAllocates) : 0);
  357. FreeHitRate = (LookasideList.TotalFrees > 0 ? ((LookasideList.FreeHits*100)/LookasideList.TotalFrees) : 0);
  358. dprintf("\n Nonpaged %d bytes @ %08lx\n", (i+1)*32, Location);
  359. dprintf(" Current Depth = %8ld Max Depth = %8ld\n", LookasideList.SListHead.Depth, LookasideList.Depth);
  360. dprintf(" Size = %8ld Max Alloc = %8ld\n", (i+1)*32, LookasideList.Depth * (i+1)*32);
  361. dprintf(" AllocateHits = %8ld FreeHits = %8ld\n", LookasideList.AllocateHits, LookasideList.FreeHits);
  362. dprintf(" TotalAllocates = %8ld TotalFrees = %8ld\n", LookasideList.TotalAllocates, LookasideList.TotalFrees);
  363. dprintf(" Hit Rate = %3d%% Hit Rate = %3d%%\n", AllocationHitRate, FreeHitRate);
  364. }
  365. //
  366. // Get the location of the paged list
  367. //
  368. #ifndef TARGET_PPC
  369. GetAddressFromName( Address, "ExpSmallPagedPoolLookasideLists" );
  370. dprintf("\nExpSmallPagedLookasideLists @ %08lx\n", Address);
  371. //
  372. // Read in each list and dump it out
  373. //
  374. for ( i = 0; i < POOL_SMALL_LISTS; i += 1) {
  375. ULONG Location;
  376. SMALL_POOL_LOOKASIDE LookasideList;
  377. ULONG AllocationHitRate;
  378. ULONG FreeHitRate;
  379. Location = Address + i * sizeof(SMALL_POOL_LOOKASIDE);
  380. ReadAtAddress( Location, LookasideList, sizeof(SMALL_POOL_LOOKASIDE) );
  381. TotalPagedUsed += LookasideList.SListHead.Depth * (i+1)*32;
  382. TotalPagedPotential += LookasideList.Depth * (i+1)*32;
  383. AllocationHitRate = (LookasideList.TotalAllocates > 0 ? ((LookasideList.AllocateHits*100)/LookasideList.TotalAllocates) : 0);
  384. FreeHitRate = (LookasideList.TotalFrees > 0 ? ((LookasideList.FreeHits*100)/LookasideList.TotalFrees) : 0);
  385. dprintf("\n Paged %d bytes @ %08lx\n", (i+1)*32, Location);
  386. dprintf(" Current Depth = %8ld Max Depth = %8ld\n", LookasideList.SListHead.Depth, LookasideList.Depth);
  387. dprintf(" Size = %8ld Max Alloc = %8ld\n", (i+1)*32, LookasideList.Depth * (i+1)*32);
  388. dprintf(" AllocateHits = %8ld FreeHits = %8ld\n", LookasideList.AllocateHits, LookasideList.FreeHits);
  389. dprintf(" TotalAllocates = %8ld TotalFrees = %8ld\n", LookasideList.TotalAllocates, LookasideList.TotalFrees);
  390. dprintf(" Hit Rate = %3d%% Hit Rate = %3d%%\n", AllocationHitRate, FreeHitRate);
  391. }
  392. #endif // TARGET_PPC
  393. dprintf("\n");
  394. dprintf("Total NonPaged currently allocated for pool lists = %8ld\n", TotalNPagedUsed);
  395. dprintf("Total NonPaged potential for pool lists = %8ld\n", TotalNPagedPotential);
  396. dprintf("Total Paged currently allocated for pool lists = %8ld\n", TotalPagedUsed);
  397. dprintf("Total Paged potential for pool lists = %8ld\n", TotalPagedPotential);
  398. }
  399. {
  400. ULONG Address;
  401. ULONG Results;
  402. ULONG i;
  403. ULONG j;
  404. UCHAR KeNumberProcessors;
  405. ULONG KiProcessorBlock[32];
  406. //
  407. // First find out how many processors there are and then read in the
  408. // array of processor block pointers
  409. //
  410. GetAddressFromName( Address, "KeNumberProcessors" );
  411. ReadAtAddress( Address, Address, sizeof(ULONG) );
  412. //
  413. // For some bizarre reason sometimes we do a indirect read to get the
  414. // number of processors and at other times it is more direct
  415. //
  416. if (Address <= 32) {
  417. KeNumberProcessors = (UCHAR)Address;
  418. } else {
  419. ReadAtAddress( Address, KeNumberProcessors, sizeof(UCHAR) );
  420. }
  421. GetAddressFromName( Address, "KiProcessorBlock" );
  422. ReadAtAddress( Address, KiProcessorBlock, sizeof(ULONG)*KeNumberProcessors );
  423. //
  424. // Check if we are to reset the counters
  425. //
  426. if (Options == 1) {
  427. KPRCB Kprcb;
  428. for (i = 0; i < KeNumberProcessors; i += 1) {
  429. ReadAtAddress( KiProcessorBlock[i], Kprcb, sizeof(KPRCB) );
  430. for (j = 0; j < POOL_SMALL_LISTS; j += 1) {
  431. Kprcb.SmallNPagedPoolLookasideLists[j].AllocateHits = 0;
  432. Kprcb.SmallNPagedPoolLookasideLists[j].TotalAllocates = 0;
  433. #ifndef TARGET_PPC
  434. Kprcb.SmallPagedPoolLookasideLists[j].AllocateHits = 0;
  435. Kprcb.SmallPagedPoolLookasideLists[j].TotalAllocates = 0;
  436. #endif // TARGET_PPC
  437. }
  438. WriteAtAddress( KiProcessorBlock[i], Kprcb, sizeof(KPRCB) );
  439. }
  440. } else {
  441. KPRCB Kprcb[32];
  442. ULONG Addr[32];
  443. ULONG Depth[32];
  444. ULONG Hits[32];
  445. ULONG Total[32];
  446. ULONG HitRate[32];
  447. ULONG MaxAlloc[32];
  448. dprintf("\nSmall Pool Lookaside lists\n\n");
  449. dprintf("Kprcb =");
  450. for (i = 0; i < KeNumberProcessors; i += 1) {
  451. dprintf(" %08lx ", KiProcessorBlock[i]);
  452. ReadAtAddress( KiProcessorBlock[i], Kprcb[i], sizeof(KPRCB) );
  453. }
  454. dprintf("\n");
  455. for ( j = 0; j < POOL_SMALL_LISTS; j += 1) {
  456. dprintf("\nNonpaged %d bytes\n", (j+1)*32);
  457. for (i = 0; i < KeNumberProcessors; i += 1) {
  458. Addr[i] = KiProcessorBlock[i] + FIELD_OFFSET(KPRCB, SmallNPagedPoolLookasideLists[j]);
  459. Depth[i] = Kprcb[i].SmallNPagedPoolLookasideLists[j].Depth;
  460. Hits[i] = Kprcb[i].SmallNPagedPoolLookasideLists[j].AllocateHits;
  461. Total[i] = Kprcb[i].SmallNPagedPoolLookasideLists[j].TotalAllocates;
  462. HitRate[i] = (Total[i] > 0 ? ((Hits[i]*100)/Total[i]) : 0);
  463. MaxAlloc[i] = ((j+1)*32) * Depth[i];
  464. }
  465. dprintf("Address ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %08lx ", Addr[i]); } dprintf("\n");
  466. dprintf("Depth ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Depth[i]); } dprintf("\n");
  467. dprintf("MaxAlloc ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", MaxAlloc[i]); } dprintf("\n");
  468. dprintf("Hits ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Hits[i]); } dprintf("\n");
  469. dprintf("Total ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Total[i]); } dprintf("\n");
  470. dprintf("HitRate ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d%%", HitRate[i]); } dprintf("\n");
  471. }
  472. #ifndef TARGET_PPC
  473. for ( j = 0; j < POOL_SMALL_LISTS; j += 1) {
  474. dprintf("\nPaged %d bytes\n", (j+1)*32);
  475. for (i = 0; i < KeNumberProcessors; i += 1) {
  476. Addr[i] = KiProcessorBlock[i] + FIELD_OFFSET(KPRCB, SmallPagedPoolLookasideLists[j]);
  477. Depth[i] = Kprcb[i].SmallPagedPoolLookasideLists[j].Depth;
  478. Hits[i] = Kprcb[i].SmallPagedPoolLookasideLists[j].AllocateHits;
  479. Total[i] = Kprcb[i].SmallPagedPoolLookasideLists[j].TotalAllocates;
  480. HitRate[i] = (Total[i] > 0 ? ((Hits[i]*100)/Total[i]) : 0);
  481. MaxAlloc[i] = ((j+1)*32) * Depth[i];
  482. }
  483. dprintf("Address ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %08lx ", Addr[i]); } dprintf("\n");
  484. dprintf("Depth ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Depth[i]); } dprintf("\n");
  485. dprintf("MaxAlloc ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", MaxAlloc[i]); } dprintf("\n");
  486. dprintf("Hits ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Hits[i]); } dprintf("\n");
  487. dprintf("Total ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d ", Total[i]); } dprintf("\n");
  488. dprintf("HitRate ="); for (i = 0; i < KeNumberProcessors; i += 1) { dprintf(" %8d%%", HitRate[i]); } dprintf("\n");
  489. }
  490. #endif // TARGET_PPC
  491. }
  492. }
  493. */
  494. return S_OK;
  495. }