Author: sginsberg Date: Sun Aug 24 10:41:13 2008 New Revision: 35598
URL: http://svn.reactos.org/svn/reactos?rev=35598&view=rev Log: - Formatting and comment fixes (no code change)
Modified: trunk/reactos/ntoskrnl/ke/profobj.c
Modified: trunk/reactos/ntoskrnl/ke/profobj.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/profobj.c?rev=3... ============================================================================== --- trunk/reactos/ntoskrnl/ke/profobj.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/profobj.c [iso-8859-1] Sun Aug 24 10:41:13 2008 @@ -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 (alex@relsoft.net) */
/* INCLUDES *****************************************************************/ + #include <ntoskrnl.h> #define NDEBUG #include <internal/debug.h> @@ -68,8 +68,8 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ #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; }