Update XGMI perf counter test to show utilization
Also:
* When destroying a counter, make sure to stop the counter first
* In the test, do not stop (disable) the counter before
reading it.
* Clean up some whitespace in other tests
* Re-add manual pdf file
Change-Id: I0786ef3a994ca568299c77e44f092af8943ac33d
[ROCm/amdsmi commit: f946ea37ef]
このコミットが含まれているのは:
1 親
4b08ffa5bd
コミット
b30200cd48
9ファイル変更
+227
-103
検索条件に一致するファイルはありません
@@ -566,7 +566,7 @@ rsmi_init(uint64_t flags) {
|
||||
smi.Initialize(flags);
|
||||
} catch(...) {
|
||||
smi.Cleanup();
|
||||
throw;
|
||||
throw amd::smi::rsmi_exception(RSMI_STATUS_INIT_ERROR, __FUNCTION__);
|
||||
}
|
||||
}
|
||||
refGuard.Dismiss();
|
||||
@@ -2663,14 +2663,17 @@ rsmi_dev_counter_destroy(rsmi_event_handle_t evnt_handle) {
|
||||
return RSMI_STATUS_INVALID_ARGS;
|
||||
}
|
||||
|
||||
uint32_t ret = 0;
|
||||
amd::smi::evt::Event *evt =
|
||||
reinterpret_cast<amd::smi::evt::Event *>(evnt_handle);
|
||||
uint32_t dv_ind = evt->dev_ind();
|
||||
DEVICE_MUTEX
|
||||
REQUIRE_ROOT_ACCESS
|
||||
|
||||
ret = evt->stopCounter();
|
||||
|
||||
delete evt;
|
||||
return RSMI_STATUS_SUCCESS;
|
||||
return errno_to_rsmi_status(ret);;
|
||||
CATCH
|
||||
}
|
||||
|
||||
@@ -2730,6 +2733,12 @@ rsmi_counter_read(rsmi_event_handle_t evt_handle,
|
||||
|
||||
ret = evt->getValue(value);
|
||||
|
||||
// If value > 2^48, then an overflow has occurred. We need to discard this
|
||||
// value and re-read:
|
||||
if (ret == 0 && value->value > 0xFFFFFFFFFFFF) {
|
||||
ret = evt->getValue(value);
|
||||
}
|
||||
|
||||
return errno_to_rsmi_status(ret);
|
||||
CATCH
|
||||
}
|
||||
|
||||
@@ -315,6 +315,7 @@ amd::smi::evt::Event::openPerfHandle(void) {
|
||||
|
||||
attr_.size = sizeof(struct perf_event_attr);
|
||||
attr_.config = get_perf_attr_config(&event_info_);
|
||||
attr_.sample_type = PERF_SAMPLE_IDENTIFIER;
|
||||
attr_.read_format = PERF_FORMAT_TOTAL_TIME_ENABLED |
|
||||
PERF_FORMAT_TOTAL_TIME_RUNNING;
|
||||
attr_.disabled = 1;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする