提交 7fa25105 编写于 作者: D David Howells

rxrpc: trace: Don't use __builtin_return_address for rxrpc_conn tracing

In rxrpc tracing, use enums to generate lists of points of interest rather
than __builtin_return_address() for the rxrpc_conn tracepoint
Signed-off-by: NDavid Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
上级 47c810a7
...@@ -82,14 +82,34 @@ ...@@ -82,14 +82,34 @@
E_(rxrpc_peer_put_keepalive, "PUT keepaliv") E_(rxrpc_peer_put_keepalive, "PUT keepaliv")
#define rxrpc_conn_traces \ #define rxrpc_conn_traces \
EM(rxrpc_conn_got, "GOT") \ EM(rxrpc_conn_free, "FREE ") \
EM(rxrpc_conn_new_client, "NWc") \ EM(rxrpc_conn_get_activate_call, "GET act-call") \
EM(rxrpc_conn_new_service, "NWs") \ EM(rxrpc_conn_get_call_input, "GET inp-call") \
EM(rxrpc_conn_put_client, "PTc") \ EM(rxrpc_conn_get_conn_input, "GET inp-conn") \
EM(rxrpc_conn_put_service, "PTs") \ EM(rxrpc_conn_get_idle, "GET idle ") \
EM(rxrpc_conn_queued, "QUE") \ EM(rxrpc_conn_get_poke, "GET poke ") \
EM(rxrpc_conn_reap_service, "RPs") \ EM(rxrpc_conn_get_service_conn, "GET svc-conn") \
E_(rxrpc_conn_seen, "SEE") EM(rxrpc_conn_new_client, "NEW client ") \
EM(rxrpc_conn_new_service, "NEW service ") \
EM(rxrpc_conn_put_already_queued, "PUT alreadyq") \
EM(rxrpc_conn_put_call, "PUT call ") \
EM(rxrpc_conn_put_call_input, "PUT inp-call") \
EM(rxrpc_conn_put_conn_input, "PUT inp-conn") \
EM(rxrpc_conn_put_discard, "PUT discard ") \
EM(rxrpc_conn_put_discard_idle, "PUT disc-idl") \
EM(rxrpc_conn_put_local_dead, "PUT loc-dead") \
EM(rxrpc_conn_put_noreuse, "PUT noreuse ") \
EM(rxrpc_conn_put_poke, "PUT poke ") \
EM(rxrpc_conn_put_unbundle, "PUT unbundle") \
EM(rxrpc_conn_put_unidle, "PUT unidle ") \
EM(rxrpc_conn_put_work, "PUT work ") \
EM(rxrpc_conn_queue_challenge, "GQ chall ") \
EM(rxrpc_conn_queue_retry_work, "GQ retry-wk") \
EM(rxrpc_conn_queue_rx_work, "GQ rx-work ") \
EM(rxrpc_conn_queue_timer, "GQ timer ") \
EM(rxrpc_conn_see_new_service_conn, "SEE new-svc ") \
EM(rxrpc_conn_see_reap_service, "SEE reap-svc") \
E_(rxrpc_conn_see_work, "SEE work ")
#define rxrpc_client_traces \ #define rxrpc_client_traces \
EM(rxrpc_client_activate_chans, "Activa") \ EM(rxrpc_client_activate_chans, "Activa") \
...@@ -430,30 +450,26 @@ TRACE_EVENT(rxrpc_peer, ...@@ -430,30 +450,26 @@ TRACE_EVENT(rxrpc_peer,
); );
TRACE_EVENT(rxrpc_conn, TRACE_EVENT(rxrpc_conn,
TP_PROTO(unsigned int conn_debug_id, enum rxrpc_conn_trace op, TP_PROTO(unsigned int conn_debug_id, int ref, enum rxrpc_conn_trace why),
int usage, const void *where),
TP_ARGS(conn_debug_id, op, usage, where), TP_ARGS(conn_debug_id, ref, why),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(unsigned int, conn ) __field(unsigned int, conn )
__field(int, op ) __field(int, ref )
__field(int, usage ) __field(int, why )
__field(const void *, where )
), ),
TP_fast_assign( TP_fast_assign(
__entry->conn = conn_debug_id; __entry->conn = conn_debug_id;
__entry->op = op; __entry->ref = ref;
__entry->usage = usage; __entry->why = why;
__entry->where = where;
), ),
TP_printk("C=%08x %s u=%d sp=%pSR", TP_printk("C=%08x %s r=%d",
__entry->conn, __entry->conn,
__print_symbolic(__entry->op, rxrpc_conn_traces), __print_symbolic(__entry->why, rxrpc_conn_traces),
__entry->usage, __entry->ref)
__entry->where)
); );
TRACE_EVENT(rxrpc_client, TRACE_EVENT(rxrpc_client,
......
...@@ -882,7 +882,7 @@ int rxrpc_connect_call(struct rxrpc_sock *, struct rxrpc_call *, ...@@ -882,7 +882,7 @@ int rxrpc_connect_call(struct rxrpc_sock *, struct rxrpc_call *,
gfp_t); gfp_t);
void rxrpc_expose_client_call(struct rxrpc_call *); void rxrpc_expose_client_call(struct rxrpc_call *);
void rxrpc_disconnect_client_call(struct rxrpc_bundle *, struct rxrpc_call *); void rxrpc_disconnect_client_call(struct rxrpc_bundle *, struct rxrpc_call *);
void rxrpc_put_client_conn(struct rxrpc_connection *); void rxrpc_put_client_conn(struct rxrpc_connection *, enum rxrpc_conn_trace);
void rxrpc_discard_expired_client_conns(struct work_struct *); void rxrpc_discard_expired_client_conns(struct work_struct *);
void rxrpc_destroy_all_client_connections(struct rxrpc_net *); void rxrpc_destroy_all_client_connections(struct rxrpc_net *);
void rxrpc_clean_up_local_conns(struct rxrpc_local *); void rxrpc_clean_up_local_conns(struct rxrpc_local *);
...@@ -906,11 +906,13 @@ struct rxrpc_connection *rxrpc_find_connection_rcu(struct rxrpc_local *, ...@@ -906,11 +906,13 @@ struct rxrpc_connection *rxrpc_find_connection_rcu(struct rxrpc_local *,
void __rxrpc_disconnect_call(struct rxrpc_connection *, struct rxrpc_call *); void __rxrpc_disconnect_call(struct rxrpc_connection *, struct rxrpc_call *);
void rxrpc_disconnect_call(struct rxrpc_call *); void rxrpc_disconnect_call(struct rxrpc_call *);
void rxrpc_kill_connection(struct rxrpc_connection *); void rxrpc_kill_connection(struct rxrpc_connection *);
bool rxrpc_queue_conn(struct rxrpc_connection *); bool rxrpc_queue_conn(struct rxrpc_connection *, enum rxrpc_conn_trace);
void rxrpc_see_connection(struct rxrpc_connection *); void rxrpc_see_connection(struct rxrpc_connection *, enum rxrpc_conn_trace);
struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *); struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *,
struct rxrpc_connection *rxrpc_get_connection_maybe(struct rxrpc_connection *); enum rxrpc_conn_trace);
void rxrpc_put_service_conn(struct rxrpc_connection *); struct rxrpc_connection *rxrpc_get_connection_maybe(struct rxrpc_connection *,
enum rxrpc_conn_trace);
void rxrpc_put_service_conn(struct rxrpc_connection *, enum rxrpc_conn_trace);
void rxrpc_service_connection_reaper(struct work_struct *); void rxrpc_service_connection_reaper(struct work_struct *);
void rxrpc_destroy_all_connections(struct rxrpc_net *); void rxrpc_destroy_all_connections(struct rxrpc_net *);
...@@ -924,15 +926,16 @@ static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn) ...@@ -924,15 +926,16 @@ static inline bool rxrpc_conn_is_service(const struct rxrpc_connection *conn)
return !rxrpc_conn_is_client(conn); return !rxrpc_conn_is_client(conn);
} }
static inline void rxrpc_put_connection(struct rxrpc_connection *conn) static inline void rxrpc_put_connection(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
if (!conn) if (!conn)
return; return;
if (rxrpc_conn_is_client(conn)) if (rxrpc_conn_is_client(conn))
rxrpc_put_client_conn(conn); rxrpc_put_client_conn(conn, why);
else else
rxrpc_put_service_conn(conn); rxrpc_put_service_conn(conn, why);
} }
static inline void rxrpc_reduce_conn_timer(struct rxrpc_connection *conn, static inline void rxrpc_reduce_conn_timer(struct rxrpc_connection *conn,
......
...@@ -91,9 +91,6 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx, ...@@ -91,9 +91,6 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
b->conn_backlog[head] = conn; b->conn_backlog[head] = conn;
smp_store_release(&b->conn_backlog_head, smp_store_release(&b->conn_backlog_head,
(head + 1) & (size - 1)); (head + 1) & (size - 1));
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_new_service,
refcount_read(&conn->ref), here);
} }
/* Now it gets complicated, because calls get registered with the /* Now it gets complicated, because calls get registered with the
...@@ -309,10 +306,10 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx, ...@@ -309,10 +306,10 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
(conn_tail + 1) & (RXRPC_BACKLOG_MAX - 1)); (conn_tail + 1) & (RXRPC_BACKLOG_MAX - 1));
conn->local = rxrpc_get_local(local, rxrpc_local_get_prealloc_conn); conn->local = rxrpc_get_local(local, rxrpc_local_get_prealloc_conn);
conn->peer = peer; conn->peer = peer;
rxrpc_see_connection(conn); rxrpc_see_connection(conn, rxrpc_conn_see_new_service_conn);
rxrpc_new_incoming_connection(rx, conn, sec, skb); rxrpc_new_incoming_connection(rx, conn, sec, skb);
} else { } else {
rxrpc_get_connection(conn); rxrpc_get_connection(conn, rxrpc_conn_get_service_conn);
} }
/* And now we can allocate and set up a new call */ /* And now we can allocate and set up a new call */
...@@ -402,7 +399,7 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local, ...@@ -402,7 +399,7 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,
case RXRPC_CONN_SERVICE_UNSECURED: case RXRPC_CONN_SERVICE_UNSECURED:
conn->state = RXRPC_CONN_SERVICE_CHALLENGING; conn->state = RXRPC_CONN_SERVICE_CHALLENGING;
set_bit(RXRPC_CONN_EV_CHALLENGE, &call->conn->events); set_bit(RXRPC_CONN_EV_CHALLENGE, &call->conn->events);
rxrpc_queue_conn(call->conn); rxrpc_queue_conn(call->conn, rxrpc_conn_queue_challenge);
break; break;
case RXRPC_CONN_SERVICE: case RXRPC_CONN_SERVICE:
......
...@@ -635,7 +635,7 @@ static void rxrpc_destroy_call(struct work_struct *work) ...@@ -635,7 +635,7 @@ static void rxrpc_destroy_call(struct work_struct *work)
rxrpc_delete_call_timer(call); rxrpc_delete_call_timer(call);
rxrpc_put_connection(call->conn); rxrpc_put_connection(call->conn, rxrpc_conn_put_call);
rxrpc_put_peer(call->peer, rxrpc_peer_put_call); rxrpc_put_peer(call->peer, rxrpc_peer_put_call);
kmem_cache_free(rxrpc_call_jar, call); kmem_cache_free(rxrpc_call_jar, call);
if (atomic_dec_and_test(&rxnet->nr_calls)) if (atomic_dec_and_test(&rxnet->nr_calls))
......
...@@ -211,9 +211,8 @@ rxrpc_alloc_client_connection(struct rxrpc_bundle *bundle, gfp_t gfp) ...@@ -211,9 +211,8 @@ rxrpc_alloc_client_connection(struct rxrpc_bundle *bundle, gfp_t gfp)
rxrpc_get_local(conn->local, rxrpc_local_get_client_conn); rxrpc_get_local(conn->local, rxrpc_local_get_client_conn);
key_get(conn->key); key_get(conn->key);
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_new_client, trace_rxrpc_conn(conn->debug_id, refcount_read(&conn->ref),
refcount_read(&conn->ref), rxrpc_conn_new_client);
__builtin_return_address(0));
atomic_inc(&rxnet->nr_client_conns); atomic_inc(&rxnet->nr_client_conns);
trace_rxrpc_client(conn, -1, rxrpc_client_alloc); trace_rxrpc_client(conn, -1, rxrpc_client_alloc);
...@@ -467,10 +466,10 @@ static void rxrpc_add_conn_to_bundle(struct rxrpc_bundle *bundle, gfp_t gfp) ...@@ -467,10 +466,10 @@ static void rxrpc_add_conn_to_bundle(struct rxrpc_bundle *bundle, gfp_t gfp)
if (candidate) { if (candidate) {
_debug("discard C=%x", candidate->debug_id); _debug("discard C=%x", candidate->debug_id);
trace_rxrpc_client(candidate, -1, rxrpc_client_duplicate); trace_rxrpc_client(candidate, -1, rxrpc_client_duplicate);
rxrpc_put_connection(candidate); rxrpc_put_connection(candidate, rxrpc_conn_put_discard);
} }
rxrpc_put_connection(old); rxrpc_put_connection(old, rxrpc_conn_put_noreuse);
_leave(""); _leave("");
} }
...@@ -544,7 +543,7 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn, ...@@ -544,7 +543,7 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
rxrpc_see_call(call); rxrpc_see_call(call);
list_del_init(&call->chan_wait_link); list_del_init(&call->chan_wait_link);
call->peer = rxrpc_get_peer(conn->peer, rxrpc_peer_get_activate_call); call->peer = rxrpc_get_peer(conn->peer, rxrpc_peer_get_activate_call);
call->conn = rxrpc_get_connection(conn); call->conn = rxrpc_get_connection(conn, rxrpc_conn_get_activate_call);
call->cid = conn->proto.cid | channel; call->cid = conn->proto.cid | channel;
call->call_id = call_id; call->call_id = call_id;
call->security = conn->security; call->security = conn->security;
...@@ -592,7 +591,7 @@ static void rxrpc_unidle_conn(struct rxrpc_bundle *bundle, struct rxrpc_connecti ...@@ -592,7 +591,7 @@ static void rxrpc_unidle_conn(struct rxrpc_bundle *bundle, struct rxrpc_connecti
} }
spin_unlock(&rxnet->client_conn_cache_lock); spin_unlock(&rxnet->client_conn_cache_lock);
if (drop_ref) if (drop_ref)
rxrpc_put_connection(conn); rxrpc_put_connection(conn, rxrpc_conn_put_unidle);
} }
} }
...@@ -896,7 +895,7 @@ void rxrpc_disconnect_client_call(struct rxrpc_bundle *bundle, struct rxrpc_call ...@@ -896,7 +895,7 @@ void rxrpc_disconnect_client_call(struct rxrpc_bundle *bundle, struct rxrpc_call
trace_rxrpc_client(conn, channel, rxrpc_client_to_idle); trace_rxrpc_client(conn, channel, rxrpc_client_to_idle);
conn->idle_timestamp = jiffies; conn->idle_timestamp = jiffies;
rxrpc_get_connection(conn); rxrpc_get_connection(conn, rxrpc_conn_get_idle);
spin_lock(&rxnet->client_conn_cache_lock); spin_lock(&rxnet->client_conn_cache_lock);
list_move_tail(&conn->cache_link, &rxnet->idle_client_conns); list_move_tail(&conn->cache_link, &rxnet->idle_client_conns);
spin_unlock(&rxnet->client_conn_cache_lock); spin_unlock(&rxnet->client_conn_cache_lock);
...@@ -938,7 +937,7 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn) ...@@ -938,7 +937,7 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
if (need_drop) { if (need_drop) {
rxrpc_deactivate_bundle(bundle); rxrpc_deactivate_bundle(bundle);
rxrpc_put_connection(conn); rxrpc_put_connection(conn, rxrpc_conn_put_unbundle);
} }
} }
...@@ -983,15 +982,15 @@ static void rxrpc_kill_client_conn(struct rxrpc_connection *conn) ...@@ -983,15 +982,15 @@ static void rxrpc_kill_client_conn(struct rxrpc_connection *conn)
/* /*
* Clean up a dead client connections. * Clean up a dead client connections.
*/ */
void rxrpc_put_client_conn(struct rxrpc_connection *conn) void rxrpc_put_client_conn(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
unsigned int debug_id = conn->debug_id; unsigned int debug_id = conn->debug_id;
bool dead; bool dead;
int r; int r;
dead = __refcount_dec_and_test(&conn->ref, &r); dead = __refcount_dec_and_test(&conn->ref, &r);
trace_rxrpc_conn(debug_id, rxrpc_conn_put_client, r - 1, here); trace_rxrpc_conn(debug_id, r - 1, why);
if (dead) if (dead)
rxrpc_kill_client_conn(conn); rxrpc_kill_client_conn(conn);
} }
...@@ -1063,7 +1062,8 @@ void rxrpc_discard_expired_client_conns(struct work_struct *work) ...@@ -1063,7 +1062,8 @@ void rxrpc_discard_expired_client_conns(struct work_struct *work)
spin_unlock(&rxnet->client_conn_cache_lock); spin_unlock(&rxnet->client_conn_cache_lock);
rxrpc_unbundle_conn(conn); rxrpc_unbundle_conn(conn);
rxrpc_put_connection(conn); /* Drop the ->cache_link ref */ /* Drop the ->cache_link ref */
rxrpc_put_connection(conn, rxrpc_conn_put_discard_idle);
nr_conns--; nr_conns--;
goto next; goto next;
...@@ -1134,7 +1134,7 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *local) ...@@ -1134,7 +1134,7 @@ void rxrpc_clean_up_local_conns(struct rxrpc_local *local)
struct rxrpc_connection, cache_link); struct rxrpc_connection, cache_link);
list_del_init(&conn->cache_link); list_del_init(&conn->cache_link);
rxrpc_unbundle_conn(conn); rxrpc_unbundle_conn(conn);
rxrpc_put_connection(conn); rxrpc_put_connection(conn, rxrpc_conn_put_local_dead);
} }
_leave(" [culled]"); _leave(" [culled]");
......
...@@ -472,14 +472,14 @@ void rxrpc_process_connection(struct work_struct *work) ...@@ -472,14 +472,14 @@ void rxrpc_process_connection(struct work_struct *work)
struct rxrpc_connection *conn = struct rxrpc_connection *conn =
container_of(work, struct rxrpc_connection, processor); container_of(work, struct rxrpc_connection, processor);
rxrpc_see_connection(conn); rxrpc_see_connection(conn, rxrpc_conn_see_work);
if (__rxrpc_use_local(conn->local, rxrpc_local_use_conn_work)) { if (__rxrpc_use_local(conn->local, rxrpc_local_use_conn_work)) {
rxrpc_do_process_connection(conn); rxrpc_do_process_connection(conn);
rxrpc_unuse_local(conn->local, rxrpc_local_unuse_conn_work); rxrpc_unuse_local(conn->local, rxrpc_local_unuse_conn_work);
} }
rxrpc_put_connection(conn); rxrpc_put_connection(conn, rxrpc_conn_put_work);
_leave(""); _leave("");
return; return;
} }
...@@ -26,7 +26,7 @@ static void rxrpc_connection_timer(struct timer_list *timer) ...@@ -26,7 +26,7 @@ static void rxrpc_connection_timer(struct timer_list *timer)
struct rxrpc_connection *conn = struct rxrpc_connection *conn =
container_of(timer, struct rxrpc_connection, timer); container_of(timer, struct rxrpc_connection, timer);
rxrpc_queue_conn(conn); rxrpc_queue_conn(conn, rxrpc_conn_queue_timer);
} }
/* /*
...@@ -260,43 +260,42 @@ void rxrpc_kill_connection(struct rxrpc_connection *conn) ...@@ -260,43 +260,42 @@ void rxrpc_kill_connection(struct rxrpc_connection *conn)
* Queue a connection's work processor, getting a ref to pass to the work * Queue a connection's work processor, getting a ref to pass to the work
* queue. * queue.
*/ */
bool rxrpc_queue_conn(struct rxrpc_connection *conn) bool rxrpc_queue_conn(struct rxrpc_connection *conn, enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
int r; int r;
if (!__refcount_inc_not_zero(&conn->ref, &r)) if (!__refcount_inc_not_zero(&conn->ref, &r))
return false; return false;
if (rxrpc_queue_work(&conn->processor)) if (rxrpc_queue_work(&conn->processor))
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_queued, r + 1, here); trace_rxrpc_conn(conn->debug_id, why, r + 1);
else else
rxrpc_put_connection(conn); rxrpc_put_connection(conn, rxrpc_conn_put_already_queued);
return true; return true;
} }
/* /*
* Note the re-emergence of a connection. * Note the re-emergence of a connection.
*/ */
void rxrpc_see_connection(struct rxrpc_connection *conn) void rxrpc_see_connection(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
if (conn) { if (conn) {
int n = refcount_read(&conn->ref); int r = refcount_read(&conn->ref);
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_seen, n, here); trace_rxrpc_conn(conn->debug_id, r, why);
} }
} }
/* /*
* Get a ref on a connection. * Get a ref on a connection.
*/ */
struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *conn) struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
int r; int r;
__refcount_inc(&conn->ref, &r); __refcount_inc(&conn->ref, &r);
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_got, r, here); trace_rxrpc_conn(conn->debug_id, r + 1, why);
return conn; return conn;
} }
...@@ -304,14 +303,14 @@ struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *conn) ...@@ -304,14 +303,14 @@ struct rxrpc_connection *rxrpc_get_connection(struct rxrpc_connection *conn)
* Try to get a ref on a connection. * Try to get a ref on a connection.
*/ */
struct rxrpc_connection * struct rxrpc_connection *
rxrpc_get_connection_maybe(struct rxrpc_connection *conn) rxrpc_get_connection_maybe(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
int r; int r;
if (conn) { if (conn) {
if (__refcount_inc_not_zero(&conn->ref, &r)) if (__refcount_inc_not_zero(&conn->ref, &r))
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_got, r + 1, here); trace_rxrpc_conn(conn->debug_id, r + 1, why);
else else
conn = NULL; conn = NULL;
} }
...@@ -331,14 +330,14 @@ static void rxrpc_set_service_reap_timer(struct rxrpc_net *rxnet, ...@@ -331,14 +330,14 @@ static void rxrpc_set_service_reap_timer(struct rxrpc_net *rxnet,
/* /*
* Release a service connection * Release a service connection
*/ */
void rxrpc_put_service_conn(struct rxrpc_connection *conn) void rxrpc_put_service_conn(struct rxrpc_connection *conn,
enum rxrpc_conn_trace why)
{ {
const void *here = __builtin_return_address(0);
unsigned int debug_id = conn->debug_id; unsigned int debug_id = conn->debug_id;
int r; int r;
__refcount_dec(&conn->ref, &r); __refcount_dec(&conn->ref, &r);
trace_rxrpc_conn(debug_id, rxrpc_conn_put_service, r - 1, here); trace_rxrpc_conn(debug_id, r - 1, why);
if (r - 1 == 1) if (r - 1 == 1)
rxrpc_set_service_reap_timer(conn->local->rxnet, rxrpc_set_service_reap_timer(conn->local->rxnet,
jiffies + rxrpc_connection_expiry); jiffies + rxrpc_connection_expiry);
...@@ -354,6 +353,9 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu) ...@@ -354,6 +353,9 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu)
_enter("{%d,u=%d}", conn->debug_id, refcount_read(&conn->ref)); _enter("{%d,u=%d}", conn->debug_id, refcount_read(&conn->ref));
trace_rxrpc_conn(conn->debug_id, refcount_read(&conn->ref),
rxrpc_conn_free);
ASSERTCMP(refcount_read(&conn->ref), ==, 0); ASSERTCMP(refcount_read(&conn->ref), ==, 0);
del_timer_sync(&conn->timer); del_timer_sync(&conn->timer);
...@@ -419,7 +421,7 @@ void rxrpc_service_connection_reaper(struct work_struct *work) ...@@ -419,7 +421,7 @@ void rxrpc_service_connection_reaper(struct work_struct *work)
*/ */
if (!refcount_dec_if_one(&conn->ref)) if (!refcount_dec_if_one(&conn->ref))
continue; continue;
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_reap_service, 0, NULL); rxrpc_see_connection(conn, rxrpc_conn_see_reap_service);
if (rxrpc_conn_is_client(conn)) if (rxrpc_conn_is_client(conn))
BUG(); BUG();
......
...@@ -141,9 +141,7 @@ struct rxrpc_connection *rxrpc_prealloc_service_connection(struct rxrpc_net *rxn ...@@ -141,9 +141,7 @@ struct rxrpc_connection *rxrpc_prealloc_service_connection(struct rxrpc_net *rxn
list_add_tail(&conn->proc_link, &rxnet->conn_proc_list); list_add_tail(&conn->proc_link, &rxnet->conn_proc_list);
write_unlock(&rxnet->conn_lock); write_unlock(&rxnet->conn_lock);
trace_rxrpc_conn(conn->debug_id, rxrpc_conn_new_service, rxrpc_see_connection(conn, rxrpc_conn_new_service);
refcount_read(&conn->ref),
__builtin_return_address(0));
} }
return conn; return conn;
......
...@@ -1121,7 +1121,7 @@ static void rxrpc_post_packet_to_conn(struct rxrpc_connection *conn, ...@@ -1121,7 +1121,7 @@ static void rxrpc_post_packet_to_conn(struct rxrpc_connection *conn,
_enter("%p,%p", conn, skb); _enter("%p,%p", conn, skb);
skb_queue_tail(&conn->rx_queue, skb); skb_queue_tail(&conn->rx_queue, skb);
rxrpc_queue_conn(conn); rxrpc_queue_conn(conn, rxrpc_conn_queue_rx_work);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册