Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to request stackwalk per EventPipe session #84077

Merged
merged 37 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
227992e
Ability to request stackwalk per EventPipe session
ezsilmar Mar 23, 2023
67147da
Fix build
ezsilmar Mar 29, 2023
0bfeec1
Fix build 2
ezsilmar Mar 29, 2023
f8d1ea7
Revert all the changes to start over
ezsilmar Aug 9, 2023
7a6ca27
Merge remote-tracking branch 'origin/main' into PR_eventpipe_requestS…
ezsilmar Aug 9, 2023
81f40b2
Merge branch 'main' of github.com:dotnet/runtime into PR_eventpipe_re…
ezsilmar Aug 11, 2023
5e2c5eb
Propagate disable_stacktrace parameter up to ep_enable
ezsilmar Aug 18, 2023
084c216
Refactor ds-eventpipe-protocol to use the same object for CollectTrac…
ezsilmar Aug 18, 2023
4917d6f
Parse disable_stacktrace in ds-eventpipe-protocol
ezsilmar Aug 18, 2023
999bd23
Fix a bug in ep.c enable declaration
ezsilmar Aug 18, 2023
29b7105
Introduce ep_enable_3
ezsilmar Aug 18, 2023
c7051ca
Try fix failing tests
ezsilmar Aug 21, 2023
d6a3923
Fix incorrect validation
ezsilmar Aug 21, 2023
6f4e68b
Use ep_enable_3 in IPC
ezsilmar Aug 21, 2023
d71b8e8
Allocate EventPipeSessionOptions on stack
ezsilmar Aug 25, 2023
a57ddbe
Pass EventPipeOptions by address
ezsilmar Aug 28, 2023
d18f45c
Rename IPC parameter to enable_stackwalk
ezsilmar Aug 28, 2023
e35e0af
Rename IPC parameter to stackwalk_requested
ezsilmar Aug 28, 2023
d09a83d
Include ds-types.h in ds-sources.c to fix the build issue
ezsilmar Aug 28, 2023
593381a
Fix jump bypasses variable initialization
ezsilmar Aug 28, 2023
7af4f1d
Merge branch 'main' into PR_eventpipe_requestStacks
ezsilmar Aug 28, 2023
367d108
Fix incorrect struct initialization
ezsilmar Aug 29, 2023
19d350a
Fix incorrect struct initialization 2
ezsilmar Aug 29, 2023
2e84c90
Fix incorrect struct initialization 3
ezsilmar Aug 29, 2023
6e6dbb4
Apply code format suggestions
ezsilmar Aug 31, 2023
1bf492a
Merge remote-tracking branch 'origin/main' into PR_eventpipe_requestS…
ezsilmar Oct 2, 2023
28ea623
Add ds_ipc_message_try_parse_bool
ezsilmar Oct 2, 2023
e59b228
Remove EventPipeSessionOptions from ep-types-forward
ezsilmar Oct 3, 2023
5ce6ff2
init function for ep options
ezsilmar Oct 3, 2023
19b8e5c
Use coherent if style in validation
ezsilmar Oct 3, 2023
26b4744
Fix missing inline keyword
ezsilmar Oct 3, 2023
f7b879c
Remove inline specifier
ezsilmar Oct 3, 2023
3f3535c
Merge branch 'main' into PR_eventpipe_requestStacks
ezsilmar Oct 9, 2023
84addea
Re-introduce EP_ASSERT in enable
ezsilmar Oct 10, 2023
9587b89
add ep_session_options_fini
ezsilmar Oct 10, 2023
1071117
Fix fini called without init
ezsilmar Oct 10, 2023
8b75c49
Merge branch 'main' into PR_eventpipe_requestStacks
ezsilmar Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/coreclr/vm/eventpipeadapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class EventPipeAdapter final
EventPipeSessionType sessionType,
EventPipeSerializationFormat format,
const bool rundownRequested,
const bool stacksRequested,
IpcStream *const stream,
EventPipeSessionSynchronousCallback callback,
void *callbackAdditionalData)
Expand All @@ -222,6 +223,7 @@ class EventPipeAdapter final
sessionType,
format,
rundownRequested,
stacksRequested,
stream,
callback,
callbackAdditionalData);
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/vm/eventpipeinternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ extern "C" UINT64 QCALLTYPE EventPipeInternal_Enable(
outputFile != NULL ? EP_SESSION_TYPE_FILE : EP_SESSION_TYPE_LISTENER,
format,
true,
true,
nullptr,
nullptr,
nullptr);
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/vm/genanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ bool gcGenAnalysisDump = false;
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
lateralusX marked this conversation as resolved.
Show resolved Hide resolved
nullptr,
nullptr,
nullptr
Expand Down
1 change: 1 addition & 0 deletions src/coreclr/vm/proftoeeinterfaceimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7118,6 +7118,7 @@ HRESULT ProfToEEInterfaceImpl::EventPipeStartSession(
EP_SESSION_TYPE_SYNCHRONOUS,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
requestRundown,
true, // TODO add requestStacks support
NULL,
reinterpret_cast<EventPipeSessionSynchronousCallback>(&ProfToEEInterfaceImpl::EventPipeCallbackHelper),
reinterpret_cast<void *>(m_pProfilerInfo));
Expand Down
2 changes: 2 additions & 0 deletions src/mono/mono/component/event_pipe-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ event_pipe_stub_enable (
EventPipeSessionType session_type,
EventPipeSerializationFormat format,
bool rundown_requested,
bool stacks_requested,
IpcStream *stream,
EventPipeSessionSynchronousCallback sync_callback);

