net: contiki: Improve uip_packetqueue debug statements

Add more debug statements to uip_packetqueue and improve
some of them.

Change-Id: I43040f6ba1051feb9aa311036faee4476c6bc80f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
This commit is contained in:
Ravi kumar Veeramally 2016-03-17 16:03:19 +02:00 committed by Gerrit Code Review
commit 09ce826789

View file

@ -21,7 +21,7 @@ packet_timedout(struct net_buf *buf, void *ptr)
{ {
struct uip_packetqueue_handle *h = ptr; struct uip_packetqueue_handle *h = ptr;
PRINTF("uip_packetqueue_free timed out %p\n", h); PRINTF("uip_packetqueue_free timed out handle %p, packet %p\n", h, h->packet);
memb_free(&packets_memb, h->packet); memb_free(&packets_memb, h->packet);
h->packet = NULL; h->packet = NULL;
} }
@ -38,11 +38,12 @@ uip_packetqueue_alloc(struct net_buf *buf, struct uip_packetqueue_handle *handle
{ {
PRINTF("uip_packetqueue_alloc %p\n", handle); PRINTF("uip_packetqueue_alloc %p\n", handle);
if(handle->packet != NULL) { if(handle->packet != NULL) {
PRINTF("alloced\n"); PRINTF("handle->packet != NULL, so failed to alloc\n");
return NULL; return NULL;
} }
handle->packet = memb_alloc(&packets_memb); handle->packet = memb_alloc(&packets_memb);
if(handle->packet != NULL) { if(handle->packet != NULL) {
PRINTF("uip_packetqueue_alloc packet %p\n", handle->packet);
ctimer_set(buf, &handle->packet->lifetimer, lifetime, ctimer_set(buf, &handle->packet->lifetimer, lifetime,
packet_timedout, handle); packet_timedout, handle);
} else { } else {
@ -56,6 +57,7 @@ uip_packetqueue_free(struct uip_packetqueue_handle *handle)
{ {
PRINTF("uip_packetqueue_free %p\n", handle); PRINTF("uip_packetqueue_free %p\n", handle);
if(handle->packet != NULL) { if(handle->packet != NULL) {
PRINTF("uip_packetqueue_free packet %p\n", handle->packet);
ctimer_stop(&handle->packet->lifetimer); ctimer_stop(&handle->packet->lifetimer);
memb_free(&packets_memb, handle->packet); memb_free(&packets_memb, handle->packet);
handle->packet = NULL; handle->packet = NULL;