Skip to content

[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

Merged
merged 9 commits into from
Aug 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 159 additions & 77 deletions xpti/include/xpti_data_types.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion xpti/include/xpti_trace_framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ xptiMakeEvent(const char *name, xpti::payload_t *payload, uint16_t event,
/// performed
/// @return The trace event with unique ID equal to uid. If the unique ID is not
/// present, then nullptr will be returned.
XPTI_EXPORT_API const xpti::trace_event_data_t *xptiFindEvent(int64_t uid);
XPTI_EXPORT_API const xpti::trace_event_data_t *xptiFindEvent(uint64_t uid);

/// @brief Retrieves the payload information associated with an event
/// @details An event encapsulates the unique payload it represents and this
Expand Down
2 changes: 1 addition & 1 deletion xpti/src/xpti_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ xptiMakeEvent(const char *name, xpti::payload_t *payload, uint16_t event,
return nullptr;
}

XPTI_EXPORT_API const xpti::trace_event_data_t *xptiFindEvent(int64_t uid) {
XPTI_EXPORT_API const xpti::trace_event_data_t *xptiFindEvent(uint64_t uid) {
if (xpti::g_loader.noErrors()) {
auto f = xpti::g_loader.functionByIndex(XPTI_FIND_EVENT);
if (f) {
Expand Down
4 changes: 2 additions & 2 deletions xptifw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ add_subdirectory(src)
# TODO enable samples and tests back once build problems are resolved.
# Currently builds for unit tests and samples fail mostly with dllimport/dllexport
# mismatch problems:
# syclpi_collector.cpp(32): error C2491: 'xptiTraceInit': definition of dllimport function not allowed
# syclpi_collector.cpp(32): error C2491: 'xptiTraceInit': definition of dllimport function not allowed
if (0)
add_subdirectory(unit_test)
add_subdirectory(samples/basic_collector)
Expand All @@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

add_subdirectory(basic_test)
endif()
2 changes: 1 addition & 1 deletion xptifw/basic_test/performance_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void TestPerformance::runDataStructureTestsThreads(
}
ModelRow[(int)DSColumns::STInsertLookup] = ElapsedTime;

std::vector<int64_t> UIds;
std::vector<uint64_t> UIds;
std::vector<xpti::trace_event_data_t *> Events;
UIds.resize(MTracepoints);
Events.resize(MTracepoints);
Expand Down
2 changes: 1 addition & 1 deletion xptifw/basic_test/semantic_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void TestCorrectness::runTracepointTestThreads(int RunNo, int NumThreads,

if (!NumThreads) {
std::vector<xpti::payload_t *> Payloads;
std::vector<int64_t> UIds;
std::vector<uint64_t> UIds;
std::vector<xpti::trace_event_data_t *> Events;
Payloads.resize(TracepointCount);
UIds.resize(TracepointCount);
Expand Down
4 changes: 2 additions & 2 deletions xptifw/samples/basic_collector/basic_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ XPTI_CALLBACK_API void tpCallback(uint16_t TraceType,
uint32_t CPU = GThreadIDEnum.enumID(TID);
std::string Name;

if (Payload->name_sid != xpti::invalid_id) {
if (Payload->name_sid() != xpti::invalid_id) {
Name = truncate(Payload->name);
} else {
Name = "<unknown>";
Expand All @@ -144,7 +144,7 @@ XPTI_CALLBACK_API void tpCallback(uint16_t TraceType,
xptiLookupString(Item.second));
}

if (Payload->source_file_sid != xpti::invalid_id && Payload->line_no > 0) {
if (Payload->source_file_sid() != xpti::invalid_id && Payload->line_no > 0) {
printf("---[Source file:line no] %s:%d\n", Payload->source_file,
Payload->line_no);
}
Expand Down
Loading