qcacmn: Featurize packet log

Featurize packet log.

Change-Id: Ica7d658ef65486ae77e24a11cef50291a5e82563
CRs-Fixed: 2245424
This commit is contained in:
Nirav Shah
2018-05-17 16:58:12 +05:30
committed by nshrivas
parent 6cc647211d
commit c9b0931950
4 changed files with 69 additions and 41 deletions

View File

@@ -39,17 +39,21 @@ void wlan_logging_set_fw_flush_complete(void);
void wlan_flush_host_logs_for_fatal(void);
void wlan_logging_set_active(bool active);
void wlan_logging_set_log_to_console(bool log_to_console);
void wlan_deregister_txrx_packetdump(void);
void wlan_register_txrx_packetdump(void);
#else
static inline void wlan_flush_host_logs_for_fatal(void) {}
static inline void wlan_logging_set_per_pkt_stats(void) {}
static inline void wlan_logging_set_fw_flush_complete(void) {}
static inline void wlan_logging_set_active(bool active) {}
static inline void wlan_logging_set_log_to_console(bool log_to_console) {}
#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
#if defined(WLAN_LOGGING_SOCK_SVC_ENABLE) && !defined(REMOVE_PKT_LOG)
void wlan_deregister_txrx_packetdump(void);
void wlan_register_txrx_packetdump(void);
#else
static inline void wlan_deregister_txrx_packetdump(void) {}
static inline void wlan_register_txrx_packetdump(void) {}
#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
#endif
#if defined(WLAN_LOGGING_SOCK_SVC_ENABLE) && defined(FEATURE_WLAN_DIAG_SUPPORT)
void wlan_report_log_completion(uint32_t is_fatal,
@@ -67,7 +71,14 @@ static inline void wlan_report_log_completion(uint32_t is_fatal,
#endif /* FEATURE_WLAN_DIAG_SUPPORT */
#if defined(CONFIG_MCL) && !defined(REMOVE_PKT_LOG)
void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data);
#else
static inline
void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
{
}
#endif
#endif /* WLAN_LOGGING_SOCK_SVC_H */

View File

@@ -74,11 +74,6 @@ enum tx_status {
tx_status_peer_del,
};
#ifdef CONFIG_MCL
static uint8_t gtx_count;
static uint8_t grx_count;
#endif
#define LOGGING_TRACE(level, args ...) \
QDF_TRACE(QDF_MODULE_ID_HDD, level, ## args)
@@ -398,6 +393,28 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length)
return 0;
}
/**
* nl_srv_bcast_host_logs() - Wrapper to send bcast msgs to host logs mcast grp
* @skb: sk buffer pointer
*
* Sends the bcast message to host logs multicast group with generic nl socket
* if CNSS_GENL is enabled. Else, use the legacy netlink socket to send.
*
* Return: zero on success, error code otherwise
*/
#ifdef CNSS_GENL
static int nl_srv_bcast_host_logs(struct sk_buff *skb)
{
return nl_srv_bcast(skb, CLD80211_MCGRP_HOST_LOGS, ANI_NL_MSG_LOG);
}
#else
static int nl_srv_bcast_host_logs(struct sk_buff *skb)
{
return nl_srv_bcast(skb);
}
#endif
#ifndef REMOVE_PKT_LOG
/**
* pkt_stats_fill_headers() - This function adds headers to skb
* @skb: skb to which headers need to be added
@@ -484,24 +501,6 @@ static int nl_srv_bcast_diag(struct sk_buff *skb)
#endif
}
/**
* nl_srv_bcast_host_logs() - Wrapper to send bcast msgs to host logs mcast grp
* @skb: sk buffer pointer
*
* Sends the bcast message to host logs multicast group with generic nl socket
* if CNSS_GENL is enabled. Else, use the legacy netlink socket to send.
*
* Return: zero on success, error code otherwise
*/
static int nl_srv_bcast_host_logs(struct sk_buff *skb)
{
#ifdef CNSS_GENL
return nl_srv_bcast(skb, CLD80211_MCGRP_HOST_LOGS, ANI_NL_MSG_LOG);
#else
return nl_srv_bcast(skb);
#endif
}
/**
* pktlog_send_per_pkt_stats_to_user() - This function is used to send the per
* packet statistics to the user
@@ -510,7 +509,7 @@ static int nl_srv_bcast_host_logs(struct sk_buff *skb)
*
* Return: Success if the message is posted to user
*/
int pktlog_send_per_pkt_stats_to_user(void)
static int pktlog_send_per_pkt_stats_to_user(void)
{
int ret = -1;
struct pkt_stats_msg *pstats_msg;
@@ -573,6 +572,13 @@ err:
return ret;
}
#else
static inline
int pktlog_send_per_pkt_stats_to_user(void)
{
return 0;
}
#endif
static int send_filled_buffers_to_user(void)
{
@@ -1029,6 +1035,12 @@ void wlan_flush_host_logs_for_fatal(void)
#endif
}
#ifdef CONFIG_MCL
#ifndef REMOVE_PKT_LOG
static uint8_t gtx_count;
static uint8_t grx_count;
/**
* wlan_get_pkt_stats_free_node() - Get the free node for pkt stats
*
@@ -1060,9 +1072,7 @@ static int wlan_get_pkt_stats_free_node(void)
++gwlan_logging.pkt_stat_drop_cnt;
/* print every 64th drop count */
if (
#ifdef CONFIG_MCL
cds_is_multicast_logging() &&
#endif
(!(gwlan_logging.pkt_stat_drop_cnt % 0x40))) {
pr_err("%s: drop_count = %u\n",
__func__, gwlan_logging.pkt_stat_drop_cnt);
@@ -1089,7 +1099,6 @@ static int wlan_get_pkt_stats_free_node(void)
*/
void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
{
#ifdef CONFIG_MCL
struct ath_pktlog_hdr *pktlog_hdr;
struct packet_dump *pkt_stats_dump;
int total_stats_len = 0;
@@ -1156,10 +1165,8 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
set_bit(HOST_LOG_PER_PKT_STATS, &gwlan_logging.eventFlag);
wake_up_interruptible(&gwlan_logging.wait_queue);
}
#endif
}
#ifdef CONFIG_MCL
/**
* driver_hal_status_map() - maps driver to hal
* status
@@ -1191,7 +1198,6 @@ static void driver_hal_status_map(uint8_t *status)
}
}
/*
* send_packetdump() - send packet dump
* @netbuf: netbuf
@@ -1398,5 +1404,6 @@ void wlan_register_txrx_packetdump(void)
gtx_count = 0;
grx_count = 0;
}
#endif
#endif /* REMOVE_PKT_LOG */
#endif /* CONFIG_MCL */
#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */

