DataCollection.ResumeProfile 메서드

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

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

구문

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

매개 변수

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

반환 값

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

설명

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이어야 합니다.

예제

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

        void ExerciseResumeProfile()
        {
            // 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. 

            // Variables used to print output.
            HRESULT hResult;
            TCHAR tchBuffer[256];

            // Declare enumeration to hold result of call to ResumeProfile
            PROFILE_COMMAND_STATUS profileResult;

            profileResult = ResumeProfile(
                PROFILE_GLOBALLEVEL,
                PROFILE_CURRENTID);

            // Format and print result.
            LPCTSTR pszFormat = TEXT("%s %d.\0");
            TCHAR* pszTxt = TEXT("ResumeProfile returned");
            hResult = StringCchPrintf(tchBuffer, 256, pszFormat, 
                pszTxt, profileResult);
            }

.NET Framework 보안

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

참고 항목

참조

DataCollection 클래스

Microsoft.VisualStudio.Profiler 네임스페이스