-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add source location to task and tasktrace object #2707
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ | |
|
||
#ifndef SEASTAR_MODULE | ||
#include <utility> | ||
#include <source_location> | ||
#endif | ||
|
||
namespace seastar { | ||
|
@@ -35,6 +36,8 @@ class task { | |
protected: | ||
scheduling_group _sg; | ||
private: | ||
std::source_location resume_point = {}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is making a very heavily used object larger. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After adding
No difference except for that single unlucky value, who is "promoted" to the next 64 byte cache line in case of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's okay. |
||
#ifdef SEASTAR_TASK_BACKTRACE | ||
shared_backtrace _bt; | ||
#endif | ||
|
@@ -53,6 +56,8 @@ public: | |
virtual void run_and_dispose() noexcept = 0; | ||
/// Returns the next task which is waiting for this task to complete execution, or nullptr. | ||
virtual task* waiting_task() noexcept = 0; | ||
void update_resume_point(std::source_location sl) { resume_point = sl; } | ||
auto get_resume_point() const { return resume_point; } | ||
scheduling_group group() const { return _sg; } | ||
shared_backtrace get_backtrace() const; | ||
#ifdef SEASTAR_TASK_BACKTRACE | ||
|
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.
it took me a while to check if it's safe to use
<source_location>
instead ofutil/std-compat.hh
. the answer is yes. as we support the latest two major versions of the GCC and Clang compilers. in general, we use libstdc++, which added the support tosource_location
in gcc-mirror/gcc@57d76ee, which is included by gcc 12 and up. and the latest stable release of GCC is GCC 14.2.