Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: ISC */
0002 /*
0003  * Copyright (C) 2021 Lorenzo Bianconi <lorenzo@kernel.org>
0004  */
0005 
0006 #if !defined(__MT7921_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
0007 #define __MT7921_TRACE_H
0008 
0009 #include <linux/tracepoint.h>
0010 #include "mt7921.h"
0011 
0012 #undef TRACE_SYSTEM
0013 #define TRACE_SYSTEM mt7921
0014 
0015 #define MAXNAME     32
0016 #define DEV_ENTRY   __array(char, wiphy_name, 32)
0017 #define DEV_ASSIGN  strlcpy(__entry->wiphy_name,    \
0018                 wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)
0019 #define DEV_PR_FMT  "%s"
0020 #define DEV_PR_ARG  __entry->wiphy_name
0021 #define LP_STATE_PR_ARG __entry->lp_state ? "lp ready" : "lp not ready"
0022 
0023 TRACE_EVENT(lp_event,
0024     TP_PROTO(struct mt7921_dev *dev, u8 lp_state),
0025 
0026     TP_ARGS(dev, lp_state),
0027 
0028     TP_STRUCT__entry(
0029         DEV_ENTRY
0030         __field(u8, lp_state)
0031     ),
0032 
0033     TP_fast_assign(
0034         DEV_ASSIGN;
0035         __entry->lp_state = lp_state;
0036     ),
0037 
0038     TP_printk(
0039         DEV_PR_FMT " %s",
0040         DEV_PR_ARG, LP_STATE_PR_ARG
0041     )
0042 );
0043 
0044 #endif
0045 
0046 #undef TRACE_INCLUDE_PATH
0047 #define TRACE_INCLUDE_PATH .
0048 #undef TRACE_INCLUDE_FILE
0049 #define TRACE_INCLUDE_FILE mt7921_trace
0050 
0051 #include <trace/define_trace.h>