-
Notifications
You must be signed in to change notification settings - Fork 200
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
[PAL/Linux-SGX] Remove printing of thread-local SGX statistics #1995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel)
a discussion (no related file):
@mkow @woju @jkr0103 @kailun-qin @mwkmwkmwk What do you think about this PR? It changes user-facing (profiling) output, do we care? I am 99.9% sure no users rely on thread-local outputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion, not enough approvals from maintainers (2 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners
a discussion (no related file):
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
@mkow @woju @jkr0103 @kailun-qin @mwkmwkmwk What do you think about this PR? It changes user-facing (profiling) output, do we care? I am 99.9% sure no users rely on thread-local outputs.
Feedback from @aneessahib: there were workloads where thread-local statistics were useful in debugging. However, hopefully with #1996 (the ability to reset stats on a user signal), the debugging with process-wide-only statistics will be similarly useful. So @aneessahib is Ok with both options: merging this PR and removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners (waiting on @aneessahib, @dimakuv, @jkr0103, @mkow, @mwkmwkmwk, and @woju)
a discussion (no related file):
there were workloads where thread-local statistics were useful in debugging
Yep, I guess so. But I'm fine w/ this PR.
-- commits
line 5 at r2:
-> not only?
Code quote:
not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions, not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners (waiting on @aneessahib, @dimakuv, @jkr0103, @mwkmwkmwk, and @woju)
Suggestion:
there is no easy way
pal/src/host/linux-sgx/host_ocalls.c
line 63 at r2 (raw file):
if (ocall_exit_args->is_exitgroup) { process_exit((int)ocall_exit_args->exitcode); die_or_inf_loop();
process_exit()
is already noreturn
pal/src/host/linux-sgx/pal_tcb.h
line 118 at r2 (raw file):
extern bool g_sgx_enable_stats; void update_sgx_stats(bool print_process_wide_stats);
Suggestion:
do_print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 6 unresolved discussions, not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners (waiting on @aneessahib, @dimakuv, @jkr0103, @mwkmwkmwk, and @woju)
a discussion (no related file):
Enabling per-thread and process-wide SGX stats
manifest-syntax.rst
also needs an update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 6 unresolved discussions, not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners (waiting on @aneessahib, @dimakuv, @jkr0103, @mwkmwkmwk, and @woju)
a discussion (no related file):
Previously, mkow (Michał Kowalczyk) wrote…
Enabling per-thread and process-wide SGX stats
manifest-syntax.rst
also needs an update.
ah, and performance.rst
also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 5 files reviewed, 5 unresolved discussions, not enough approvals from maintainers (1 more required), not enough approvals from different teams (1 more required, approved so far: Intel), "fixup! " found in commit messages' one-liners (waiting on @dimakuv, @kailun-qin, @mkow, and @woju)
a discussion (no related file):
Previously, mkow (Michał Kowalczyk) wrote…
ah, and
performance.rst
also
Done. Good catch.
Previously, kailun-qin (Kailun Qin) wrote…
-> not only?
Will do during final rebase
-- commits
line 8 at r2:
Will do during final rebase
pal/src/host/linux-sgx/host_ocalls.c
line 63 at r2 (raw file):
Previously, mkow (Michał Kowalczyk) wrote…
process_exit()
is alreadynoreturn
Done.
pal/src/host/linux-sgx/pal_tcb.h
line 118 at r2 (raw file):
extern bool g_sgx_enable_stats; void update_sgx_stats(bool print_process_wide_stats);
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, "fixup! " found in commit messages' one-liners (waiting on @dimakuv and @woju)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions, "fixup! " found in commit messages' one-liners (waiting on @dimakuv and @woju)
Previously, when manifest contained `sgx.enable_stats = true`, Gramine-SGX printed not only the process-wide SGX statistics, but also statistics for each thread. These thread-local SGX statistics only litter the output as (1) there are helper Gramine threads that do not correspond to any application thread, (2) there is no easy way to correlate the printed thread-local stats to application threads/workload execution (as stats simply print the opaque TID of the thread). This commit removes thread-local stats and keeps only process-wide ones. Signed-off-by: Dmitrii Kuvaiskii <[email protected]>
f66ba21
to
2ff0ab1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on @kailun-qin, @mkow, and @woju)
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
Will do during final rebase
Done.
Previously, dimakuv (Dmitrii Kuvaiskii) wrote…
Will do during final rebase
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @woju)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @woju)
Description of the changes
Previously, when manifest contained
sgx.enable_stats = true
, Gramine-SGX printed not the process-wide SGX statistics, but also statistics for each thread. These thread-local SGX statistics only litter the output as (1) there are helper Gramine threads that do not correspond to any application thread, (2) there is no way to correlate the printed thread-local stats to application threads/workload execution (as stats simply print the opaque TID of the thread).This PR removes thread-local stats and keeps only process-wide ones.
How to test this PR?
The Helloworld CI example (with
sgx.enable_stats = true
):This change is