summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2016-09-23 13:50:40 +0100
committerDavid Howells <dhowells@redhat.com>2016-09-23 15:49:19 +0100
commit9c7ad434441da6b5d4ac878cac368fbdaec99b56 (patch)
treea86f83d437f8772c0865df213f27265bc826ed60 /include/trace
parent89b475abdb107a74f57497b65becaf837a0e5b6b (diff)
rxrpc: Add tracepoint for ACK proposal
Add a tracepoint to log proposed ACKs, including whether the proposal is used to update a pending ACK or is discarded in favour of an easlier, higher priority ACK. Whilst we're at it, get rid of the rxrpc_acks() function and access the name array directly. We do, however, need to validate the ACK reason number given to trace_rxrpc_rx_ack() to make sure we don't overrun the array. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/rxrpc.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/include/trace/events/rxrpc.h b/include/trace/events/rxrpc.h
index 9413b17ba04b..d67a8c6b085a 100644
--- a/include/trace/events/rxrpc.h
+++ b/include/trace/events/rxrpc.h
@@ -251,7 +251,7 @@ TRACE_EVENT(rxrpc_rx_ack,
TP_printk("c=%p %s f=%08x n=%u",
__entry->call,
- rxrpc_acks(__entry->reason),
+ rxrpc_ack_names[__entry->reason],
__entry->first,
__entry->n_acks)
);
@@ -314,7 +314,7 @@ TRACE_EVENT(rxrpc_tx_ack,
TP_printk(" c=%p ACK %08x %s f=%08x r=%08x n=%u",
__entry->call,
__entry->serial,
- rxrpc_acks(__entry->reason),
+ rxrpc_ack_names[__entry->reason],
__entry->ack_first,
__entry->ack_serial,
__entry->n_acks)
@@ -505,6 +505,44 @@ TRACE_EVENT(rxrpc_rx_lose,
__entry->hdr.type <= 15 ? rxrpc_pkts[__entry->hdr.type] : "?UNK")
);
+TRACE_EVENT(rxrpc_propose_ack,
+ TP_PROTO(struct rxrpc_call *call, enum rxrpc_propose_ack_trace why,
+ u8 ack_reason, rxrpc_serial_t serial, bool immediate,
+ bool background, enum rxrpc_propose_ack_outcome outcome),
+
+ TP_ARGS(call, why, ack_reason, serial, immediate, background,
+ outcome),
+
+ TP_STRUCT__entry(
+ __field(struct rxrpc_call *, call )
+ __field(enum rxrpc_propose_ack_trace, why )
+ __field(rxrpc_serial_t, serial )
+ __field(u8, ack_reason )
+ __field(bool, immediate )
+ __field(bool, background )
+ __field(enum rxrpc_propose_ack_outcome, outcome )
+ ),
+
+ TP_fast_assign(
+ __entry->call = call;
+ __entry->why = why;
+ __entry->serial = serial;
+ __entry->ack_reason = ack_reason;
+ __entry->immediate = immediate;
+ __entry->background = background;
+ __entry->outcome = outcome;
+ ),
+
+ TP_printk("c=%p %s %s r=%08x i=%u b=%u%s",
+ __entry->call,
+ rxrpc_propose_ack_traces[__entry->why],
+ rxrpc_ack_names[__entry->ack_reason],
+ __entry->serial,
+ __entry->immediate,
+ __entry->background,
+ rxrpc_propose_ack_outcomes[__entry->outcome])
+ );
+
#endif /* _TRACE_RXRPC_H */
/* This part must be outside protection */