DataCollection.CommentMarkAtProfile Method (Int64, Int32, String)

 

The CommentMarkAtProfile method inserts a timestamp value, a numeric mark and a comment string in the .vsp file. The timestamp value can be used to synchronize external events. Profiling for the thread containing the CommentMarkAtProfile function must be ON for the mark and comment to be inserted.

Namespace:   Microsoft.VisualStudio.Profiler
Assembly:  Microsoft.VisualStudio.Profiler (in Microsoft.VisualStudio.Profiler.dll)

Syntax

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 Shared Function CommentMarkAtProfile (
    timestamp As Long,
    markId As Integer,
    markText As String
) As MarkOperationResult

Parameters

  • timestamp
    Type: System.Int64

    A 64-bit integer representing a timestamp value.

  • markId
    Type: System.Int32

    The numeric marker to insert. The marker must greater than or equal to 0 (zero).

  • markText
    Type: System.String

    A pointer to the text string to insert. The string must be less than 256 characters including the NULL terminator.

Return Value

Type: Microsoft.VisualStudio.Profiler.MarkOperationResult

The return value, MarkOperationResult, is an enum.

Remarks

The profiling state for the thread that contains the mark profile function must be on when marks and comments are inserted with the Mark command or with API functions (CommentMarkAtProfile, CommentMarkProfile, or MarkProfile). Profile marks are global in scope. For example, a profile mark inserted in one thread can be used to mark the start or end of a data segment in any thread in the .vsp file.

Important

CommentMarkAtProfile methods should be used with instrumentation only.

Examples

The following example illustrates a call to the CommentMarkAtProfile method.

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); 
}

See Also

DataCollection Class
Microsoft.VisualStudio.Profiler Namespace

Return to top