
To aid in debugging memory leaks, and improve the robustness of log recovery from crash dumps, statically allocate pglog_msg in the global scope. This allows logs to be inspected even in cases where a crash came late in the unload process. It also improves log recovery robustness by removing the possibility of using a NULL pointer offset under certain memory corruptions scenarios. Change-Id: I077198e358570661c2f3adf2704f2c48f4b2f6f8 CRs-Fixed: 2078548
86 行
2.7 KiB
C
86 行
2.7 KiB
C
/*
|
|
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
|
*
|
|
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
|
*
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
* above copyright notice and this permission notice appear in all
|
|
* copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
/*
|
|
* This file was originally distributed by Qualcomm Atheros, Inc.
|
|
* under proprietary terms before Copyright ownership was assigned
|
|
* to the Linux Foundation.
|
|
*/
|
|
|
|
/******************************************************************************
|
|
* wlan_logging_sock_svc.h
|
|
*
|
|
******************************************************************************/
|
|
|
|
#ifndef WLAN_LOGGING_SOCK_SVC_H
|
|
#define WLAN_LOGGING_SOCK_SVC_H
|
|
|
|
#include <wlan_nlink_srv.h>
|
|
#include <qdf_status.h>
|
|
#include <qdf_trace.h>
|
|
#include <wlan_nlink_common.h>
|
|
|
|
int wlan_logging_sock_init_svc(void);
|
|
int wlan_logging_sock_deinit_svc(void);
|
|
int wlan_log_to_user(QDF_TRACE_LEVEL log_level, char *to_be_sent, int length);
|
|
|
|
#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
|
|
void wlan_logging_set_per_pkt_stats(void);
|
|
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);
|
|
#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)
|
|
{
|
|
}
|
|
void wlan_logging_set_active(bool active) {}
|
|
void wlan_logging_set_log_to_console(bool log_to_console) {}
|
|
#endif /* WLAN_LOGGING_SOCK_SVC_ENABLE */
|
|
|
|
#ifdef FEATURE_WLAN_DIAG_SUPPORT
|
|
void wlan_report_log_completion(uint32_t is_fatal,
|
|
uint32_t indicator,
|
|
uint32_t reason_code,
|
|
uint8_t ring_id);
|
|
#else
|
|
static inline void wlan_report_log_completion(uint32_t is_fatal,
|
|
uint32_t indicator,
|
|
uint32_t reason_code)
|
|
{
|
|
return;
|
|
}
|
|
|
|
#endif /* FEATURE_WLAN_DIAG_SUPPORT */
|
|
|
|
void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data);
|
|
|
|
void wlan_deregister_txrx_packetdump(void);
|
|
void wlan_register_txrx_packetdump(void);
|
|
|
|
#endif /* WLAN_LOGGING_SOCK_SVC_H */
|