mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
- Formatting and comment fixes (no code change)
svn path=/trunk/; revision=35598
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: ntoskrnl/ke/profile.c
|
||||
* COPYRIGHT: GPL - See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Kernel
|
||||
* FILE: ntoskrnl/ke/profobj.c
|
||||
* PURPOSE: Kernel Profiling
|
||||
*
|
||||
* PROGRAMMERS: Alex Ionescu ([email protected])
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
#define NDEBUG
|
||||
#include <internal/debug.h>
|
||||
@@ -68,8 +68,8 @@ KeStartProfile(PKPROFILE Profile,
|
||||
KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
|
||||
|
||||
/* Make sure it's not running */
|
||||
if (!Profile->Started) {
|
||||
|
||||
if (!Profile->Started)
|
||||
{
|
||||
/* Set it as Started */
|
||||
Profile->Buffer = Buffer;
|
||||
Profile->Started = TRUE;
|
||||
@@ -77,13 +77,15 @@ KeStartProfile(PKPROFILE Profile,
|
||||
/* Get the process, if any */
|
||||
ProfileProcess = Profile->Process;
|
||||
|
||||
/* Insert it into the Process List or Global List */
|
||||
if (ProfileProcess) {
|
||||
|
||||
/* Check where we should insert it */
|
||||
if (ProfileProcess)
|
||||
{
|
||||
/* Insert it into the Process List */
|
||||
InsertTailList(&ProfileProcess->ProfileListHead, &Profile->ProfileListEntry);
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Insert it into the Global List */
|
||||
InsertTailList(&KiProfileListHead, &Profile->ProfileListEntry);
|
||||
}
|
||||
|
||||
@@ -91,14 +93,15 @@ KeStartProfile(PKPROFILE Profile,
|
||||
LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry)
|
||||
{
|
||||
/* Check if it's the same as the one being requested now */
|
||||
if (CurrentSource->Source == Profile->Source) {
|
||||
if (CurrentSource->Source == Profile->Source)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* See if the loop found something */
|
||||
if (!CurrentSource) {
|
||||
|
||||
if (!CurrentSource)
|
||||
{
|
||||
/* Nothing found, use our allocated buffer */
|
||||
CurrentSource = SourceBuffer;
|
||||
|
||||
@@ -134,8 +137,8 @@ KeStopProfile(PKPROFILE Profile)
|
||||
KeAcquireSpinLockAtDpcLevel(&KiProfileLock);
|
||||
|
||||
/* Make sure it's running */
|
||||
if (Profile->Started) {
|
||||
|
||||
if (Profile->Started)
|
||||
{
|
||||
/* Remove it from the list and disable */
|
||||
RemoveEntryList(&Profile->ProfileListEntry);
|
||||
Profile->Started = FALSE;
|
||||
@@ -143,7 +146,8 @@ KeStopProfile(PKPROFILE Profile)
|
||||
/* Find the Source Object */
|
||||
LIST_FOR_EACH(CurrentSource, &KiProfileSourceListHead, KPROFILE_SOURCE_OBJECT, ListEntry)
|
||||
{
|
||||
if (CurrentSource->Source == Profile->Source) {
|
||||
if (CurrentSource->Source == Profile->Source)
|
||||
{
|
||||
/* Remove it */
|
||||
RemoveEntryList(&CurrentSource->ListEntry);
|
||||
break;
|
||||
@@ -171,13 +175,13 @@ STDCALL
|
||||
KeQueryIntervalProfile(KPROFILE_SOURCE ProfileSource)
|
||||
{
|
||||
/* Check if this is the timer profile */
|
||||
if (ProfileSource == ProfileTime) {
|
||||
|
||||
if (ProfileSource == ProfileTime)
|
||||
{
|
||||
/* Return the good old 100ns sampling interval */
|
||||
return KiProfileTimeInterval;
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Request it from HAL. FIXME: What structure is used? */
|
||||
HalQuerySystemInformation(HalProfileSourceInformation,
|
||||
sizeof(NULL),
|
||||
@@ -194,18 +198,17 @@ KeSetIntervalProfile(KPROFILE_SOURCE ProfileSource,
|
||||
ULONG Interval)
|
||||
{
|
||||
/* Check if this is the timer profile */
|
||||
if (ProfileSource == ProfileTime) {
|
||||
|
||||
if (ProfileSource == ProfileTime)
|
||||
{
|
||||
/* Set the good old 100ns sampling interval */
|
||||
KiProfileTimeInterval = Interval;
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Set it with HAL. FIXME: What structure is used? */
|
||||
HalSetSystemInformation(HalProfileSourceInformation,
|
||||
sizeof(NULL),
|
||||
NULL);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,8 +239,8 @@ KiParseProfileList(IN PKTRAP_FRAME TrapFrame,
|
||||
#ifdef _M_IX86
|
||||
if ((Profile->Source != Source) ||
|
||||
(TrapFrame->Eip < (ULONG_PTR)Profile->RangeBase) ||
|
||||
(TrapFrame->Eip > (ULONG_PTR)Profile->RangeLimit)) {
|
||||
|
||||
(TrapFrame->Eip > (ULONG_PTR)Profile->RangeLimit))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user