diff options
author | Nirav Shah <nnshah@codeaurora.org> | 2018-05-17 16:58:12 +0530 |
---|---|---|
committer | Nitesh Shrivastav <nshrivas@codeaurora.org> | 2018-06-11 18:12:02 -0700 |
commit | a20aba022c0cc0d2c6b6f4642d23113b952b1807 (patch) | |
tree | 1bcd67d802b0586930746625add67c5a62c13dc0 /utils | |
parent | e8d23a0bef59286187121f232ead00a11ceb155d (diff) | |
download | qca-wfi-host-cmn-a20aba022c0cc0d2c6b6f4642d23113b952b1807.tar.gz |
qcacmn: Featurize packet log
Featurize packet log.
Change-Id: Ica7d658ef65486ae77e24a11cef50291a5e82563
CRs-Fixed: 2245424
Diffstat (limited to 'utils')
-rw-r--r-- | utils/logging/inc/wlan_logging_sock_svc.h | 17 | ||||
-rw-r--r-- | utils/logging/src/wlan_logging_sock_svc.c | 69 | ||||
-rw-r--r-- | utils/pktlog/include/pktlog_ac.h | 22 |
3 files changed, 67 insertions, 41 deletions
diff --git a/utils/logging/inc/wlan_logging_sock_svc.h b/utils/logging/inc/wlan_logging_sock_svc.h index c742a0fd7..bf538a2c6 100644 --- a/utils/logging/inc/wlan_logging_sock_svc.h +++ b/utils/logging/inc/wlan_logging_sock_svc.h @@ -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 */ diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index c91597f0e..fa6477a8d 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -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) @@ -399,6 +394,28 @@ int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length) } /** + * 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 * @@ -485,24 +502,6 @@ static int nl_srv_bcast_diag(struct sk_buff *skb) } /** - * 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 */ diff --git a/utils/pktlog/include/pktlog_ac.h b/utils/pktlog/include/pktlog_ac.h index 9727b7efc..21ff201ce 100644 --- a/utils/pktlog/include/pktlog_ac.h +++ b/utils/pktlog/include/pktlog_ac.h @@ -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 */ |