Add more logs to help debug packet processing issues
Change-Id: Ia9e36bff44b6bad018305725ebb0fc2a47c86376
diff --git a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
index 943bb93..657ca48 100644
--- a/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
+++ b/core/net/src/main/java/org/onosproject/net/packet/impl/PacketManager.java
@@ -385,9 +385,19 @@
// TODO filter packets sent to processors based on registrations
for (ProcessorEntry entry : processors) {
try {
+ if (log.isTraceEnabled()) {
+ log.trace("Starting packet processing by {}",
+ entry.processor().getClass().getName());
+ }
+
long start = System.nanoTime();
entry.processor().process(context);
entry.addNanos(System.nanoTime() - start);
+
+ if (log.isTraceEnabled()) {
+ log.trace("Finished packet processing by {}",
+ entry.processor().getClass().getName());
+ }
} catch (Exception e) {
log.warn("Packet processor {} threw an exception", entry.processor(), e);
}
diff --git a/protocols/openflow/api/src/main/java/org/onosproject/openflow/controller/DefaultOpenFlowPacketContext.java b/protocols/openflow/api/src/main/java/org/onosproject/openflow/controller/DefaultOpenFlowPacketContext.java
index 9bd2146..ac9ed82 100644
--- a/protocols/openflow/api/src/main/java/org/onosproject/openflow/controller/DefaultOpenFlowPacketContext.java
+++ b/protocols/openflow/api/src/main/java/org/onosproject/openflow/controller/DefaultOpenFlowPacketContext.java
@@ -105,13 +105,17 @@
checkPermission(PACKET_READ);
try {
- return Ethernet.deserializer().deserialize(pktin.getData(), 0, pktin.getData().length);
+ return Ethernet.deserializer().deserialize(
+ pktin.getData(), 0, pktin.getData().length);
} catch (BufferUnderflowException | NullPointerException |
DeserializationException e) {
Logger log = LoggerFactory.getLogger(getClass());
- log.error("packet deserialization problem : {}", e.getMessage());
- return null;
+ log.error("Packet deserialization problem", e);
+ } catch (Exception e) {
+ Logger log = LoggerFactory.getLogger(getClass());
+ log.error("Unexpected packet deserialization problem", e);
}
+ return null;
}
@Override