mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
qcacmn: Implement WMI/Credit History log print APIs
Create output agnostic log print APIs for WMI and Credit History to
enhance the debugging experience.
Change-Id: Ie89a9cb3b54c373ac2610d62003e940da17696d8
CRs-Fixed: 2028762
This commit is contained in:
parent
52e9bb6d6f
commit
536064a37e
7 changed files with 282 additions and 2 deletions
|
|
@ -802,4 +802,10 @@ void htc_set_wmi_endpoint_count(HTC_HANDLE htc_handle, uint8_t wmi_ep_count);
|
|||
* return: WMI enpoint count
|
||||
*/
|
||||
uint8_t htc_get_wmi_endpoint_count(HTC_HANDLE htc_handle);
|
||||
|
||||
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
||||
void htc_print_credit_history(HTC_HANDLE htc, uint32_t count,
|
||||
qdf_abstract_print * print, void *print_priv);
|
||||
#endif
|
||||
|
||||
#endif /* _HTC_API_H_ */
|
||||
|
|
|
|||
|
|
@ -92,6 +92,25 @@ typedef enum {
|
|||
HTC_INITIAL_WAKE_UP,
|
||||
} htc_credit_exchange_type;
|
||||
|
||||
static inline const char*
|
||||
htc_credit_exchange_type_str(htc_credit_exchange_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case HTC_REQUEST_CREDIT:
|
||||
return "HTC_REQUEST_CREDIT";
|
||||
case HTC_PROCESS_CREDIT_REPORT:
|
||||
return "HTC_PROCESS_CREDIT_REPORT";
|
||||
case HTC_SUSPEND_ACK:
|
||||
return "HTC_SUSPEND_ACK";
|
||||
case HTC_SUSPEND_NACK:
|
||||
return "HTC_SUSPEND_NACK";
|
||||
case HTC_INITIAL_WAKE_UP:
|
||||
return "HTC_INITIAL_WAKE_UP";
|
||||
default:
|
||||
return "Unknown htc_credit_exchange_type";
|
||||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
htc_credit_exchange_type type;
|
||||
uint64_t time;
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ static unsigned ep_debug_mask =
|
|||
|
||||
/* HTC Control Path Credit History */
|
||||
uint32_t g_htc_credit_history_idx = 0;
|
||||
uint32_t g_htc_credit_history_length;
|
||||
HTC_CREDIT_HISTORY htc_credit_history_buffer[HTC_CREDIT_HISTORY_MAX];
|
||||
|
||||
/**
|
||||
|
|
@ -85,9 +86,53 @@ void htc_credit_record(htc_credit_exchange_type type, uint32_t tx_credit,
|
|||
tx_credit;
|
||||
htc_credit_history_buffer[g_htc_credit_history_idx].htc_tx_queue_depth =
|
||||
htc_tx_queue_depth;
|
||||
|
||||
g_htc_credit_history_idx++;
|
||||
g_htc_credit_history_length++;
|
||||
}
|
||||
|
||||
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
||||
void htc_print_credit_history(HTC_HANDLE htc, uint32_t count,
|
||||
qdf_abstract_print *print, void *print_priv)
|
||||
{
|
||||
uint32_t idx;
|
||||
HTC_TARGET *target;
|
||||
|
||||
target = GET_HTC_TARGET_FROM_HANDLE(htc);
|
||||
LOCK_HTC_CREDIT(target);
|
||||
|
||||
if (count > HTC_CREDIT_HISTORY_MAX)
|
||||
count = HTC_CREDIT_HISTORY_MAX;
|
||||
if (count > g_htc_credit_history_length)
|
||||
count = g_htc_credit_history_length;
|
||||
|
||||
/* subtract count from index, and wrap if necessary */
|
||||
idx = HTC_CREDIT_HISTORY_MAX + g_htc_credit_history_idx - count;
|
||||
idx %= HTC_CREDIT_HISTORY_MAX;
|
||||
|
||||
print(print_priv,
|
||||
"Time (seconds) Type Credits Queue Depth");
|
||||
while (count) {
|
||||
HTC_CREDIT_HISTORY *hist = &htc_credit_history_buffer[idx];
|
||||
long long us = qdf_log_timestamp_to_usecs(hist->time);
|
||||
|
||||
print(print_priv, "% 8lld.%06lld %-25s %-7.d %d",
|
||||
us / 1000000,
|
||||
us % 1000000,
|
||||
htc_credit_exchange_type_str(hist->type),
|
||||
hist->tx_credit,
|
||||
hist->htc_tx_queue_depth);
|
||||
|
||||
--count;
|
||||
++idx;
|
||||
if (idx >= HTC_CREDIT_HISTORY_MAX)
|
||||
idx = 0;
|
||||
}
|
||||
|
||||
UNLOCK_HTC_CREDIT(target);
|
||||
}
|
||||
#endif /* WMI_INTERFACE_EVENT_LOGGING */
|
||||
|
||||
void htc_dump_counter_info(HTC_HANDLE HTCHandle)
|
||||
{
|
||||
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
|
||||
|
|
|
|||
Loading…
Reference in a new issue