qcacmn: Add DP event history in non debug mode
Enable DP event history for perf mode. Change-Id: I1b8863928f956aa39488ea357d56e182613aad8d CRs-Fixed: 2846844
This commit is contained in:
@@ -334,10 +334,30 @@ enum hif_event_type {
|
|||||||
|
|
||||||
#ifdef WLAN_FEATURE_DP_EVENT_HISTORY
|
#ifdef WLAN_FEATURE_DP_EVENT_HISTORY
|
||||||
|
|
||||||
|
#if defined(HIF_CONFIG_SLUB_DEBUG_ON) || defined(HIF_CE_DEBUG_DATA_BUF)
|
||||||
/* HIF_EVENT_HIST_MAX should always be power of 2 */
|
/* HIF_EVENT_HIST_MAX should always be power of 2 */
|
||||||
#define HIF_EVENT_HIST_MAX 512
|
#define HIF_EVENT_HIST_MAX 512
|
||||||
#define HIF_NUM_INT_CONTEXTS HIF_MAX_GROUP
|
#define HIF_NUM_INT_CONTEXTS HIF_MAX_GROUP
|
||||||
#define HIF_EVENT_HIST_DISABLE_MASK 0
|
#define HIF_EVENT_HIST_ENABLE_MASK 0x3F
|
||||||
|
|
||||||
|
static inline uint64_t hif_get_log_timestamp(void)
|
||||||
|
{
|
||||||
|
return qdf_get_log_timestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define HIF_EVENT_HIST_MAX 32
|
||||||
|
#define HIF_NUM_INT_CONTEXTS HIF_MAX_GROUP
|
||||||
|
/* Enable IRQ TRIGGER, NAPI SCHEDULE, SRNG ACCESS START */
|
||||||
|
#define HIF_EVENT_HIST_ENABLE_MASK 0x19
|
||||||
|
|
||||||
|
static inline uint64_t hif_get_log_timestamp(void)
|
||||||
|
{
|
||||||
|
return qdf_sched_clock();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct hif_event_record - an entry of the DP event history
|
* struct hif_event_record - an entry of the DP event history
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -134,7 +134,7 @@ void hif_hist_record_event(struct hif_opaque_softc *hif_ctx,
|
|||||||
struct hif_event_record *record;
|
struct hif_event_record *record;
|
||||||
int record_index;
|
int record_index;
|
||||||
|
|
||||||
if (scn->event_disable_mask & BIT(event->type))
|
if (!(scn->event_enable_mask & BIT(event->type)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (qdf_unlikely(intr_grp_id >= HIF_NUM_INT_CONTEXTS)) {
|
if (qdf_unlikely(intr_grp_id >= HIF_NUM_INT_CONTEXTS)) {
|
||||||
@@ -156,14 +156,14 @@ void hif_hist_record_event(struct hif_opaque_softc *hif_ctx,
|
|||||||
|
|
||||||
if (event->type == HIF_EVENT_IRQ_TRIGGER) {
|
if (event->type == HIF_EVENT_IRQ_TRIGGER) {
|
||||||
hist_ev->misc.last_irq_index = record_index;
|
hist_ev->misc.last_irq_index = record_index;
|
||||||
hist_ev->misc.last_irq_ts = qdf_get_log_timestamp();
|
hist_ev->misc.last_irq_ts = hif_get_log_timestamp();
|
||||||
}
|
}
|
||||||
|
|
||||||
record->hal_ring_id = event->hal_ring_id;
|
record->hal_ring_id = event->hal_ring_id;
|
||||||
record->hp = event->hp;
|
record->hp = event->hp;
|
||||||
record->tp = event->tp;
|
record->tp = event->tp;
|
||||||
record->cpu_id = qdf_get_cpu();
|
record->cpu_id = qdf_get_cpu();
|
||||||
record->timestamp = qdf_get_log_timestamp();
|
record->timestamp = hif_get_log_timestamp();
|
||||||
record->type = event->type;
|
record->type = event->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -186,7 +186,7 @@ struct hif_softc {
|
|||||||
/* Packet statistics */
|
/* Packet statistics */
|
||||||
struct hif_ce_stats pkt_stats;
|
struct hif_ce_stats pkt_stats;
|
||||||
enum hif_target_status target_status;
|
enum hif_target_status target_status;
|
||||||
uint64_t event_disable_mask;
|
uint64_t event_enable_mask;
|
||||||
|
|
||||||
struct targetdef_s *targetdef;
|
struct targetdef_s *targetdef;
|
||||||
struct ce_reg_def *target_ce_def;
|
struct ce_reg_def *target_ce_def;
|
||||||
@@ -324,7 +324,7 @@ static inline void hif_set_event_hist_mask(struct hif_opaque_softc *hif_handle)
|
|||||||
{
|
{
|
||||||
struct hif_softc *scn = (struct hif_softc *)hif_handle;
|
struct hif_softc *scn = (struct hif_softc *)hif_handle;
|
||||||
|
|
||||||
scn->event_disable_mask = HIF_EVENT_HIST_DISABLE_MASK;
|
scn->event_enable_mask = HIF_EVENT_HIST_ENABLE_MASK;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static inline void hif_set_event_hist_mask(struct hif_opaque_softc *hif_handle)
|
static inline void hif_set_event_hist_mask(struct hif_opaque_softc *hif_handle)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -249,6 +249,16 @@ static inline bool qdf_system_time_after_eq(qdf_time_t a, qdf_time_t b)
|
|||||||
return __qdf_system_time_after_eq(a, b);
|
return __qdf_system_time_after_eq(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_sched_clock() - use light weight timer to get timestamp for logging
|
||||||
|
*
|
||||||
|
* Return: timestamp in ns
|
||||||
|
*/
|
||||||
|
static inline uint64_t qdf_sched_clock(void)
|
||||||
|
{
|
||||||
|
return __qdf_sched_clock();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* enum qdf_timestamp_unit - what unit the qdf timestamp is in
|
* enum qdf_timestamp_unit - what unit the qdf timestamp is in
|
||||||
* @KERNEL_LOG: boottime time in uS (micro seconds)
|
* @KERNEL_LOG: boottime time in uS (micro seconds)
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -27,6 +27,11 @@
|
|||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
|
||||||
|
#include <linux/sched/clock.h>
|
||||||
|
#else
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#endif
|
||||||
#include <linux/ktime.h>
|
#include <linux/ktime.h>
|
||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0))
|
||||||
#include <linux/timekeeping.h>
|
#include <linux/timekeeping.h>
|
||||||
@@ -250,6 +255,16 @@ static inline bool __qdf_system_time_after_eq(__qdf_time_t a, __qdf_time_t b)
|
|||||||
return (long)(a) - (long)(b) >= 0;
|
return (long)(a) - (long)(b) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_sched_clock() - use light weight timer to get timestamp
|
||||||
|
*
|
||||||
|
* Return: timestamp in ns
|
||||||
|
*/
|
||||||
|
static inline uint64_t __qdf_sched_clock(void)
|
||||||
|
{
|
||||||
|
return sched_clock();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __qdf_get_monotonic_boottime() - get monotonic kernel boot time
|
* __qdf_get_monotonic_boottime() - get monotonic kernel boot time
|
||||||
* This API is similar to qdf_get_system_boottime but it includes
|
* This API is similar to qdf_get_system_boottime but it includes
|
||||||
|
Reference in New Issue
Block a user