summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt7921/mt7921_trace.h
blob: 9bc4db67f352d83238099971c0768004cf29b976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* SPDX-License-Identifier: ISC */
/*
 * Copyright (C) 2021 Lorenzo Bianconi <lorenzo@kernel.org>
 */

#if !defined(__MT7921_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define __MT7921_TRACE_H

#include <linux/tracepoint.h>
#include "mt7921.h"

#undef TRACE_SYSTEM
#define TRACE_SYSTEM mt7921

#define MAXNAME		32
#define DEV_ENTRY	__array(char, wiphy_name, 32)
#define DEV_ASSIGN	strlcpy(__entry->wiphy_name,	\
				wiphy_name(mt76_hw(dev)->wiphy), MAXNAME)
#define DEV_PR_FMT	"%s"
#define DEV_PR_ARG	__entry->wiphy_name
#define LP_STATE_PR_ARG	__entry->lp_state ? "lp ready" : "lp not ready"

TRACE_EVENT(lp_event,
	TP_PROTO(struct mt7921_dev *dev, u8 lp_state),

	TP_ARGS(dev, lp_state),

	TP_STRUCT__entry(
		DEV_ENTRY
		__field(u8, lp_state)
	),

	TP_fast_assign(
		DEV_ASSIGN;
		__entry->lp_state = lp_state;
	),

	TP_printk(
		DEV_PR_FMT " %s",
		DEV_PR_ARG, LP_STATE_PR_ARG
	)
);

#endif

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE mt7921_trace

#include <trace/define_trace.h>