romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
447 stars 50 forks source link

feat(fibers): Add utility for dumping the stacktraces of all fibers in a thread #129

Closed royjacobson closed 1 year ago

royjacobson commented 1 year ago

I've been wanting something like this for a while.

romange commented 1 year ago

It's super cool! Can it be integrated into gdb?

On Tue, Sep 5, 2023, 4:08 PM Roy Jacobson @.***> wrote:

I've been wanting something like this for a while.

You can view, comment on, or merge this pull request online at:

https://github.com/romange/helio/pull/129 Commit Summary

File Changes

(7 files https://github.com/romange/helio/pull/129/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/romange/helio/pull/129, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4BFCG5XJY7OPSI2YBWNZTXY4P4PANCNFSM6AAAAAA4LYPENI . You are receiving this because your review was requested.Message ID: @.***>

royjacobson commented 1 year ago

It's super cool! Can it be integrated into gdb?

I'm planning to add a DEBUG STACKTRACE sub-command, not sure how to integrate this with gdb :sweat_smile:

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.18% :tada:

Comparison is base (72f6dff) 76.27% compared to head (48328b4) 76.45%. Report is 3 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #129 +/- ## ========================================== + Coverage 76.27% 76.45% +0.18% ========================================== Files 97 98 +1 Lines 7051 7106 +55 ========================================== + Hits 5378 5433 +55 Misses 1673 1673 ``` | [Files Changed](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman) | Coverage Δ | | |---|---|---| | [util/fibers/detail/fiber\_interface.h](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvZGV0YWlsL2ZpYmVyX2ludGVyZmFjZS5o) | `92.59% <ø> (+0.28%)` | :arrow_up: | | [util/fibers/detail/scheduler.h](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvZGV0YWlsL3NjaGVkdWxlci5o) | `100.00% <ø> (ø)` | | | [util/fibers/detail/fiber\_interface.cc](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvZGV0YWlsL2ZpYmVyX2ludGVyZmFjZS5jYw==) | `94.19% <100.00%> (+0.81%)` | :arrow_up: | | [util/fibers/detail/scheduler.cc](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvZGV0YWlsL3NjaGVkdWxlci5jYw==) | `97.48% <100.00%> (+0.20%)` | :arrow_up: | | [util/fibers/fibers\_test.cc](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvZmliZXJzX3Rlc3QuY2M=) | `99.09% <100.00%> (+0.02%)` | :arrow_up: | | [util/fibers/stacktrace.cc](https://app.codecov.io/gh/romange/helio/pull/129?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman#diff-dXRpbC9maWJlcnMvc3RhY2t0cmFjZS5jYw==) | `100.00% <100.00%> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/romange/helio/pull/129/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Roman+Gershman)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

romange commented 1 year ago

Yes, I want to see that the list of fibers is updated correctly after the migration . in fact, please dcheck that all fibers you traverse have the correct scheduler from the current thread.

On Sun, Sep 10, 2023, 10:18 AM Roy Jacobson @.***> wrote:

@.**** commented on this pull request.

In util/fibers/detail/scheduler.cc https://github.com/romange/helio/pull/129#discussion_r1320709442:

@@ -553,11 +555,18 @@ void Scheduler::ScheduleFromRemote(FiberInterface cntx) { void Scheduler::Attach(FiberInterface cntx) { cntx->scheduler_ = this;

  • fibers_.push_back(*cntx);

There's a ProactorTest.Migrate test already, do you want to test specifically the combination of migration and the stack traces?

— Reply to this email directly, view it on GitHub https://github.com/romange/helio/pull/129#discussion_r1320709442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4BFCATWQREIUFX5OPFOP3XZVSUJANCNFSM6AAAAAA4LYPENI . You are receiving this because your review was requested.Message ID: @.***>