brintos

brintos / linux-shallow public Read only

0
0
Text · 1.8 KiB · 11d119c Raw
88 lines · c
1/* SPDX-License-Identifier: ISC */2/*3 * Copyright (C) 2016 Felix Fietkau <nbd@nbd.name>4 */5 6#if !defined(__MT76x02_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)7#define __MT76x02_TRACE_H8 9#include <linux/tracepoint.h>10#include "mt76x02.h"11 12#undef TRACE_SYSTEM13#define TRACE_SYSTEM mt76x0214 15#define MAXNAME		3216#define DEV_ENTRY	__array(char, wiphy_name, 32)17#define DEV_ASSIGN	strscpy(__entry->wiphy_name,	\18				wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)19#define DEV_PR_FMT	"%s"20#define DEV_PR_ARG	__entry->wiphy_name21 22#define TXID_ENTRY	__field(u8, wcid) __field(u8, pktid)23#define TXID_PR_FMT	" [%d:%d]"24#define TXID_PR_ARG	__entry->wcid, __entry->pktid25 26DECLARE_EVENT_CLASS(dev_evt,27	TP_PROTO(struct mt76x02_dev *dev),28	TP_ARGS(dev),29	TP_STRUCT__entry(30		DEV_ENTRY31	),32	TP_fast_assign(33		DEV_ASSIGN;34	),35	TP_printk(DEV_PR_FMT, DEV_PR_ARG)36);37 38DEFINE_EVENT(dev_evt, mac_txstat_poll,39	TP_PROTO(struct mt76x02_dev *dev),40	TP_ARGS(dev)41);42 43TRACE_EVENT(mac_txstat_fetch,44	TP_PROTO(struct mt76x02_dev *dev,45		 struct mt76x02_tx_status *stat),46 47	TP_ARGS(dev, stat),48 49	TP_STRUCT__entry(50		DEV_ENTRY51		TXID_ENTRY52		__field(bool, success)53		__field(bool, aggr)54		__field(bool, ack_req)55		__field(u16, rate)56		__field(u8, retry)57	),58 59	TP_fast_assign(60		DEV_ASSIGN;61		__entry->success = stat->success;62		__entry->aggr = stat->aggr;63		__entry->ack_req = stat->ack_req;64		__entry->wcid = stat->wcid;65		__entry->pktid = stat->pktid;66		__entry->rate = stat->rate;67		__entry->retry = stat->retry;68	),69 70	TP_printk(71		DEV_PR_FMT TXID_PR_FMT72		" success:%d aggr:%d ack_req:%d"73		" rate:%04x retry:%d",74		DEV_PR_ARG, TXID_PR_ARG,75		__entry->success, __entry->aggr, __entry->ack_req,76		__entry->rate, __entry->retry77	)78);79 80#endif81 82#undef TRACE_INCLUDE_PATH83#define TRACE_INCLUDE_PATH .84#undef TRACE_INCLUDE_FILE85#define TRACE_INCLUDE_FILE mt76x02_trace86 87#include <trace/define_trace.h>88