View File

@@ -19,13 +19,13 @@
#ifndef _PKTLOG_AC_H_
#define _PKTLOG_AC_H_
#include "hif.h"
#ifndef REMOVE_PKT_LOG
#include "ol_if_athvar.h"
#include "osdep.h"
#include <wmi_unified.h>
#include <wmi_unified_api.h>
#include <wdi_event_api.h>
#include "hif.h"
#include <ol_defines.h>
#include <pktlog_ac_api.h>
#include <pktlog_ac_fmt.h>
@@ -60,7 +60,6 @@ extern void pktlog_release_buf(struct hif_opaque_softc *scn);
ssize_t pktlog_read_proc_entry(char *buf, size_t nbytes, loff_t *ppos,
struct ath_pktlog_info *pl_info, bool *read_complete);
int pktlog_send_per_pkt_stats_to_user(void);
A_STATUS wdi_pktlog_unsubscribe(struct cdp_pdev *txrx_pdev, uint32_t log_state);
struct ol_pl_arch_dep_funcs {
@@ -162,27 +161,36 @@ static inline void pktlog_init(struct hif_opaque_softc *scn)
{
return;
}
static int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
bool ini, uint8_t user, uint32_t is_iwpriv_command)
static inline int pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
bool ini, uint8_t user,
uint32_t is_iwpriv_command)
{
return 0;
}
static int pktlog_setsize(struct hif_opaque_softc *scn, int32_t log_state)
static inline int pktlog_setsize(struct hif_opaque_softc *scn,
int32_t log_state)
{
return 0;
}
static int pktlog_clearbuff(struct hif_opaque_softc *scn, bool clear_buff)
static inline int pktlog_clearbuff(struct hif_opaque_softc *scn,
bool clear_buff)
{
return 0;
}
static int pktlog_disable(struct hif_opaque_softc *scn)
static inline int pktlog_disable(struct hif_opaque_softc *scn)
{
return 0;
}
static inline int pktlog_htc_attach(void)
{
return 0;
}
static inline void pktlog_process_fw_msg(uint32_t *msg_word, uint32_t msg_len)
{ }
#endif /* REMOVE_PKT_LOG */

View File

@@ -21673,7 +21673,9 @@ struct wmi_ops tlv_ops = {
.send_bcn_buf_ll_cmd = send_bcn_buf_ll_cmd_tlv,
.send_roam_scan_offload_mode_cmd =
send_roam_scan_offload_mode_cmd_tlv,
#ifndef REMOVE_PKT_LOG
.send_pktlog_wmi_send_cmd = send_pktlog_wmi_send_cmd_tlv,
#endif
.send_roam_scan_offload_ap_profile_cmd =
send_roam_scan_offload_ap_profile_cmd_tlv,
#endif