DataCollection.SuspendProfile 메서드

SuspendProfile 메서드를 사용하면 지정한 프로파일링 수준의 Suspend/Resume 카운터가 증가합니다.

네임스페이스:  Microsoft.VisualStudio.Profiler
어셈블리:  Microsoft.VisualStudio.Profiler(Microsoft.VisualStudio.Profiler.dll)

구문

‘선언
Public Shared Function SuspendProfile ( _
    profileLevel As ProfileLevel, _
    elementId As UInteger _
) As ProfileOperationResult
public static ProfileOperationResult SuspendProfile(
    ProfileLevel profileLevel,
    uint elementId
)
public:
static ProfileOperationResult SuspendProfile(
    ProfileLevel profileLevel, 
    unsigned int elementId
)
static member SuspendProfile : 
        profileLevel:ProfileLevel * 
        elementId:uint32 -> ProfileOperationResult 
public static function SuspendProfile(
    profileLevel : ProfileLevel, 
    elementId : uint
) : ProfileOperationResult

매개 변수

  • elementId
    형식: System.UInt32
    시스템에 의해 생성된 프로세스 또는 스레드 식별자입니다.

반환 값

형식: Microsoft.VisualStudio.Profiler.ProfileOperationResult
반환 값 ProfileOperationResult는 열거형입니다.

설명

SuspendProfile 및 ResumeProfile은 프로파일링 수준에 대한 Suspend/Resume 카운터를 제어합니다.Suspend/Resume 카운터는 일반적으로 표준 프로파일러 API 데이터 제어 함수를 재정의하는 데 사용됩니다.

Suspend/Resume 카운터의 초기 값은 0입니다.SuspendProfile을 호출할 때마다 Suspend/Resume 카운트가 1씩 증가하고 ResumeProfile을 호출할 때마다 1씩 감소합니다.

Suspend/Resume 카운터가 0보다 큰 경우, 해당 수준의 Suspend/Resume 상태는 OFF입니다.카운트가 0보다 작거나 같은 경우, Suspend/Resume 상태는 ON입니다.

Start/Stop 상태와 Suspend/Resume 상태가 모두 ON인 경우, 해당 수준의 프로파일링 상태는 ON입니다.프로파일링될 스레드의 경우, 해당 스레드에 대한 전역, 프로세스, 스레드 수준 상태는 모두 ON이어야 합니다.

예제

다음 예제에서는 SuspendProfile 메서드를 보여 줍니다.이 예제에서는 DataCollection.CurrentId 속성으로 식별되는 프로세스나 스레드를 대상으로 이전에 StartProfile이 호출되었다고 가정합니다.

        public void ExerciseSuspendProfile()
        {
            // The initial value of the Suspend/Resume counter is 0.
            // Each call to SuspendProfile adds 1 to the 
            // Suspend/Resume count; each call 
            // to ResumeProfile subtracts 1. 
                        
            // Declare enumeration to hold result of call 
            // to SuspendProfile
            ProfileOperationResult profileResult;

            profileResult = DataCollection.SuspendProfile(
                ProfileLevel.Global,
                DataCollection.CurrentId);

            Console.WriteLine("SuspendProfile returned {0}", profileResult);
         }

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

DataCollection 클래스

Microsoft.VisualStudio.Profiler 네임스페이스