Path: blob/main/sys/contrib/dev/athk/ath12k/trace.h
48378 views
/* SPDX-License-Identifier: BSD-3-Clause-Clear */1/*2* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.3* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.4*/56#if !defined(_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ)78#include <linux/tracepoint.h>9#include "core.h"1011#define _TRACE_H_1213/* create empty functions when tracing is disabled */14#if !defined(CONFIG_ATH12K_TRACING)15#undef TRACE_EVENT16#define TRACE_EVENT(name, proto, ...) \17static inline void trace_ ## name(proto) {}18#endif /* !CONFIG_ATH12K_TRACING || __CHECKER__ */1920#undef TRACE_SYSTEM21#define TRACE_SYSTEM ath12k2223TRACE_EVENT(ath12k_htt_pktlog,24TP_PROTO(struct ath12k *ar, const void *buf, u16 buf_len,25u32 pktlog_checksum),2627TP_ARGS(ar, buf, buf_len, pktlog_checksum),2829TP_STRUCT__entry(30__string(device, dev_name(ar->ab->dev))31__string(driver, dev_driver_string(ar->ab->dev))32__field(u16, buf_len)33__field(u32, pktlog_checksum)34__dynamic_array(u8, pktlog, buf_len)35),3637TP_fast_assign(38__assign_str(device, dev_name(ar->ab->dev));39__assign_str(driver, dev_driver_string(ar->ab->dev));40__entry->buf_len = buf_len;41__entry->pktlog_checksum = pktlog_checksum;42memcpy(__get_dynamic_array(pktlog), buf, buf_len);43),4445TP_printk(46"%s %s size %u pktlog_checksum %d",47__get_str(driver),48__get_str(device),49__entry->buf_len,50__entry->pktlog_checksum51)52);5354TRACE_EVENT(ath12k_htt_ppdu_stats,55TP_PROTO(struct ath12k *ar, const void *data, size_t len),5657TP_ARGS(ar, data, len),5859TP_STRUCT__entry(60__string(device, dev_name(ar->ab->dev))61__string(driver, dev_driver_string(ar->ab->dev))62__field(u16, len)63__field(u32, info)64__field(u32, sync_tstmp_lo_us)65__field(u32, sync_tstmp_hi_us)66__field(u32, mlo_offset_lo)67__field(u32, mlo_offset_hi)68__field(u32, mlo_offset_clks)69__field(u32, mlo_comp_clks)70__field(u32, mlo_comp_timer)71__dynamic_array(u8, ppdu, len)72),7374TP_fast_assign(75__assign_str(device, dev_name(ar->ab->dev));76__assign_str(driver, dev_driver_string(ar->ab->dev));77__entry->len = len;78__entry->info = ar->pdev->timestamp.info;79__entry->sync_tstmp_lo_us = ar->pdev->timestamp.sync_timestamp_hi_us;80__entry->sync_tstmp_hi_us = ar->pdev->timestamp.sync_timestamp_lo_us;81__entry->mlo_offset_lo = ar->pdev->timestamp.mlo_offset_lo;82__entry->mlo_offset_hi = ar->pdev->timestamp.mlo_offset_hi;83__entry->mlo_offset_clks = ar->pdev->timestamp.mlo_offset_clks;84__entry->mlo_comp_clks = ar->pdev->timestamp.mlo_comp_clks;85__entry->mlo_comp_timer = ar->pdev->timestamp.mlo_comp_timer;86memcpy(__get_dynamic_array(ppdu), data, len);87),8889TP_printk(90"%s %s ppdu len %d",91__get_str(driver),92__get_str(device),93__entry->len94)95);9697TRACE_EVENT(ath12k_htt_rxdesc,98TP_PROTO(struct ath12k *ar, const void *data, size_t type, size_t len),99100TP_ARGS(ar, data, type, len),101102TP_STRUCT__entry(103__string(device, dev_name(ar->ab->dev))104__string(driver, dev_driver_string(ar->ab->dev))105__field(u16, len)106__field(u16, type)107__field(u32, info)108__field(u32, sync_tstmp_lo_us)109__field(u32, sync_tstmp_hi_us)110__field(u32, mlo_offset_lo)111__field(u32, mlo_offset_hi)112__field(u32, mlo_offset_clks)113__field(u32, mlo_comp_clks)114__field(u32, mlo_comp_timer)115__dynamic_array(u8, rxdesc, len)116),117118TP_fast_assign(119__assign_str(device, dev_name(ar->ab->dev));120__assign_str(driver, dev_driver_string(ar->ab->dev));121__entry->len = len;122__entry->type = type;123__entry->info = ar->pdev->timestamp.info;124__entry->sync_tstmp_lo_us = ar->pdev->timestamp.sync_timestamp_hi_us;125__entry->sync_tstmp_hi_us = ar->pdev->timestamp.sync_timestamp_lo_us;126__entry->mlo_offset_lo = ar->pdev->timestamp.mlo_offset_lo;127__entry->mlo_offset_hi = ar->pdev->timestamp.mlo_offset_hi;128__entry->mlo_offset_clks = ar->pdev->timestamp.mlo_offset_clks;129__entry->mlo_comp_clks = ar->pdev->timestamp.mlo_comp_clks;130__entry->mlo_comp_timer = ar->pdev->timestamp.mlo_comp_timer;131memcpy(__get_dynamic_array(rxdesc), data, len);132),133134TP_printk(135"%s %s rxdesc len %d",136__get_str(driver),137__get_str(device),138__entry->len139)140);141142#endif /* _TRACE_H_ || TRACE_HEADER_MULTI_READ*/143144/* we don't want to use include/trace/events */145#undef TRACE_INCLUDE_PATH146#define TRACE_INCLUDE_PATH .147#undef TRACE_INCLUDE_FILE148#define TRACE_INCLUDE_FILE trace149150/* This part must be outside protection */151#include <trace/define_trace.h>152153154