MarkProfile

MarkProfile 메서드는 .vsp 파일에 프로필 표시를 삽입합니다.표시를 삽입하려면 MarkProfile 함수가 포함된 스레드의 프로파일링이 ON이어야 합니다.

PROFILE_COMMAND_STATUS PROFILERAPI MarkProfile( long lMarker );

매개 변수

lMarker

삽입할 마커입니다.마커는 0보다 크거나 같아야 합니다.

속성 값/반환 값

이 함수는 PROFILE_COMMAND_STATUS 열거형을 사용하여 성공 또는 실패를 나타냅니다.반환 값은 다음 중 하나일 수 있습니다.

열거자

설명

MARK_ERROR_MARKER_RESERVED

매개 변수는 0 보다 작거나 같습니다.이러한 값은 예약되어 있습니다.표시와 주석이 기록되지 않습니다.

MARK_ERROR_MODE_NEVER

함수가 호출될 때 프로파일링 모드가 NEVER로 설정되어 있었습니다.표시와 주석이 기록되지 않습니다.

MARK_ERROR_MODE_OFF

함수가 호출될 때 프로파일링 모드가 OFF로 설정되어 있었습니다.표시와 주석이 기록되지 않습니다.

MARK_ERROR_NO_SUPPORT

이 컨텍스트에서는 표시가 지원되지 않습니다.표시와 주석이 기록되지 않습니다.

MARK_ERROR_OUTOFMEMORY

메모리에 이벤트를 기록할 수 없습니다.표시와 주석이 기록되지 않습니다.

MARK_TEXTTOOLONG

문자열이 최대값인 256자를 초과합니다.주석 문자열이 잘리고 표시와 주석이 기록됩니다.

MARK_OK

MARK_OK는 성공을 나타내기 위해 반환됩니다.

설명

MarkProfile 함수가 포함된 스레드가 프로파일링되는 경우 코드가 실행될 때마다 .vsp 파일에 표시 값이 삽입됩니다.MarkProfile은 여러 번 호출할 수 있습니다.

프로필 표시는 범위에서 전역적입니다.예를 들어, 한 스레드에 삽입된 프로필 표시를 사용하여 .vsp 파일의 임의 스레드에 있는 데이터 세그먼트의 시작 또는 끝을 표시할 수 있습니다.

Mark 명령 또는 API 함수(CommentMarkAtProfile, CommentMarkProfile 또는 MarkProfile)로 표시와 주석을 삽입할 때는 표시 프로필 함수가 포함된 스레드의 프로파일링 상태가 ON이어야 합니다.

중요중요

MarkProfile 메서드는 계측 프로파일링에만 사용해야 합니다.

해당 .NET Framework 항목

Microsoft.VisualStudio.Profiler.dll

함수 정보

헤더: VSPerf.h에 선언됨

가져오기 라이브러리: VSPerf.lib

예제

다음 코드에서는 MarkProfile 함수를 보여 줍니다.

void ExerciseMarkProfile()
{
    // Declare and initialize variables to pass to 
    // MarkProfile.  The values of these parameters 
    // are assigned based on the needs of the code;
    // and for the sake of simplicity in this example, 
    // the variables are assigned arbitrary values.
    int markId = 03;

    // Declare enumeration to hold return value of 
    // call to MarkProfile.
    PROFILE_COMMAND_STATUS markResult;

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

    markResult = MarkProfile(markId);

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

#ifdef DEBUG
    OutputDebugString(tchBuffer);
#endif
}

참고 항목

기타 리소스

Visual Studio 프로파일러 API 참조(네이티브)