Commit ce67cef
authored
[Linux][EventPipe][UserEvents] Add user events eventpipe support (#115265)
* [DiagnosticServer] Refactor and Cleanup
Visual reorder of Diagnostics enum structs
Fix a couple naming typos
Spaces to tabs consistency
* [EventPipe] Add User_events structs
* [EventPipe] Add User_events eventpipe session
* [DiagnosticServer] Revamp Provider Config deserialization
To support the new user_events-based eventpipe session, add
a more modular and flexible EventPipeProviderConfiguration deserializer.
* [DiagnosticServer] Deprecate old deserializer
* [DiagnosticServer] Add CollectTracing5 command parser
* [DiagnosticServer] Deserialize file_descriptor from IPC Stream
The user_events_data file is required to register user_events tracepoints.
Require profilers to pass over the corresponding file descriptor with
SCM_RIGHTS in order to initialize the user_events EventPipe session.
* [EventPipe] Use Event_filter to set EventPipeEvent enabled mask
* [UserEvents] Register and unregister tracepoints
* [UserEvents] Write events to tracepoints
* Fixup CI build failures
* Cleanup missed CI build failures
* Address feedback
Fix parameter order
Use umap_ptr_uint32 macros for EventFilter
Remove tracepoint_name const qualifier
Prevent buffer overflow in tracepoint_format copying
Skip duplicate tracepoint config fini
Null out tracepoint after transferring ownership
Use dn_vector_ptr_t for provider configurations
Wrap entire functions under macro checks
Use int for file descriptor
Fix formatting
Add checks for ep_session_disable session specific logic
Use dn_vector_ptr for the tracepoints sets
Use switch case for event writing
Scope tracepoint registration to sessions
Remove ep prefix from static functions
Move includes to source
Define max tracepoint format length
* Address Feedback const EventPipeProviderConfiguration
Adhere to the standard where EventPipeProviderConfiguration is
read-only. Create event filter and tracepoint config duplication helpers
to give the SessionProvider its own copy.
* Address feedback Add string deserializer helper
* Revert provider_configs to vector of structs
* Dynamically allocate tracepoint format
* Fix CI Build failures
* Split ProviderConfiguration structs
* Reuse EventPipeSessionTypes
* Constrain tracepoint_config modification to session provider
* Fixup compilation error
* Move metadata into extensions portion
* Free default tracepoint format
* Address feedback
Use ep_provider_config_fini helper
Add session_type deserializing helper
Fix tabbing
Add dn_umap_uint32_ptr macro
Handle tracepoint registration failure
Change ep_session_write_event order
Use dn_list foreach
Add size check to extension activity ids construction
Add ep_rt_utf8_string_printf_alloc helper
* Address feedback
Refactor tracepoint writing logic
Use local constants
Rename provider config parser
* Consistently use addresses of struct fields
* Fix typo
* Address feedback
Make struct data ownership consistent by removing const
Make external source files use getters and internal source files
directly access data.
Add session_provider_tracepoint_free
Disallow null tracepoint_name in tracepoint_format_alloc
Remove redundant checks
Cleanup ep_rt_utf8_string_printf_alloc
Cleanup writing to tracepoint
* Address feedback
Update ep_provider_config_init/fini callsites
Make resource cleanup logic consistent
Account for early exit memory leaks
Various cleanup
* Address Feedback
Fix eventpipe_collect_tracing_command_free_tracepoint_sets logic
Clarify len variable names
Consistently use -1 as invalid file descriptor
Update event_pipe to use ep_rt_utf16_to_utf8_string/free
* Fix Sign mismatch build error1 parent f4bc468 commit ce67cef
File tree
35 files changed
+1874
-221
lines changed- src
- coreclr
- nativeaot/Runtime
- vm
- mono/mono
- component
- eventpipe/test
- native
- containers
- eventpipe
35 files changed
+1874
-221
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 102 | + | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
160 | 159 | | |
| 160 | + | |
| 161 | + | |
161 | 162 | | |
162 | 163 | | |
163 | | - | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| |||
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
183 | | - | |
| 186 | + | |
184 | 187 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
179 | | - | |
| 181 | + | |
| 182 | + | |
180 | 183 | | |
181 | 184 | | |
182 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
| 403 | + | |
403 | 404 | | |
404 | 405 | | |
405 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
271 | 274 | | |
272 | 275 | | |
273 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
20 | 46 | | |
21 | 47 | | |
22 | 48 | | |
| |||
0 commit comments