-
Notifications
You must be signed in to change notification settings - Fork 473
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
VITIS-10034 Add Usage metrics for all XRT objects #7788
Conversation
579af83
to
deda6d7
Compare
Build Passed! |
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 very good Rahul. Nice clean code.
Lots of comments. Let me know what you think, not all may be possible. We can meet and discuss.
Thank you for making this a manageable pull request. The changes are about what I can comprehend in one sitting :-)
Thanks Soren :) |
deda6d7
to
871693a
Compare
871693a
to
e6d318a
Compare
Build failed :( |
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.
Some more changes. Please review.
e6d318a
to
39f89af
Compare
39f89af
to
fd4898d
Compare
Build Passed! |
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 am sorry to drag this on. But it is making good progress. Just need to get everything perfect :-)
fd4898d
to
9a87575
Compare
Build failed :( |
Build Passed! |
46ab03d
to
eb8dcbe
Compare
Signed-off-by: rbramand <[email protected]>
Signed-off-by: rbramand <[email protected]>
Signed-off-by: rbramand <[email protected]>
Signed-off-by: rbramand <[email protected]>
> Refactor code Signed-off-by: rbramand <[email protected]>
Signed-off-by: rbramand <[email protected]>
eb8dcbe
to
f3888ff
Compare
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.
Thank you for working through all the changes. Looks good now. Reads well IMO.
Build failed :( |
retest this please |
Build failed :( |
retest this please |
Build failed :( |
retest this please. (PACT board test is failing repeatedly. So witching back from it ) |
Build Passed! |
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.
} | ||
|
||
usage_metrics_logger:: | ||
~usage_metrics_logger() |
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.
We need try / catch to resolve
- https://scan9.scan.coverity.com/reports.htm#v36614/p13446/fileInstanceId=123592600&defectInstanceId=9463167&mergedDefectId=330809
- https://scan9.scan.coverity.com/reports.htm#v36614/p13446/fileInstanceId=123592600&defectInstanceId=9463171&mergedDefectId=330815
- https://scan9.scan.coverity.com/reports.htm#v36614/p13446/fileInstanceId=123592600&defectInstanceId=9463146&mergedDefectId=330816
m_dev_map[dev_id] = {}; | ||
try { | ||
auto bdf = xrt_core::query::pcie_bdf::to_string(xrt_core::device_query<xrt_core::query::pcie_bdf>(dev)); | ||
m_dev_map[dev_id].bdf = bdf; |
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.
namespace { | ||
// global variables | ||
static std::mutex m; | ||
static uint32_t thread_count; |
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.
static std::atomic<uint32_t> thread_count {0};
https://scan9.scan.coverity.com/reports.htm#v36614/p13446/fileInstanceId=123592600&defectInstanceId=9463130&mergedDefectId=330812
~usage_metrics_logger() | ||
{ | ||
{ | ||
std::lock_guard<std::mutex> lk(m); |
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.
Move before 337 now that thread_count is atomic
Problem solved by the commit
Added new Usage metrics logger that logs info about XRT objects like device, buffer, hw context, kernel etc
This information is collected in thread safe manner and the info is dumped in JSON format to a file after application run finishes
The info collected and spec for this solution is captured in confluence page
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
NA
How problem was solved, alternative solutions (if any) and why they were rejected
The proposed solution is explained in above confluence page
Risks (if any) associated the changes in the commit
Low
What has been tested and how, request additional testing if necessary
Tested with a simple multi threaded bandwidth application and was able to generate JSON file properly with necessary info
The following is the JSON dump generated with application that has 5 threads :
Documentation impact (if any)
NA