162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#undef TRACE_SYSTEM
362306a36Sopenharmony_ci#define TRACE_SYSTEM sunvnet
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#if !defined(_TRACE_SUNVNET_H) || defined(TRACE_HEADER_MULTI_READ)
662306a36Sopenharmony_ci#define _TRACE_SUNVNET_H
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <linux/tracepoint.h>
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ciTRACE_EVENT(vnet_rx_one,
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci	TP_PROTO(int lsid, int rsid, int index, int needs_ack),
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci	TP_ARGS(lsid, rsid, index, needs_ack),
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci	TP_STRUCT__entry(
1762306a36Sopenharmony_ci		__field(int, lsid)
1862306a36Sopenharmony_ci		__field(int, rsid)
1962306a36Sopenharmony_ci		__field(int, index)
2062306a36Sopenharmony_ci		__field(int, needs_ack)
2162306a36Sopenharmony_ci	),
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci	TP_fast_assign(
2462306a36Sopenharmony_ci		__entry->lsid = lsid;
2562306a36Sopenharmony_ci		__entry->rsid = rsid;
2662306a36Sopenharmony_ci		__entry->index = index;
2762306a36Sopenharmony_ci		__entry->needs_ack = needs_ack;
2862306a36Sopenharmony_ci	),
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci	TP_printk("(%x:%x) walk_rx_one index %d; needs_ack %d",
3162306a36Sopenharmony_ci		__entry->lsid, __entry->rsid,
3262306a36Sopenharmony_ci		__entry->index, __entry->needs_ack)
3362306a36Sopenharmony_ci);
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ciDECLARE_EVENT_CLASS(vnet_tx_stopped_ack_template,
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci	TP_PROTO(int lsid, int rsid, int ack_end, int npkts),
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci	TP_ARGS(lsid, rsid, ack_end, npkts),
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	TP_STRUCT__entry(
4262306a36Sopenharmony_ci		__field(int, lsid)
4362306a36Sopenharmony_ci		__field(int, rsid)
4462306a36Sopenharmony_ci		__field(int, ack_end)
4562306a36Sopenharmony_ci		__field(int, npkts)
4662306a36Sopenharmony_ci	),
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci	TP_fast_assign(
4962306a36Sopenharmony_ci		__entry->lsid = lsid;
5062306a36Sopenharmony_ci		__entry->rsid = rsid;
5162306a36Sopenharmony_ci		__entry->ack_end = ack_end;
5262306a36Sopenharmony_ci		__entry->npkts = npkts;
5362306a36Sopenharmony_ci	),
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci	TP_printk("(%x:%x) stopped ack for %d; npkts %d",
5662306a36Sopenharmony_ci		__entry->lsid, __entry->rsid,
5762306a36Sopenharmony_ci		__entry->ack_end, __entry->npkts)
5862306a36Sopenharmony_ci);
5962306a36Sopenharmony_ciDEFINE_EVENT(vnet_tx_stopped_ack_template, vnet_tx_send_stopped_ack,
6062306a36Sopenharmony_ci	     TP_PROTO(int lsid, int rsid, int ack_end, int npkts),
6162306a36Sopenharmony_ci	     TP_ARGS(lsid, rsid, ack_end, npkts));
6262306a36Sopenharmony_ciDEFINE_EVENT(vnet_tx_stopped_ack_template, vnet_tx_defer_stopped_ack,
6362306a36Sopenharmony_ci	     TP_PROTO(int lsid, int rsid, int ack_end, int npkts),
6462306a36Sopenharmony_ci	     TP_ARGS(lsid, rsid, ack_end, npkts));
6562306a36Sopenharmony_ciDEFINE_EVENT(vnet_tx_stopped_ack_template, vnet_tx_pending_stopped_ack,
6662306a36Sopenharmony_ci	     TP_PROTO(int lsid, int rsid, int ack_end, int npkts),
6762306a36Sopenharmony_ci	     TP_ARGS(lsid, rsid, ack_end, npkts));
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ciTRACE_EVENT(vnet_rx_stopped_ack,
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci	TP_PROTO(int lsid, int rsid, int end),
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci	TP_ARGS(lsid, rsid, end),
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci	TP_STRUCT__entry(
7662306a36Sopenharmony_ci		__field(int, lsid)
7762306a36Sopenharmony_ci		__field(int, rsid)
7862306a36Sopenharmony_ci		__field(int, end)
7962306a36Sopenharmony_ci	),
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci	TP_fast_assign(
8262306a36Sopenharmony_ci		__entry->lsid = lsid;
8362306a36Sopenharmony_ci		__entry->rsid = rsid;
8462306a36Sopenharmony_ci		__entry->end = end;
8562306a36Sopenharmony_ci	),
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci	TP_printk("(%x:%x) stopped ack for index %d",
8862306a36Sopenharmony_ci		__entry->lsid, __entry->rsid, __entry->end)
8962306a36Sopenharmony_ci);
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ciTRACE_EVENT(vnet_tx_trigger,
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci	TP_PROTO(int lsid, int rsid, int start, int err),
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci	TP_ARGS(lsid, rsid, start, err),
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci	TP_STRUCT__entry(
9862306a36Sopenharmony_ci		__field(int, lsid)
9962306a36Sopenharmony_ci		__field(int, rsid)
10062306a36Sopenharmony_ci		__field(int, start)
10162306a36Sopenharmony_ci		__field(int, err)
10262306a36Sopenharmony_ci	),
10362306a36Sopenharmony_ci
10462306a36Sopenharmony_ci	TP_fast_assign(
10562306a36Sopenharmony_ci		__entry->lsid = lsid;
10662306a36Sopenharmony_ci		__entry->rsid = rsid;
10762306a36Sopenharmony_ci		__entry->start = start;
10862306a36Sopenharmony_ci		__entry->err = err;
10962306a36Sopenharmony_ci	),
11062306a36Sopenharmony_ci
11162306a36Sopenharmony_ci	TP_printk("(%x:%x) Tx trigger for %d sent with err %d %s",
11262306a36Sopenharmony_ci		__entry->lsid, __entry->rsid, __entry->start,
11362306a36Sopenharmony_ci		__entry->err, __entry->err > 0 ? "(ok)" : " ")
11462306a36Sopenharmony_ci);
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ciTRACE_EVENT(vnet_skip_tx_trigger,
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci	TP_PROTO(int lsid, int rsid, int last),
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci	TP_ARGS(lsid, rsid, last),
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci	TP_STRUCT__entry(
12362306a36Sopenharmony_ci		__field(int, lsid)
12462306a36Sopenharmony_ci		__field(int, rsid)
12562306a36Sopenharmony_ci		__field(int, last)
12662306a36Sopenharmony_ci	),
12762306a36Sopenharmony_ci
12862306a36Sopenharmony_ci	TP_fast_assign(
12962306a36Sopenharmony_ci		__entry->lsid = lsid;
13062306a36Sopenharmony_ci		__entry->rsid = rsid;
13162306a36Sopenharmony_ci		__entry->last = last;
13262306a36Sopenharmony_ci	),
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci	TP_printk("(%x:%x) Skip Tx trigger. Last trigger sent was %d",
13562306a36Sopenharmony_ci		__entry->lsid, __entry->rsid, __entry->last)
13662306a36Sopenharmony_ci);
13762306a36Sopenharmony_ci#endif /* _TRACE_SOCK_H */
13862306a36Sopenharmony_ci
13962306a36Sopenharmony_ci/* This part must be outside protection */
14062306a36Sopenharmony_ci#include <trace/define_trace.h>
141