-
Notifications
You must be signed in to change notification settings - Fork 853
Add a new --enable-event-tracker configure option #8179
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
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 |
|---|---|---|
|
|
@@ -29,6 +29,8 @@ | |
| *****************************************************************************/ | ||
| #include "P_EventSystem.h" | ||
|
|
||
| #include "tscore/ink_stack_trace.h" | ||
|
|
||
| ClassAllocator<Event> eventAllocator("eventAllocator", 256); | ||
|
|
||
| void | ||
|
|
@@ -104,3 +106,19 @@ Event::schedule_every(ink_hrtime aperiod, int acallback_event) | |
| ethread->EventQueueExternal.enqueue_local(this); | ||
| } | ||
| } | ||
|
|
||
| #ifdef ENABLE_EVENT_TRACKER | ||
|
|
||
| void | ||
| Event::set_location() | ||
| { | ||
| _location = ink_backtrace(3); | ||
| } | ||
|
|
||
| const void * | ||
| Event::get_location() const | ||
|
Member
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 don't see anything calling
Contributor
Author
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. Right. It's just the buddy of |
||
| { | ||
| return _location; | ||
| } | ||
|
|
||
| #endif | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
This is doing pretty tricky. Assuming this is called by
schedule_*functions to record where they're called (the 3rd frame of the call stack).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.
Any idea how performant this is? I.e. is it going to significantly impact how much traffic a production cache can take, and/or TTMS? Or is it very small, could we just leave this on in Production?
Uh oh!
There was an error while loading. Please reload this page.
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.
Yeah, the whole "3" thing is awkward, but that's pretty common when looking back on the stack. It seems fragile, but it's also unlikely to change. Meh.
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.
I though
backtrace(3)doesn't have noticeable overhead. Because it just refers address of current call stack. I'll measure on/off at production.https://man7.org/linux/man-pages/man3/backtrace.3.html
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.
Ah, excellent. I was just curious. It's still very useful in debug mode, but there's so much more we can do if we can just leave it on all the time.