Commit 0c3bd086 authored by David Howells's avatar David Howells Committed by David S. Miller

rxrpc: Fix some minor issues with bundle tracing

Fix some superficial issues with the tracing of rxrpc_bundle structs,
including:

 (1) Set the debug_id when the bundle is allocated rather than when it is
     set up so that the "NEW" trace line displays the correct bundle ID.

 (2) Show the refcount when emitting the "FREE" traceline.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: "David S. Miller" <davem@davemloft.net>
cc: Eric Dumazet <edumazet@google.com>
cc: Jakub Kicinski <kuba@kernel.org>
cc: Paolo Abeni <pabeni@redhat.com>
cc: linux-afs@lists.infradead.org
cc: netdev@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fbd5fc2
...@@ -73,6 +73,7 @@ static void rxrpc_destroy_client_conn_ids(struct rxrpc_local *local) ...@@ -73,6 +73,7 @@ static void rxrpc_destroy_client_conn_ids(struct rxrpc_local *local)
static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call, static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call,
gfp_t gfp) gfp_t gfp)
{ {
static atomic_t rxrpc_bundle_id;
struct rxrpc_bundle *bundle; struct rxrpc_bundle *bundle;
bundle = kzalloc(sizeof(*bundle), gfp); bundle = kzalloc(sizeof(*bundle), gfp);
...@@ -85,6 +86,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call, ...@@ -85,6 +86,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call,
bundle->upgrade = test_bit(RXRPC_CALL_UPGRADE, &call->flags); bundle->upgrade = test_bit(RXRPC_CALL_UPGRADE, &call->flags);
bundle->service_id = call->dest_srx.srx_service; bundle->service_id = call->dest_srx.srx_service;
bundle->security_level = call->security_level; bundle->security_level = call->security_level;
bundle->debug_id = atomic_inc_return(&rxrpc_bundle_id);
refcount_set(&bundle->ref, 1); refcount_set(&bundle->ref, 1);
atomic_set(&bundle->active, 1); atomic_set(&bundle->active, 1);
INIT_LIST_HEAD(&bundle->waiting_calls); INIT_LIST_HEAD(&bundle->waiting_calls);
...@@ -105,7 +107,8 @@ struct rxrpc_bundle *rxrpc_get_bundle(struct rxrpc_bundle *bundle, ...@@ -105,7 +107,8 @@ struct rxrpc_bundle *rxrpc_get_bundle(struct rxrpc_bundle *bundle,
static void rxrpc_free_bundle(struct rxrpc_bundle *bundle) static void rxrpc_free_bundle(struct rxrpc_bundle *bundle)
{ {
trace_rxrpc_bundle(bundle->debug_id, 1, rxrpc_bundle_free); trace_rxrpc_bundle(bundle->debug_id, refcount_read(&bundle->ref),
rxrpc_bundle_free);
rxrpc_put_peer(bundle->peer, rxrpc_peer_put_bundle); rxrpc_put_peer(bundle->peer, rxrpc_peer_put_bundle);
key_put(bundle->key); key_put(bundle->key);
kfree(bundle); kfree(bundle);
...@@ -239,7 +242,6 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connection *conn) ...@@ -239,7 +242,6 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connection *conn)
*/ */
int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp) int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp)
{ {
static atomic_t rxrpc_bundle_id;
struct rxrpc_bundle *bundle, *candidate; struct rxrpc_bundle *bundle, *candidate;
struct rxrpc_local *local = call->local; struct rxrpc_local *local = call->local;
struct rb_node *p, **pp, *parent; struct rb_node *p, **pp, *parent;
...@@ -306,7 +308,6 @@ int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp) ...@@ -306,7 +308,6 @@ int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp)
} }
_debug("new bundle"); _debug("new bundle");
candidate->debug_id = atomic_inc_return(&rxrpc_bundle_id);
rb_link_node(&candidate->local_node, parent, pp); rb_link_node(&candidate->local_node, parent, pp);
rb_insert_color(&candidate->local_node, &local->client_bundles); rb_insert_color(&candidate->local_node, &local->client_bundles);
call->bundle = rxrpc_get_bundle(candidate, rxrpc_bundle_get_client_call); call->bundle = rxrpc_get_bundle(candidate, rxrpc_bundle_get_client_call);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment