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

[mono] Move basic w32file* and w32process* functions to eventpipe #66731

Merged
merged 4 commits into from
Mar 18, 2022

Conversation

akoeplinger
Copy link
Member

They are not used by the rest of the runtime and we only need a bare minimum of w32process and w32file in eventpipe (e.g. no file share/access logic).

Fix ep-test build and warnings, it was missing linking against libz and monoapi.

Fix host vs. target confusion in ep-rt-mono.c

They are not used by the rest of the runtime and we only need a bare minimum of w32process and w32file in eventpipe (e.g. no file share/access logic).

Fix ep-test build and warnings, it was missing linking against libz and monoapi.

Fix host vs. target confusion in ep-rt-mono.c
@@ -2224,7 +2483,7 @@ static const int64_t SECS_TO_NS = 1000000000;
static const int64_t MSECS_TO_MIS = 1000;

/* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */
#if defined (HAVE_CLOCK_MONOTONIC) && (defined(TARGET_IOS) || defined(TARGET_OSX) || defined(TARGET_WATCHOS) || defined(TARGET_TVOS))
#if defined (HAVE_CLOCK_MONOTONIC) && (defined(HOST_IOS) || defined(HOST_OSX) || defined(HOST_WATCHOS) || defined(HOST_TVOS))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't HOST_DARWIN supposed to encompass all of these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also: ios 10, macos 10.12, etc are pretty old. Do we still need this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes HOST_DARWIN would work too, good point. I can change that in a separate cleanup since we have similar code elsewhere.

Regarding removing this altogether, we have #58737 which tracks removing it from Android/iOS but last time we tried we hit various issues (#62978) so it needs a bit more care.

Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I think it looks great, nice work!. Most comments are formatting and some around adapting ported code to EventPipe types where possible.

src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.h Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.h Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/test/ep-buffer-tests.c Outdated Show resolved Hide resolved
src/mono/mono/eventpipe/ep-rt-mono.c Outdated Show resolved Hide resolved
akoeplinger and others added 3 commits March 17, 2022 21:56
Co-authored-by: Johan Lorensson <lateralusx.github@gmail.com>
Fix more formatting.

Move initialization of num_main_args after setting main_args so we can use it as a cheap guard value (not totally thread-safe but good enough for our purposes)
Move cmdline formatting back into object.c
Fix bug return INVALID_HANDLE_VALUE instead of null in ep_rt_file_open_write
Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@akoeplinger akoeplinger merged commit 2637241 into dotnet:main Mar 18, 2022
@akoeplinger akoeplinger deleted the w32-cleanup branch March 18, 2022 15:36
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
…tnet#66731)

They are not used by the rest of the runtime and we only need a bare minimum of w32process and w32file in eventpipe (e.g. no file share/access logic).

Fix ep-test build and warnings, it was missing linking against libz and monoapi.

Fix host vs. target confusion in ep-rt-mono.c

Move initialization of num_main_args after setting main_args in object.c so we can use it as a cheap guard value (not totally thread-safe but good enough for our purposes).

Co-authored-by: Johan Lorensson <lateralusx.github@gmail.com>
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants