Skip to content

Commit 0c3bd08

Browse files
dhowellsdavem330
authored andcommitted
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: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: "David S. Miller" <[email protected]> cc: Eric Dumazet <[email protected]> cc: Jakub Kicinski <[email protected]> cc: Paolo Abeni <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
1 parent 7fbd5fc commit 0c3bd08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

net/rxrpc/conn_client.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ static void rxrpc_destroy_client_conn_ids(struct rxrpc_local *local)
7373
static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call,
7474
gfp_t gfp)
7575
{
76+
static atomic_t rxrpc_bundle_id;
7677
struct rxrpc_bundle *bundle;
7778

7879
bundle = kzalloc(sizeof(*bundle), gfp);
@@ -85,6 +86,7 @@ static struct rxrpc_bundle *rxrpc_alloc_bundle(struct rxrpc_call *call,
8586
bundle->upgrade = test_bit(RXRPC_CALL_UPGRADE, &call->flags);
8687
bundle->service_id = call->dest_srx.srx_service;
8788
bundle->security_level = call->security_level;
89+
bundle->debug_id = atomic_inc_return(&rxrpc_bundle_id);
8890
refcount_set(&bundle->ref, 1);
8991
atomic_set(&bundle->active, 1);
9092
INIT_LIST_HEAD(&bundle->waiting_calls);
@@ -105,7 +107,8 @@ struct rxrpc_bundle *rxrpc_get_bundle(struct rxrpc_bundle *bundle,
105107

106108
static void rxrpc_free_bundle(struct rxrpc_bundle *bundle)
107109
{
108-
trace_rxrpc_bundle(bundle->debug_id, 1, rxrpc_bundle_free);
110+
trace_rxrpc_bundle(bundle->debug_id, refcount_read(&bundle->ref),
111+
rxrpc_bundle_free);
109112
rxrpc_put_peer(bundle->peer, rxrpc_peer_put_bundle);
110113
key_put(bundle->key);
111114
kfree(bundle);
@@ -239,7 +242,6 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connection *conn)
239242
*/
240243
int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp)
241244
{
242-
static atomic_t rxrpc_bundle_id;
243245
struct rxrpc_bundle *bundle, *candidate;
244246
struct rxrpc_local *local = call->local;
245247
struct rb_node *p, **pp, *parent;
@@ -306,7 +308,6 @@ int rxrpc_look_up_bundle(struct rxrpc_call *call, gfp_t gfp)
306308
}
307309

308310
_debug("new bundle");
309-
candidate->debug_id = atomic_inc_return(&rxrpc_bundle_id);
310311
rb_link_node(&candidate->local_node, parent, pp);
311312
rb_insert_color(&candidate->local_node, &local->client_bundles);
312313
call->bundle = rxrpc_get_bundle(candidate, rxrpc_bundle_get_client_call);

0 commit comments

Comments
 (0)