1*c74df1c0SLorenzo Bianconi /* SPDX-License-Identifier: ISC */ 2*c74df1c0SLorenzo Bianconi /* 3*c74df1c0SLorenzo Bianconi * Copyright (C) 2023 Lorenzo Bianconi <lorenzo@kernel.org> 4*c74df1c0SLorenzo Bianconi */ 5*c74df1c0SLorenzo Bianconi 6*c74df1c0SLorenzo Bianconi #if !defined(__MT792X_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 7*c74df1c0SLorenzo Bianconi #define __MT792X_TRACE_H 8*c74df1c0SLorenzo Bianconi 9*c74df1c0SLorenzo Bianconi #include <linux/tracepoint.h> 10*c74df1c0SLorenzo Bianconi #include "mt792x.h" 11*c74df1c0SLorenzo Bianconi 12*c74df1c0SLorenzo Bianconi #undef TRACE_SYSTEM 13*c74df1c0SLorenzo Bianconi #define TRACE_SYSTEM mt792x 14*c74df1c0SLorenzo Bianconi 15*c74df1c0SLorenzo Bianconi #define MAXNAME 32 16*c74df1c0SLorenzo Bianconi #define DEV_ENTRY __array(char, wiphy_name, 32) 17*c74df1c0SLorenzo Bianconi #define DEV_ASSIGN strscpy(__entry->wiphy_name, \ 18*c74df1c0SLorenzo Bianconi wiphy_name(mt76_hw(dev)->wiphy), MAXNAME) 19*c74df1c0SLorenzo Bianconi #define DEV_PR_FMT "%s" 20*c74df1c0SLorenzo Bianconi #define DEV_PR_ARG __entry->wiphy_name 21*c74df1c0SLorenzo Bianconi #define LP_STATE_PR_ARG __entry->lp_state ? "lp ready" : "lp not ready" 22*c74df1c0SLorenzo Bianconi 23*c74df1c0SLorenzo Bianconi TRACE_EVENT(lp_event, 24*c74df1c0SLorenzo Bianconi TP_PROTO(struct mt792x_dev *dev, u8 lp_state), 25*c74df1c0SLorenzo Bianconi 26*c74df1c0SLorenzo Bianconi TP_ARGS(dev, lp_state), 27*c74df1c0SLorenzo Bianconi 28*c74df1c0SLorenzo Bianconi TP_STRUCT__entry( 29*c74df1c0SLorenzo Bianconi DEV_ENTRY 30*c74df1c0SLorenzo Bianconi __field(u8, lp_state) 31*c74df1c0SLorenzo Bianconi ), 32*c74df1c0SLorenzo Bianconi 33*c74df1c0SLorenzo Bianconi TP_fast_assign( 34*c74df1c0SLorenzo Bianconi DEV_ASSIGN; 35*c74df1c0SLorenzo Bianconi __entry->lp_state = lp_state; 36*c74df1c0SLorenzo Bianconi ), 37*c74df1c0SLorenzo Bianconi 38*c74df1c0SLorenzo Bianconi TP_printk( 39*c74df1c0SLorenzo Bianconi DEV_PR_FMT " %s", 40*c74df1c0SLorenzo Bianconi DEV_PR_ARG, LP_STATE_PR_ARG 41*c74df1c0SLorenzo Bianconi ) 42*c74df1c0SLorenzo Bianconi ); 43*c74df1c0SLorenzo Bianconi 44*c74df1c0SLorenzo Bianconi #endif 45*c74df1c0SLorenzo Bianconi 46*c74df1c0SLorenzo Bianconi #undef TRACE_INCLUDE_PATH 47*c74df1c0SLorenzo Bianconi #define TRACE_INCLUDE_PATH . 48*c74df1c0SLorenzo Bianconi #undef TRACE_INCLUDE_FILE 49*c74df1c0SLorenzo Bianconi #define TRACE_INCLUDE_FILE mt792x_trace 50*c74df1c0SLorenzo Bianconi 51*c74df1c0SLorenzo Bianconi #include <trace/define_trace.h> 52