Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upsrc: expose ListNode<T>::prev_ on postmortem metadata #30027
Conversation
This comment has been minimized.
This comment has been minimized.
Does this come from some other PR? I feel like I’ve seen this before |
This comment has been minimized.
This comment has been minimized.
While this approach isn't wrong, you could also export the offset of the diff --git a/src/node_postmortem_metadata.cc b/src/node_postmortem_metadata.cc
index 05800f79b0..ccb347e951 100644
--- a/src/node_postmortem_metadata.cc
+++ b/src/node_postmortem_metadata.cc
@@ -27,9 +27,11 @@
HandleWrap::handle_wrap_queue_) \
V(Environment_HandleWrapQueue, head_, ListNode_HandleWrap, \
Environment::HandleWrapQueue::head_) \
+ V(ListNode_HandleWrap, prev_, uintptr_t, ListNode<HandleWrap>::prev_) \
V(ListNode_HandleWrap, next_, uintptr_t, ListNode<HandleWrap>::next_) \
V(Environment_ReqWrapQueue, head_, ListNode_ReqWrapQueue, \
Environment::ReqWrapQueue::head_) \
+ V(ListNode_ReqWrap, prev_, uintptr_t, ListNode<ReqWrapBase>::prev_) \
V(ListNode_ReqWrap, next_, uintptr_t, ListNode<ReqWrapBase>::next_)
extern "C" { And then: diff --git a/test/cctest/test_node_postmortem_metadata.cc b/test/cctest/test_node_postmortem_metadata.cc
index 79b766939b..0eac0240cd 100644
--- a/test/cctest/test_node_postmortem_metadata.cc
+++ b/test/cctest/test_node_postmortem_metadata.cc
@@ -19,8 +19,10 @@ extern uintptr_t
extern uintptr_t
nodedbg_offset_Environment__req_wrap_queue___Environment_ReqWrapQueue;
extern uintptr_t nodedbg_offset_ExternalString__data__uintptr_t;
+extern uintptr_t nodedbg_offset_ListNode_ReqWrap__prev___uintptr_t;
extern uintptr_t nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
extern uintptr_t nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
+extern uintptr_t nodedbg_offset_ListNode_HandleWrap__prev___uintptr_t;
extern uintptr_t nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
extern uintptr_t
nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
@@ -143,12 +145,12 @@ TEST_F(DebugSymbolsTest, HandleWrapList) {
auto queue = reinterpret_cast<uintptr_t>((*env)->handle_wrap_queue());
auto head = queue +
nodedbg_offset_Environment_HandleWrapQueue__head___ListNode_HandleWrap;
- auto next =
- head + nodedbg_offset_ListNode_HandleWrap__next___uintptr_t;
- next = *reinterpret_cast<uintptr_t*>(next);
+ auto prev =
+ head + nodedbg_offset_ListNode_HandleWrap__prev___uintptr_t;
+ prev = *reinterpret_cast<uintptr_t*>(prev);
auto expected = reinterpret_cast<uintptr_t>(&obj);
- auto calculated = next -
+ auto calculated = prev -
nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap;
EXPECT_EQ(expected, calculated);
@@ -177,13 +179,13 @@ TEST_F(DebugSymbolsTest, ReqWrapList) {
auto queue = reinterpret_cast<uintptr_t>((*env)->req_wrap_queue());
auto head = queue +
nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue;
- auto next =
+ auto prev =
head + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t;
- next = *reinterpret_cast<uintptr_t*>(next);
+ prev = *reinterpret_cast<uintptr_t*>(prev);
auto expected = reinterpret_cast<uintptr_t>(&obj);
auto calculated =
- next - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
+ prev - nodedbg_offset_ReqWrap__req_wrap_queue___ListNode_ReqWrapQueue;
EXPECT_EQ(expected, calculated);
obj.Dispatched(); If nothing else, the logic should probably also be updated for the ReqWrap list. |
Make ListNode<T> postmortem easier to find last items in the queue.
This comment has been minimized.
This comment has been minimized.
@bnoordhuis That would be much simpler. I've updated the patch to also make sure coverage on both metadata (the next and prev). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Landed in 45efe67 |
Trott
added a commit
that referenced
this pull request
Oct 22, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins
added a commit
that referenced
this pull request
Oct 23, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins
added a commit
that referenced
this pull request
Oct 23, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Merged
targos
added a commit
that referenced
this pull request
Nov 8, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos
added a commit
that referenced
this pull request
Nov 10, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
targos
added a commit
that referenced
this pull request
Nov 11, 2019
Make ListNode<T> postmortem easier to find last items in the queue. PR-URL: #30027 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
legendecas commentedOct 18, 2019
•
edited
Make
ListNode<T>
postmortem easier to find last items in the queue.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes