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
69 lines
1.2 KiB
/*++
|
|
|
|
Copyright (c) 2001 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
setlog.c
|
|
|
|
Abstract:
|
|
|
|
This module contains code to enable/disable performance logging. This
|
|
routine is platform specific to optimize cache usage.
|
|
|
|
Author:
|
|
|
|
David N. Cutler (davec) 8-Sep-2001
|
|
|
|
Environment:
|
|
|
|
Kernel mode only.
|
|
|
|
Revision History:
|
|
|
|
--*/
|
|
|
|
#include "perfp.h"
|
|
|
|
VOID
|
|
PerfSetLogging (
|
|
IN PVOID MaskAddress
|
|
)
|
|
|
|
/*++
|
|
|
|
Routine Description:
|
|
|
|
This function is called to enable (MaskAddress is nonNULL) or disable
|
|
(MaskAddress is NULL) performance data collection at context switches.
|
|
|
|
Arguments:
|
|
|
|
MaskAddress - Supplies a pointer to the performance logging mask or
|
|
NULL.
|
|
|
|
Return Value:
|
|
|
|
None.
|
|
|
|
--*/
|
|
|
|
{
|
|
|
|
ULONG Index;
|
|
PKPCR Pcr;
|
|
PKPRCB Prcb;
|
|
|
|
//
|
|
// Store the specified mask address in the stack limit field of the PCR
|
|
// for each processor in the configuation.
|
|
//
|
|
|
|
for (Index = 0; Index < (ULONG)KeNumberProcessors; Index += 1) {
|
|
Prcb = KiProcessorBlock[Index];
|
|
Pcr = CONTAINING_RECORD(Prcb, KPCR, PrcbData);
|
|
Pcr->PerfGlobalGroupMask = MaskAddress;
|
|
}
|
|
|
|
return;
|
|
}
|