Commit e969c92c authored by David Howells's avatar David Howells

rxrpc: Remove the [_k]net() debugging macros

Remove the _net() and knet() debugging macros in favour of tracepoints.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
parent 2ebdb26e
...@@ -1190,20 +1190,17 @@ extern unsigned int rxrpc_debug; ...@@ -1190,20 +1190,17 @@ extern unsigned int rxrpc_debug;
#define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__) #define kenter(FMT,...) dbgprintk("==> %s("FMT")",__func__ ,##__VA_ARGS__)
#define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) #define kleave(FMT,...) dbgprintk("<== %s()"FMT"",__func__ ,##__VA_ARGS__)
#define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__) #define kdebug(FMT,...) dbgprintk(" "FMT ,##__VA_ARGS__)
#define knet(FMT,...) dbgprintk("@@@ "FMT ,##__VA_ARGS__)
#if defined(__KDEBUG) #if defined(__KDEBUG)
#define _enter(FMT,...) kenter(FMT,##__VA_ARGS__) #define _enter(FMT,...) kenter(FMT,##__VA_ARGS__)
#define _leave(FMT,...) kleave(FMT,##__VA_ARGS__) #define _leave(FMT,...) kleave(FMT,##__VA_ARGS__)
#define _debug(FMT,...) kdebug(FMT,##__VA_ARGS__) #define _debug(FMT,...) kdebug(FMT,##__VA_ARGS__)
#define _net(FMT,...) knet(FMT,##__VA_ARGS__)
#elif defined(CONFIG_AF_RXRPC_DEBUG) #elif defined(CONFIG_AF_RXRPC_DEBUG)
#define RXRPC_DEBUG_KENTER 0x01 #define RXRPC_DEBUG_KENTER 0x01
#define RXRPC_DEBUG_KLEAVE 0x02 #define RXRPC_DEBUG_KLEAVE 0x02
#define RXRPC_DEBUG_KDEBUG 0x04 #define RXRPC_DEBUG_KDEBUG 0x04
#define RXRPC_DEBUG_KNET 0x10
#define _enter(FMT,...) \ #define _enter(FMT,...) \
do { \ do { \
...@@ -1223,17 +1220,10 @@ do { \ ...@@ -1223,17 +1220,10 @@ do { \
kdebug(FMT,##__VA_ARGS__); \ kdebug(FMT,##__VA_ARGS__); \
} while (0) } while (0)
#define _net(FMT,...) \
do { \
if (unlikely(rxrpc_debug & RXRPC_DEBUG_KNET)) \
knet(FMT,##__VA_ARGS__); \
} while (0)
#else #else
#define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__) #define _enter(FMT,...) no_printk("==> %s("FMT")",__func__ ,##__VA_ARGS__)
#define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__) #define _leave(FMT,...) no_printk("<== %s()"FMT"",__func__ ,##__VA_ARGS__)
#define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__) #define _debug(FMT,...) no_printk(" "FMT ,##__VA_ARGS__)
#define _net(FMT,...) no_printk("@@@ "FMT ,##__VA_ARGS__)
#endif #endif
/* /*
......
...@@ -349,8 +349,6 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx, ...@@ -349,8 +349,6 @@ struct rxrpc_call *rxrpc_new_client_call(struct rxrpc_sock *rx,
rxrpc_start_call_timer(call); rxrpc_start_call_timer(call);
_net("CALL new %d on CONN %d", call->debug_id, call->conn->debug_id);
_leave(" = %p [new]", call); _leave(" = %p [new]", call);
return call; return call;
...@@ -423,8 +421,6 @@ void rxrpc_incoming_call(struct rxrpc_sock *rx, ...@@ -423,8 +421,6 @@ void rxrpc_incoming_call(struct rxrpc_sock *rx,
hlist_add_head_rcu(&call->error_link, &conn->params.peer->error_targets); hlist_add_head_rcu(&call->error_link, &conn->params.peer->error_targets);
spin_unlock(&conn->params.peer->lock); spin_unlock(&conn->params.peer->lock);
_net("CALL incoming %d on CONN %d", call->debug_id, call->conn->debug_id);
rxrpc_start_call_timer(call); rxrpc_start_call_timer(call);
_leave(""); _leave("");
} }
...@@ -669,8 +665,6 @@ void rxrpc_cleanup_call(struct rxrpc_call *call) ...@@ -669,8 +665,6 @@ void rxrpc_cleanup_call(struct rxrpc_call *call)
{ {
struct rxrpc_txbuf *txb; struct rxrpc_txbuf *txb;
_net("DESTROY CALL %d", call->debug_id);
memset(&call->sock_node, 0xcd, sizeof(call->sock_node)); memset(&call->sock_node, 0xcd, sizeof(call->sock_node));
ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE); ASSERTCMP(call->state, ==, RXRPC_CALL_COMPLETE);
......
...@@ -541,8 +541,6 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn, ...@@ -541,8 +541,6 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
call->service_id = conn->service_id; call->service_id = conn->service_id;
trace_rxrpc_connect_call(call); trace_rxrpc_connect_call(call);
_net("CONNECT call %08x:%08x as call %d on conn %d",
call->cid, call->call_id, call->debug_id, conn->debug_id);
write_lock_bh(&call->state_lock); write_lock_bh(&call->state_lock);
call->state = RXRPC_CALL_CLIENT_SEND_REQUEST; call->state = RXRPC_CALL_CLIENT_SEND_REQUEST;
......
...@@ -356,8 +356,6 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu) ...@@ -356,8 +356,6 @@ static void rxrpc_destroy_connection(struct rcu_head *rcu)
ASSERTCMP(refcount_read(&conn->ref), ==, 0); ASSERTCMP(refcount_read(&conn->ref), ==, 0);
_net("DESTROY CONN %d", conn->debug_id);
del_timer_sync(&conn->timer); del_timer_sync(&conn->timer);
rxrpc_purge_queue(&conn->rx_queue); rxrpc_purge_queue(&conn->rx_queue);
......
...@@ -184,8 +184,6 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *rx, ...@@ -184,8 +184,6 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *rx,
/* Make the connection a target for incoming packets. */ /* Make the connection a target for incoming packets. */
rxrpc_publish_service_conn(conn->params.peer, conn); rxrpc_publish_service_conn(conn->params.peer, conn);
_net("CONNECTION new %d {%x}", conn->debug_id, conn->proto.cid);
} }
/* /*
......
...@@ -725,7 +725,6 @@ static void rxrpc_input_ackinfo(struct rxrpc_call *call, struct sk_buff *skb, ...@@ -725,7 +725,6 @@ static void rxrpc_input_ackinfo(struct rxrpc_call *call, struct sk_buff *skb,
peer->maxdata = mtu; peer->maxdata = mtu;
peer->mtu = mtu + peer->hdrsize; peer->mtu = mtu + peer->hdrsize;
spin_unlock_bh(&peer->lock); spin_unlock_bh(&peer->lock);
_net("Net MTU %u (maxdata %u)", peer->mtu, peer->maxdata);
} }
if (wake) if (wake)
......
...@@ -198,7 +198,6 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net, ...@@ -198,7 +198,6 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net,
struct rxrpc_local *local; struct rxrpc_local *local;
struct rxrpc_net *rxnet = rxrpc_net(net); struct rxrpc_net *rxnet = rxrpc_net(net);
struct hlist_node *cursor; struct hlist_node *cursor;
const char *age;
long diff; long diff;
int ret; int ret;
...@@ -232,7 +231,6 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net, ...@@ -232,7 +231,6 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net,
if (!rxrpc_use_local(local)) if (!rxrpc_use_local(local))
break; break;
age = "old";
goto found; goto found;
} }
...@@ -250,14 +248,9 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net, ...@@ -250,14 +248,9 @@ struct rxrpc_local *rxrpc_lookup_local(struct net *net,
} else { } else {
hlist_add_head_rcu(&local->link, &rxnet->local_endpoints); hlist_add_head_rcu(&local->link, &rxnet->local_endpoints);
} }
age = "new";
found: found:
mutex_unlock(&rxnet->local_mutex); mutex_unlock(&rxnet->local_mutex);
_net("LOCAL %s %d {%pISp}",
age, local->debug_id, &local->srx.transport);
_leave(" = %p", local); _leave(" = %p", local);
return local; return local;
...@@ -467,7 +460,6 @@ static void rxrpc_local_rcu(struct rcu_head *rcu) ...@@ -467,7 +460,6 @@ static void rxrpc_local_rcu(struct rcu_head *rcu)
ASSERT(!work_pending(&local->processor)); ASSERT(!work_pending(&local->processor));
_net("DESTROY LOCAL %d", local->debug_id);
kfree(local); kfree(local);
_leave(""); _leave("");
} }
......
...@@ -48,13 +48,11 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local, ...@@ -48,13 +48,11 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local,
srx->transport.sin.sin_port = serr->port; srx->transport.sin.sin_port = serr->port;
switch (serr->ee.ee_origin) { switch (serr->ee.ee_origin) {
case SO_EE_ORIGIN_ICMP: case SO_EE_ORIGIN_ICMP:
_net("Rx ICMP");
memcpy(&srx->transport.sin.sin_addr, memcpy(&srx->transport.sin.sin_addr,
skb_network_header(skb) + serr->addr_offset, skb_network_header(skb) + serr->addr_offset,
sizeof(struct in_addr)); sizeof(struct in_addr));
break; break;
case SO_EE_ORIGIN_ICMP6: case SO_EE_ORIGIN_ICMP6:
_net("Rx ICMP6 on v4 sock");
memcpy(&srx->transport.sin.sin_addr, memcpy(&srx->transport.sin.sin_addr,
skb_network_header(skb) + serr->addr_offset + 12, skb_network_header(skb) + serr->addr_offset + 12,
sizeof(struct in_addr)); sizeof(struct in_addr));
...@@ -70,14 +68,12 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local, ...@@ -70,14 +68,12 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local,
case AF_INET6: case AF_INET6:
switch (serr->ee.ee_origin) { switch (serr->ee.ee_origin) {
case SO_EE_ORIGIN_ICMP6: case SO_EE_ORIGIN_ICMP6:
_net("Rx ICMP6");
srx->transport.sin6.sin6_port = serr->port; srx->transport.sin6.sin6_port = serr->port;
memcpy(&srx->transport.sin6.sin6_addr, memcpy(&srx->transport.sin6.sin6_addr,
skb_network_header(skb) + serr->addr_offset, skb_network_header(skb) + serr->addr_offset,
sizeof(struct in6_addr)); sizeof(struct in6_addr));
break; break;
case SO_EE_ORIGIN_ICMP: case SO_EE_ORIGIN_ICMP:
_net("Rx ICMP on v6 sock");
srx->transport_len = sizeof(srx->transport.sin); srx->transport_len = sizeof(srx->transport.sin);
srx->transport.family = AF_INET; srx->transport.family = AF_INET;
srx->transport.sin.sin_port = serr->port; srx->transport.sin.sin_port = serr->port;
...@@ -106,13 +102,9 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local, ...@@ -106,13 +102,9 @@ static struct rxrpc_peer *rxrpc_lookup_peer_local_rcu(struct rxrpc_local *local,
*/ */
static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu) static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu)
{ {
_net("Rx ICMP Fragmentation Needed (%d)", mtu);
/* wind down the local interface MTU */ /* wind down the local interface MTU */
if (mtu > 0 && peer->if_mtu == 65535 && mtu < peer->if_mtu) { if (mtu > 0 && peer->if_mtu == 65535 && mtu < peer->if_mtu)
peer->if_mtu = mtu; peer->if_mtu = mtu;
_net("I/F MTU %u", mtu);
}
if (mtu == 0) { if (mtu == 0) {
/* they didn't give us a size, estimate one */ /* they didn't give us a size, estimate one */
...@@ -133,8 +125,6 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu) ...@@ -133,8 +125,6 @@ static void rxrpc_adjust_mtu(struct rxrpc_peer *peer, unsigned int mtu)
peer->mtu = mtu; peer->mtu = mtu;
peer->maxdata = peer->mtu - peer->hdrsize; peer->maxdata = peer->mtu - peer->hdrsize;
spin_unlock_bh(&peer->lock); spin_unlock_bh(&peer->lock);
_net("Net MTU %u (maxdata %u)",
peer->mtu, peer->maxdata);
} }
} }
...@@ -222,41 +212,6 @@ static void rxrpc_store_error(struct rxrpc_peer *peer, ...@@ -222,41 +212,6 @@ static void rxrpc_store_error(struct rxrpc_peer *peer,
err = ee->ee_errno; err = ee->ee_errno;
switch (ee->ee_origin) { switch (ee->ee_origin) {
case SO_EE_ORIGIN_ICMP:
switch (ee->ee_type) {
case ICMP_DEST_UNREACH:
switch (ee->ee_code) {
case ICMP_NET_UNREACH:
_net("Rx Received ICMP Network Unreachable");
break;
case ICMP_HOST_UNREACH:
_net("Rx Received ICMP Host Unreachable");
break;
case ICMP_PORT_UNREACH:
_net("Rx Received ICMP Port Unreachable");
break;
case ICMP_NET_UNKNOWN:
_net("Rx Received ICMP Unknown Network");
break;
case ICMP_HOST_UNKNOWN:
_net("Rx Received ICMP Unknown Host");
break;
default:
_net("Rx Received ICMP DestUnreach code=%u",
ee->ee_code);
break;
}
break;
case ICMP_TIME_EXCEEDED:
_net("Rx Received ICMP TTL Exceeded");
break;
default:
break;
}
break;
case SO_EE_ORIGIN_NONE: case SO_EE_ORIGIN_NONE:
case SO_EE_ORIGIN_LOCAL: case SO_EE_ORIGIN_LOCAL:
compl = RXRPC_CALL_LOCAL_ERROR; compl = RXRPC_CALL_LOCAL_ERROR;
...@@ -266,6 +221,7 @@ static void rxrpc_store_error(struct rxrpc_peer *peer, ...@@ -266,6 +221,7 @@ static void rxrpc_store_error(struct rxrpc_peer *peer,
if (err == EACCES) if (err == EACCES)
err = EHOSTUNREACH; err = EHOSTUNREACH;
fallthrough; fallthrough;
case SO_EE_ORIGIN_ICMP:
default: default:
break; break;
} }
......
...@@ -138,10 +138,8 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *local, ...@@ -138,10 +138,8 @@ struct rxrpc_peer *rxrpc_lookup_peer_rcu(struct rxrpc_local *local,
unsigned long hash_key = rxrpc_peer_hash_key(local, srx); unsigned long hash_key = rxrpc_peer_hash_key(local, srx);
peer = __rxrpc_lookup_peer_rcu(local, srx, hash_key); peer = __rxrpc_lookup_peer_rcu(local, srx, hash_key);
if (peer) { if (peer)
_net("PEER %d {%pISp}", peer->debug_id, &peer->srx.transport);
_leave(" = %p {u=%d}", peer, refcount_read(&peer->ref)); _leave(" = %p {u=%d}", peer, refcount_read(&peer->ref));
}
return peer; return peer;
} }
...@@ -371,8 +369,6 @@ struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *rx, ...@@ -371,8 +369,6 @@ struct rxrpc_peer *rxrpc_lookup_peer(struct rxrpc_sock *rx,
peer = candidate; peer = candidate;
} }
_net("PEER %d {%pISp}", peer->debug_id, &peer->srx.transport);
_leave(" = %p {u=%d}", peer, refcount_read(&peer->ref)); _leave(" = %p {u=%d}", peer, refcount_read(&peer->ref));
return peer; return peer;
} }
......
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