rxrpc: Add a tracepoint for the call timer
Add a tracepoint to log call timer initiation, setting and expiry.
Signed-off-by: David Howells <dhowells@redhat.com>
diff --git a/net/rxrpc/ar-internal.h b/net/rxrpc/ar-internal.h
index a494d56..e564eca 100644
--- a/net/rxrpc/ar-internal.h
+++ b/net/rxrpc/ar-internal.h
@@ -678,6 +678,17 @@
extern const char rxrpc_rtt_rx_traces[rxrpc_rtt_rx__nr_trace][5];
+enum rxrpc_timer_trace {
+ rxrpc_timer_begin,
+ rxrpc_timer_expired,
+ rxrpc_timer_set_for_ack,
+ rxrpc_timer_set_for_resend,
+ rxrpc_timer_set_for_send,
+ rxrpc_timer__nr_trace
+};
+
+extern const char rxrpc_timer_traces[rxrpc_timer__nr_trace][8];
+
extern const char *const rxrpc_pkts[];
extern const char *rxrpc_acks(u8 reason);
@@ -707,7 +718,7 @@
/*
* call_event.c
*/
-void rxrpc_set_timer(struct rxrpc_call *);
+void rxrpc_set_timer(struct rxrpc_call *, enum rxrpc_timer_trace);
void rxrpc_propose_ACK(struct rxrpc_call *, u8, u16, u32, bool, bool);
void rxrpc_process_call(struct work_struct *);
diff --git a/net/rxrpc/call_event.c b/net/rxrpc/call_event.c
index 8bc5c8e..90e970b 100644
--- a/net/rxrpc/call_event.c
+++ b/net/rxrpc/call_event.c
@@ -24,7 +24,7 @@
/*
* Set the timer
*/
-void rxrpc_set_timer(struct rxrpc_call *call)
+void rxrpc_set_timer(struct rxrpc_call *call, enum rxrpc_timer_trace why)
{
unsigned long t, now = jiffies;
@@ -45,6 +45,7 @@
if (call->timer.expires != t || !timer_pending(&call->timer)) {
mod_timer(&call->timer, t);
+ trace_rxrpc_timer(call, why, now);
}
}
@@ -120,7 +121,7 @@
_debug("deferred ACK %ld < %ld", expiry, call->ack_at - now);
if (time_before(ack_at, call->ack_at)) {
call->ack_at = ack_at;
- rxrpc_set_timer(call);
+ rxrpc_set_timer(call, rxrpc_timer_set_for_ack);
}
}
}
@@ -293,7 +294,7 @@
goto recheck_state;
}
- rxrpc_set_timer(call);
+ rxrpc_set_timer(call, rxrpc_timer_set_for_resend);
/* other events may have been raised since we started checking */
if (call->events && call->state < RXRPC_CALL_COMPLETE) {
diff --git a/net/rxrpc/call_object.c b/net/rxrpc/call_object.c
index f2fadf6..a53f4c2 100644
--- a/net/rxrpc/call_object.c
+++ b/net/rxrpc/call_object.c
@@ -76,8 +76,10 @@
_enter("%d", call->debug_id);
- if (call->state < RXRPC_CALL_COMPLETE)
+ if (call->state < RXRPC_CALL_COMPLETE) {
+ trace_rxrpc_timer(call, rxrpc_timer_expired, jiffies);
rxrpc_queue_call(call);
+ }
}
/*
@@ -200,7 +202,7 @@
call->ack_at = expire_at;
call->resend_at = expire_at;
call->timer.expires = expire_at + 1;
- rxrpc_set_timer(call);
+ rxrpc_set_timer(call, rxrpc_timer_begin);
}
/*
diff --git a/net/rxrpc/misc.c b/net/rxrpc/misc.c
index fe64871..fa9942f 100644
--- a/net/rxrpc/misc.c
+++ b/net/rxrpc/misc.c
@@ -194,3 +194,11 @@
[rxrpc_rtt_rx_ping_response] = "PONG",
[rxrpc_rtt_rx_requested_ack] = "RACK",
};
+
+const char rxrpc_timer_traces[rxrpc_timer__nr_trace][8] = {
+ [rxrpc_timer_begin] = "Begin ",
+ [rxrpc_timer_expired] = "*EXPR*",
+ [rxrpc_timer_set_for_ack] = "SetAck",
+ [rxrpc_timer_set_for_send] = "SetTx ",
+ [rxrpc_timer_set_for_resend] = "SetRTx",
+};
diff --git a/net/rxrpc/sendmsg.c b/net/rxrpc/sendmsg.c
index 93e6584..9993937 100644
--- a/net/rxrpc/sendmsg.c
+++ b/net/rxrpc/sendmsg.c
@@ -153,7 +153,7 @@
if (time_before(resend_at, call->resend_at)) {
call->resend_at = resend_at;
- rxrpc_set_timer(call);
+ rxrpc_set_timer(call, rxrpc_timer_set_for_send);
}
}