You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/profiling/add-user-marks-to-timeline.md
+13-9Lines changed: 13 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -17,19 +17,21 @@ User Marks enable you to track custom events against Visual Studio's Profiler to
17
17
:::image type="content" source="../profiling/media/vs-2022/profiling-user-marks.png" alt-text="Screenshot showing profiling user marks":::
18
18
19
19
> [!NOTE]
20
-
> This feature requires Visual Studio 2022 version 17.11 Preview 2. The feature is available in the Performance Profiler and not while debugging in the Diagnostics Hub.
20
+
> This feature requires Visual Studio 2022 version 17.11 Preview 3. The feature is available in the Performance Profiler and not while debugging in the Diagnostics Hub.
21
21
22
22
## Installation and setup
23
23
24
-
- Add the NuGet Package (.NET)
24
+
You can install support for the feature using either the NuGet package or by adding the correct source files.
25
+
26
+
- Install using the NuGet Package (C#)
25
27
26
28
Download the package, [Microsoft.VisualStudio.DiagnosticsHub.UserMarks](https://www.nuget.org/packages/Microsoft.VisualStudio.DiagnosticsHub.UserMarks).
27
29
28
-
-Add source files (.NET, C++)
30
+
-Install by adding source files (C#, C++)
29
31
30
32
After installing Visual Studio, open the following folder: *[VS installation path]\Common7\IDE\CommonExtensions\Platform\DiagnosticsHub*.
31
33
32
-
For managed C# code, add *UserMarks.cs* and *UserMarksRange.cs* to your project.
34
+
For C# code, add *UserMarks.cs* and *UserMarksRange.cs* to your project.
33
35
34
36
For native C++ code, add *UserMarks.h* to your project.
35
37
@@ -48,19 +50,21 @@ To add the definition in Visual Studio:
48
50
Add the user marks object and emit. The following code shows an example of adding user marks.
49
51
50
52
```csharp
53
+
usingMicrosoft.DiagnosticsHub;
54
+
51
55
// Create a user mark
52
-
varmyUserMark=newUserMark("MyMark");
56
+
varmyUserMark=newUserMarks("MyMark");
53
57
54
58
// Emit the usermark
55
-
myUserMark.EmitMessage("Event happened!");
59
+
myUserMark.Emit("Event happened!");
56
60
57
61
// Emit statically
58
-
UserMark.Emit("Emitting just a message");
62
+
UserMarks.EmitMessage("Emitting just a message");
59
63
60
64
// Emitting a range
61
-
using (varmyRange=newUserMarksRange("MyMethodRange"))
65
+
using (varmyRange=newUserMarkRange("MyMethodRange"))
0 commit comments