-
Notifications
You must be signed in to change notification settings - Fork 770
[XPTI] 64-bit universal ID rework to use a tuple of three 64-bit components #4318
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
Conversation
o Added new XPTI data type uid_t that will be used to generate the universal 64-bit ID o Added std::less/std::hash specialization to support map/unorder_maps with uid_t as keys o Added unit tests to verify Signed-off-by: Vasanth Tovinkere <[email protected]>
Old Universal ID generated a 64-hash from source file string ID, line number, kernel name string ID and code pointer. The new approach will create an Universal ID structure with three 64-bit values that are created from source file string ID, line number, stack back trace string ID from caller/ callee, kernnel name string ID and code pointer. The 64-bit hash is a bijection of the available values. - Updates the internal data structures to eliminate data structures that mapped payload information 64-hash to universal ID - Reduces the number of data stuctures - Updates the unit tests to reflect the infrastucture changes Signed-off-by: Vasanth Tovinkere <[email protected]>
Signed-off-by: Vasanth Tovinkere <[email protected]>
Signed-off-by: Vasanth Tovinkere <[email protected]>
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.
Amazing work!
Signed-off-by: Vasanth Tovinkere <[email protected]>
Signed-off-by: Vasanth Tovinkere <[email protected]>
Signed-off-by: Vasanth Tovinkere <[email protected]>
+ Universal ID needs to be available for use as a key in std::map and this requires std::less understanding this type or the type supporting operator<(). Removing the std::less implementation as the object already supports operator<(). Add unit tests to see if the std::map insertions are ordered. Signed-off-by: Vasanth Tovinkere <[email protected]>
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 just have a few minor comments. You can ignore them if you don't have anything else to change.
@@ -52,6 +52,6 @@ endif() | |||
|
|||
# The tests in basic_test are written using TBB, so these tests are enabled | |||
# only if TBB has been enabled. | |||
if (XPTI_ENABLE_TBB) | |||
if (0) |
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.
Can you add a comment explaining why this is unconditionally disabled and when that might change?
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.
Currently, TBB is required for exercising multi-threaded tests and marginal performance improvement of some data structure access in multi-threaded mode. However, XPTI does not require TBB to be fully functional. The reason for disabling this feature is that the Windows builds have a failure while linking the multi-threaded tests and once we resolve them, we should be able to turn them on.
Payload->uid.p2 = XPTI_PACK32_RET64(stack_id, name_id); | ||
// The code pointer for the kernel is already in 64-bit format | ||
if ((Payload->flags & | ||
static_cast<uint64_t>(payload_flag_t::CodePointerAvailable))) |
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 looks like you have an extra set of parentheses here.
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.
Thanks! Will address in the next PR as it is cosmetic.
With the requirement of supporting 64-bit hash generation from code location+line number or kernel name + back trace + address or kernel name + address, the universal ID manages three 64-bit values representing each of these scenarios to generate a hash. Updated the unit tests and performance tests to use the new data structure and hash generation algorithm, including a simulation of 10000-1000000 million trace points that result in no collision.