Renamed API amdsmi_read_counter
to amdsmi_gpu_read_counter grep -rli 'amdsmi_read_counter' * | xargs -i@ sed -i 's/amdsmi_read_counter/amdsmi_gpu_read_counter/g' @ Change-Id: Ie9fec914358dd901930db54ab94e05f2fe32fa5a
This commit is contained in:
committed by
Naveen Krishna Chatradhi
parent
6e1a72d2c1
commit
7a6c26244e
@@ -2344,7 +2344,7 @@ try:
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
## amdsmi_read_counter
|
||||
## amdsmi_gpu_read_counter
|
||||
Description: Read the current value of a performance counter
|
||||
|
||||
Input parameters:
|
||||
@@ -2359,7 +2359,7 @@ Field | Description
|
||||
`time_enabled`| Time that the counter was enabled in nanoseconds
|
||||
`time_running`| Time that the counter was running in nanoseconds
|
||||
|
||||
Exceptions that can be thrown by `amdsmi_read_counter` function:
|
||||
Exceptions that can be thrown by `amdsmi_gpu_read_counter` function:
|
||||
* `AmdSmiLibraryException`
|
||||
* `AmdSmiRetryException`
|
||||
* `AmdSmiParameterException`
|
||||
@@ -2373,7 +2373,7 @@ try:
|
||||
else:
|
||||
for device in devices:
|
||||
event_handle = amdsmi_gpu_create_counter(device, AmdSmiEventType.XGMI_1_REQUEST_TX)
|
||||
amdsmi_read_counter(event_handle)
|
||||
amdsmi_gpu_read_counter(event_handle)
|
||||
except AmdSmiException as e:
|
||||
print(e)
|
||||
```
|
||||
|
||||
@@ -120,7 +120,7 @@ from .amdsmi_interface import amdsmi_gpu_counter_group_supported
|
||||
from .amdsmi_interface import amdsmi_gpu_create_counter
|
||||
from .amdsmi_interface import amdsmi_gpu_destroy_counter
|
||||
from .amdsmi_interface import amdsmi_gpu_control_counter
|
||||
from .amdsmi_interface import amdsmi_read_counter
|
||||
from .amdsmi_interface import amdsmi_gpu_read_counter
|
||||
from .amdsmi_interface import amdsmi_counter_get_available_counters
|
||||
|
||||
# # Error Query
|
||||
|
||||
@@ -1409,7 +1409,7 @@ def amdsmi_gpu_control_counter(
|
||||
)
|
||||
|
||||
|
||||
def amdsmi_read_counter(
|
||||
def amdsmi_gpu_read_counter(
|
||||
event_handle: amdsmi_wrapper.amdsmi_event_handle_t,
|
||||
) -> Dict[str, Any]:
|
||||
if not isinstance(event_handle, amdsmi_wrapper.amdsmi_event_handle_t):
|
||||
@@ -1420,7 +1420,7 @@ def amdsmi_read_counter(
|
||||
counter_value = amdsmi_wrapper.amdsmi_counter_value_t()
|
||||
|
||||
_check_res(
|
||||
amdsmi_wrapper.amdsmi_read_counter(
|
||||
amdsmi_wrapper.amdsmi_gpu_read_counter(
|
||||
event_handle, ctypes.byref(counter_value))
|
||||
)
|
||||
|
||||
|
||||
@@ -1601,9 +1601,9 @@ amdsmi_gpu_destroy_counter.argtypes = [amdsmi_event_handle_t]
|
||||
amdsmi_gpu_control_counter = _libraries['libamd_smi.so'].amdsmi_gpu_control_counter
|
||||
amdsmi_gpu_control_counter.restype = amdsmi_status_t
|
||||
amdsmi_gpu_control_counter.argtypes = [amdsmi_event_handle_t, amdsmi_counter_command_t, ctypes.POINTER(None)]
|
||||
amdsmi_read_counter = _libraries['libamd_smi.so'].amdsmi_read_counter
|
||||
amdsmi_read_counter.restype = amdsmi_status_t
|
||||
amdsmi_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)]
|
||||
amdsmi_gpu_read_counter = _libraries['libamd_smi.so'].amdsmi_gpu_read_counter
|
||||
amdsmi_gpu_read_counter.restype = amdsmi_status_t
|
||||
amdsmi_gpu_read_counter.argtypes = [amdsmi_event_handle_t, ctypes.POINTER(struct_c__SA_amdsmi_counter_value_t)]
|
||||
amdsmi_counter_get_available_counters = _libraries['libamd_smi.so'].amdsmi_counter_get_available_counters
|
||||
amdsmi_counter_get_available_counters.restype = amdsmi_status_t
|
||||
amdsmi_counter_get_available_counters.argtypes = [amdsmi_processor_handle, amdsmi_event_group_t, ctypes.POINTER(ctypes.c_uint32)]
|
||||
@@ -1930,7 +1930,7 @@ __all__ = \
|
||||
'amdsmi_power_profile_status_t', 'amdsmi_proc_info_t',
|
||||
'amdsmi_process_handle', 'amdsmi_process_info_t',
|
||||
'amdsmi_range_t', 'amdsmi_ras_err_state_t',
|
||||
'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_read_counter',
|
||||
'amdsmi_ras_err_state_t__enumvalues', 'amdsmi_gpu_read_counter',
|
||||
'amdsmi_retired_page_record_t',
|
||||
'amdsmi_set_gpu_event_notification_mask',
|
||||
'amdsmi_set_gpu_perf_determinism_mode', 'amdsmi_shut_down',
|
||||
|
||||
@@ -347,7 +347,7 @@ class Formatter:
|
||||
| """ + self.style.text("58 Get vbios info. Api: amdsmi_get_gpu_vbios_info <bdf>") + """ |
|
||||
| """ + self.style.text("59 Get counter available counters. Api: amdsmi_counter_get_available_counters <bdf>") + """ |
|
||||
| """ + self.style.text("60 Get counter control. Api: amdsmi_gpu_control_counter <bdf>") + """ |
|
||||
| """ + self.style.text("61 Get counter read. Api: amdsmi_read_counter <bdf>") + """ |
|
||||
| """ + self.style.text("61 Get counter read. Api: amdsmi_gpu_read_counter <bdf>") + """ |
|
||||
| """ + self.style.text("62 Set dev clk range. Api: amdsmi_set_gpu_clk_range <bdf><min_clk><max_clk>") + """ |
|
||||
| """ + self.style.text("63 Get dev counter group supported. Api: amdsmi_gpu_counter_group_supported <bdf>") + """ |
|
||||
| """ + self.style.text("64 Reset dev fan. Api: amdsmi_reset_gpu_fan <bdf><sensor_idx>") + """ |
|
||||
@@ -607,7 +607,7 @@ def amdsmi_tool_counter_read(dev):
|
||||
for event_type in smi_api.AmdSmiEventType:
|
||||
try:
|
||||
event_handle = smi_api.amdsmi_gpu_create_counter(dev, event_type)
|
||||
value = smi_api.amdsmi_read_counter(event_handle)
|
||||
value = smi_api.amdsmi_gpu_read_counter(event_handle)
|
||||
result.update({event_type.name: value})
|
||||
except smi_api.AmdSmiException as e:
|
||||
print("{}:\t{}".format(event_type.name, e))
|
||||
|
||||
Reference in New Issue
Block a user