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.

69 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. setlog.c
  5. Abstract:
  6. This module contains code to enable/disable performance logging. This
  7. routine is platform specific to optimize cache usage.
  8. Author:
  9. David N. Cutler (davec) 8-Sep-2001
  10. Environment:
  11. Kernel mode only.
  12. Revision History:
  13. --*/
  14. #include "perfp.h"
  15. VOID
  16. PerfSetLogging (
  17. IN PVOID MaskAddress
  18. )
  19. /*++
  20. Routine Description:
  21. This function is called to enable (MaskAddress is nonNULL) or disable
  22. (MaskAddress is NULL) performance data collection at context switches.
  23. Arguments:
  24. MaskAddress - Supplies a pointer to the performance logging mask or
  25. NULL.
  26. Return Value:
  27. None.
  28. --*/
  29. {
  30. ULONG Index;
  31. PKPCR Pcr;
  32. PKPRCB Prcb;
  33. //
  34. // Store the specified mask address in the stack limit field of the PCR
  35. // for each processor in the configuation.
  36. //
  37. for (Index = 0; Index < (ULONG)KeNumberProcessors; Index += 1) {
  38. Prcb = KiProcessorBlock[Index];
  39. Pcr = CONTAINING_RECORD(Prcb, KPCR, Prcb);
  40. Pcr->PerfGlobalGroupMask = MaskAddress;
  41. }
  42. return;
  43. }