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 --- drivers/net/netconsole.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 19e563e..14243b8 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -83,6 +83,8 @@ int nc_input_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len) if (dest != nc_port || !len) return 0; /* not for us */ + debug_cond(DEBUG_DEV_PKT, "input: \"%*.*s\"\n", len, len, pkt); + if (input_size == sizeof(input_buffer)) return 1; /* no space */ if (len > sizeof(input_buffer) - input_size) @@ -112,6 +114,8 @@ static void nc_send_packet(const char *buf, int len) uchar *ether; IPaddr_t ip; + debug_cond(DEBUG_DEV_PKT, "output: \"%*.*s\"\n", len, len, buf); + eth = eth_get_dev(); if (eth == NULL) return; -- cgit v1.1