Udostępnij za pośrednictwem


Metoda DataCollection.CommentMarkAtProfile —

Metoda CommentMarkAtProfile wstawia wartość sygnatury czasowej, znak numerycznych i ciąg komentarza w pliku .vsp.Wartość znacznika czasu, może zostać wykorzystana do synchronizacji zdarzeń zewnętrznych.Profilowanie wątku zawierająca funkcję CommentMarkAtProfile musi mieć wartość ON dla tego znaku i komentarz do wstawienia.

Przestrzeń nazw:  Microsoft.VisualStudio.Profiler
Zestaw:  Microsoft.VisualStudio.Profiler (w Microsoft.VisualStudio.Profiler.dll)

Składnia

'Deklaracja
Public Shared Function CommentMarkAtProfile ( _
    timestamp As Long, _
    markId As Integer, _
    markText As String _
) As MarkOperationResult
public static MarkOperationResult CommentMarkAtProfile(
    long timestamp,
    int markId,
    string markText
)
public:
static MarkOperationResult CommentMarkAtProfile(
    long long timestamp, 
    int markId, 
    String^ markText
)
static member CommentMarkAtProfile : 
        timestamp:int64 * 
        markId:int * 
        markText:string -> MarkOperationResult
public static function CommentMarkAtProfile(
    timestamp : long, 
    markId : int, 
    markText : String
) : MarkOperationResult

Parametry

  • timestamp
    Typ: Int64

    64-bitową całkowitą reprezentującą wartość sygnatury czasowej.

  • markId
    Typ: Int32

    Znacznik numeryczny do wstawienia.Znacznik musi być większy lub równy 0 (zero).

  • markText
    Typ: String

    Wskaźnik do ciągu tekstowego do wstawienia.Ciąg musi być mniejszy niż 256 znaków, włączając terminator NULL.

Wartość zwracana

Typ: Microsoft.VisualStudio.Profiler.MarkOperationResult
Wartość zwracana, MarkOperationResult, jest typ wyliczeniowy.

Uwagi

Stan profilowania dla wątku, który zawiera funkcję profilu znak musi być na, gdy znaczniki i komentarze są wstawiane za pomocą polecenia znak lub z funkcji API (CommentMarkAtProfile, CommentMarkProfile lub MarkProfile).Znaczniki profilowania mają zakres globalny.Na przykład znacznik profilu wstawione w jednym wątku można oznaczyć początek lub koniec segmentu danych w jednym z wątków w pliku .vsp.

Ważna uwagaWażne

Metody CommentMarkAtProfile należy używać tylko z instrumentacją.

Przykłady

Poniższy przykład ilustruje wywołanie metody CommentMarkAtProfile.

        public void ExerciseCommentMarkAtProfile()
        {
            // Declare and initalize variables to pass to 
            // CommentMarkAtProfile.  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.
            long timestamp = 0x1111;
            int markId = 01;
            string markText = "Exercising CommentMarkAtProfile...";

            // Declare MarkOperationResult Enumerator.  
            // Holds return value from call to CommentMarkAtProfile.
            MarkOperationResult markResult;

            markResult = DataCollection.CommentMarkAtProfile(
                timestamp,
                markId,
                markText);

            // Check result of CommentMarkAtProfile call.
            Console.WriteLine("CommentMarkAtProfile returned {0}",
                markResult); 
        }

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DataCollection Klasa

Przestrzeń nazw Microsoft.VisualStudio.Profiler