From 4ef8d53caadbab5585ccb4df2d087183b1383b86 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Wed, 23 May 2012 08:01:04 +0000 Subject: net: Allow filtering on debug traces in the net subsystem Add several levels of DEBUG prints so that you can limit the noise to the severety of your problem. DEBUG_LL_STATE = Link local state machine changes DEBUG_DEV_PKT = Packets or info directed to the device DEBUG_NET_PKT = Packets on info on the network at large DEBUG_INT_STATE = Internal network state changes Signed-off-by: Joe Hershberger --- net/arp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'net/arp.c') diff --git a/net/arp.c b/net/arp.c index 0b0ccbb58a..bac4cab5ef 100644 --- a/net/arp.c +++ b/net/arp.c @@ -55,7 +55,7 @@ void arp_raw_request(IPaddr_t sourceIP, const uchar *targetEther, struct arp_hdr *arp; int eth_hdr_size; - debug("ARP broadcast %d\n", NetArpWaitTry); + debug_cond(DEBUG_DEV_PKT, "ARP broadcast %d\n", NetArpWaitTry); pkt = NetArpTxPacket; @@ -135,7 +135,7 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) * address; so if we receive such a packet, we set * the server ethernet address */ - debug("Got ARP\n"); + debug_cond(DEBUG_NET_PKT, "Got ARP\n"); arp = (struct arp_hdr *)ip; if (len < ARP_HDR_SIZE) { @@ -160,7 +160,7 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) switch (ntohs(arp->ar_op)) { case ARPOP_REQUEST: /* reply with our IP address */ - debug("Got ARP REQUEST, return our IP\n"); + debug_cond(DEBUG_DEV_PKT, "Got ARP REQUEST, return our IP\n"); pkt = (uchar *)et; eth_hdr_size = net_update_ether(et, et->et_src, PROT_ARP); pkt += eth_hdr_size; @@ -203,7 +203,8 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len) /* matched waiting packet's address */ if (reply_ip_addr == NetArpWaitReplyIP) { - debug("Got ARP REPLY, set eth addr (%pM)\n", + debug_cond(DEBUG_DEV_PKT, + "Got ARP REPLY, set eth addr (%pM)\n", arp->ar_data); /* save address for later use */ -- cgit v1.2.1