Expand Down Expand Up @@ -262,6 +263,7 @@ event_pipe_stub_enable (
EventPipeSessionType session_type,
EventPipeSerializationFormat format,
bool rundown_requested,
bool stacks_requested,
IpcStream *stream,
EventPipeSessionSynchronousCallback sync_callback)
{
Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/component/event_pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ event_pipe_enable (
EventPipeSessionType session_type,
EventPipeSerializationFormat format,
bool rundown_requested,
bool stacks_requested,
IpcStream *stream,
EventPipeSessionSynchronousCallback sync_callback);

Expand Down Expand Up @@ -158,6 +159,7 @@ event_pipe_enable (
EventPipeSessionType session_type,
EventPipeSerializationFormat format,
bool rundown_requested,
bool stacks_requested,
IpcStream *stream,
EventPipeSessionSynchronousCallback sync_callback)
{
Expand Down Expand Up @@ -185,6 +187,7 @@ event_pipe_enable (
session_type,
format,
rundown_requested,
stacks_requested,
stream,
sync_callback,
NULL);
Expand Down
1 change: 1 addition & 0 deletions src/mono/mono/component/event_pipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef EventPipeSessionID
EventPipeSessionType session_type,
EventPipeSerializationFormat format,
bool rundown_requested,
bool stacks_requested,
IpcStream *stream,
EventPipeSessionSynchronousCallback sync_callback);

Expand Down
26 changes: 17 additions & 9 deletions src/mono/mono/eventpipe/test/ep-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ test_enable_disable (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -349,6 +350,7 @@ test_enable_disable_default_provider_config (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -398,6 +400,7 @@ test_enable_disable_multiple_default_provider_config (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -430,6 +433,7 @@ test_enable_disable_multiple_default_provider_config (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -480,6 +484,7 @@ test_enable_disable_provider_config (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -561,6 +566,7 @@ test_enable_disable_provider_parse_default_config (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -633,6 +639,7 @@ test_create_delete_provider_with_callback (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -735,6 +742,7 @@ test_session_start_streaming (void)
EP_SESSION_TYPE_FILE,
EP_SERIALIZATION_FORMAT_NETTRACE_V4,
false,
true,
NULL,
NULL,
NULL);
Expand Down Expand Up @@ -786,7 +794,7 @@ test_session_write_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4,false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -839,7 +847,7 @@ test_session_write_event_seq_point (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -896,7 +904,7 @@ test_session_write_wait_get_next_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -961,7 +969,7 @@ test_session_write_get_next_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -1038,7 +1046,7 @@ test_session_write_suspend_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -1098,7 +1106,7 @@ test_write_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -1149,7 +1157,7 @@ test_write_get_next_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down Expand Up @@ -1209,7 +1217,7 @@ test_write_wait_get_next_event (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

session = ep_get_session (session_id);
Expand Down Expand Up @@ -1289,7 +1297,7 @@ test_write_event_perf (void)

test_location = 3;

session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, NULL, NULL, NULL);
session_id = ep_enable (TEST_FILE, 1, current_provider_config, 1, EP_SESSION_TYPE_FILE, EP_SERIALIZATION_FORMAT_NETTRACE_V4, false, true, NULL, NULL, NULL);
ep_raise_error_if_nok (session_id != 0);

test_location = 4;
Expand Down
1 change: 1 addition & 0 deletions src/mono/mono/metadata/icall-eventpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ ves_icall_System_Diagnostics_Tracing_EventPipeInternal_Enable (
output_file != NULL ? EP_SESSION_TYPE_FILE : EP_SESSION_TYPE_LISTENER,
(EventPipeSerializationFormat)format,
true,
true,
NULL,
NULL);

Expand Down
Loading