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


[ROCm/amdsmi commit: 7a6c26244e]
Este commit está contenido en:
Deepak Mewar
2023-02-27 02:06:14 -05:00
cometido por Naveen Krishna Chatradhi
padre c70ff3cbed
commit 1894e4d345
Se han modificado 8 ficheros con 23 adiciones y 23 borrados
+8 -8
Ver fichero
@@ -2783,7 +2783,7 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string);
* controlled (i.e., started, stopped,...) with ::amdsmi_gpu_control_counter() by
* passing ::amdsmi_counter_command_t commands. ::AMDSMI_CNTR_CMD_START starts an
* event counter and ::AMDSMI_CNTR_CMD_STOP stops a counter.
* ::amdsmi_read_counter() reads an event counter.
* ::amdsmi_gpu_read_counter() reads an event counter.
*
* Once the counter is no longer needed, the resources it uses should be freed
* by calling ::amdsmi_gpu_destroy_counter().
@@ -2794,12 +2794,12 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string);
* - A running "absolute" counter is kept internally. For the discussion that
* follows, we will call the internal counter value at time @a t @a
* val<sub>t</sub>
* - Issuing ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_read_counter(), causes
* - Issuing ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_gpu_read_counter(), causes
* AMDSMI (in kernel) to internally record the current absolute counter value
* - ::amdsmi_read_counter() returns the number of events that have occurred
* - ::amdsmi_gpu_read_counter() returns the number of events that have occurred
* since the previously recorded value (ie, a relative value,
* @a val<sub>t</sub> - val<sub>t-1</sub>) from the issuing of
* ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_read_counter()
* ::AMDSMI_CNTR_CMD_START or calling ::amdsmi_gpu_read_counter()
*
* Example of event counting sequence:
*
@@ -2836,12 +2836,12 @@ amdsmi_status_string(amdsmi_status_t status, const char **status_string);
* // Wait...
*
* // Get the number of events since AMDSMI_CNTR_CMD_START was issued:
* ret = amdsmi_read_counter(amdsmi_event_handle_t evt_handle, &value)
* ret = amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, &value)
*
* // Wait...
*
* // Get the number of events since amdsmi_read_counter() was last called:
* ret = amdsmi_read_counter(amdsmi_event_handle_t evt_handle, &value)
* // Get the number of events since amdsmi_gpu_read_counter() was last called:
* ret = amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle, &value)
*
* // Stop counting.
* ret = amdsmi_gpu_control_counter(evnt_handle, AMDSMI_CNTR_CMD_STOP, NULL);
@@ -2950,7 +2950,7 @@ amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle,
* @return ::amdsmi_status_t | ::AMDSMI_STATUS_SUCCESS on success, non-zero on fail
*/
amdsmi_status_t
amdsmi_read_counter(amdsmi_event_handle_t evt_handle,
amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle,
amdsmi_counter_value_t *value);
/**
+3 -3
Ver fichero
@@ -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)
```
+1 -1
Ver fichero
@@ -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))
)
+4 -4
Ver fichero
@@ -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',
+2 -2
Ver fichero
@@ -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))
+1 -1
Ver fichero
@@ -718,7 +718,7 @@ amdsmi_status_t amdsmi_gpu_control_counter(amdsmi_event_handle_t evt_handle,
}
amdsmi_status_t
amdsmi_read_counter(amdsmi_event_handle_t evt_handle,
amdsmi_gpu_read_counter(amdsmi_event_handle_t evt_handle,
amdsmi_counter_value_t *value) {
rsmi_status_t r = rsmi_counter_read(
static_cast<rsmi_event_handle_t>(evt_handle),
@@ -136,7 +136,7 @@ void TestPerfCntrReadWrite::CountEvents(amdsmi_processor_handle dv_ind,
}
sleep(sleep_sec);
ret = amdsmi_read_counter(evt_handle, val);
ret = amdsmi_gpu_read_counter(evt_handle, val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {
@@ -325,7 +325,7 @@ TestPerfCntrReadWrite::testEventsSimultaneously(amdsmi_processor_handle dv_ind)
for (j = 0; j < num_created; ++j) {
tmp = static_cast<amdsmi_event_type_t>(evnt + j);
ret = amdsmi_read_counter(evt_handle.get()[j], &val);
ret = amdsmi_gpu_read_counter(evt_handle.get()[j], &val);
CHK_ERR_ASRT(ret)
IF_VERB(STANDARD) {