mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacmn: Print all elements of serialization history circular buffer
In the current implementation, we print the ser history from index 0 to the current index of the ciruclar buffer, so when buffer overflows we print only few recent items. Instead, we should print all the elements in the circular buffer starting from current index to entire length of the circular buffer. This will print all the elements in the circular buffer when it overflows and also takes care of printing required items when buffer is not overflown. Change-Id: I6c54cb34de7a1ba24ee0204004cc9a203173c66b CRs-Fixed: 2430483
This commit is contained in:
parent
1ab908e62b
commit
445a3a5889
2 changed files with 13 additions and 8 deletions
|
|
@ -117,28 +117,31 @@ static void wlan_ser_print_all_history(
|
|||
uint32_t vdev_id)
|
||||
{
|
||||
uint8_t idx;
|
||||
uint8_t data_idx;
|
||||
struct ser_history *history_info;
|
||||
struct ser_data *data;
|
||||
|
||||
history_info = &pdev_queue->history;
|
||||
|
||||
if (!history_info->index)
|
||||
return;
|
||||
|
||||
ser_err_no_fl(WLAN_SER_LINE WLAN_SER_LINE);
|
||||
ser_err_no_fl("Queue Commands History");
|
||||
ser_err_no_fl(WLAN_SER_LINE WLAN_SER_LINE);
|
||||
ser_err_no_fl(WLAN_SER_HISTORY_HEADER);
|
||||
ser_err_no_fl(WLAN_SER_LINE WLAN_SER_LINE);
|
||||
|
||||
for (idx = 0; idx < history_info->index; idx++) {
|
||||
data = &history_info->data[idx];
|
||||
for (idx = 0; idx < SER_MAX_HISTORY_CMDS; idx++) {
|
||||
data_idx = (history_info->index + idx) % SER_MAX_HISTORY_CMDS;
|
||||
|
||||
data = &history_info->data[data_idx];
|
||||
|
||||
if (data->ser_reason >= SER_QUEUE_ACTION_MAX) {
|
||||
ser_err("Invalid Serialization Reason");
|
||||
ser_debug("Invalid Serialization Reason");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!data->data_updated)
|
||||
continue;
|
||||
|
||||
if (for_vdev_queue) {
|
||||
if (vdev_id != data->vdev_id)
|
||||
continue;
|
||||
|
|
@ -243,6 +246,7 @@ void wlan_ser_update_cmd_history(
|
|||
ser_data_info->active_pending = active_queue;
|
||||
ser_data_info->ser_reason = ser_reason;
|
||||
ser_data_info->vdev_id = wlan_vdev_get_id(cmd->vdev);
|
||||
ser_data_info->data_updated = true;
|
||||
|
||||
ser_history_info->index++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
|
|
@ -56,7 +56,8 @@ struct ser_data {
|
|||
is_high_priority:1,
|
||||
add_remove:1,
|
||||
active_pending:1,
|
||||
ser_reason:6;
|
||||
data_updated:1,
|
||||
ser_reason:5;
|
||||
|
||||
uint16_t vdev_id;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue