[DRBD-cvs] svn commit by phil - r2365 - trunk/drbd - Applied
Simon's update to the packet tracing (with a fe
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Fri Aug 11 10:34:23 CEST 2006
Author: phil
Date: 2006-08-11 10:34:22 +0200 (Fri, 11 Aug 2006)
New Revision: 2365
Modified:
trunk/drbd/drbd_int.h
trunk/drbd/drbd_main.c
Log:
Applied Simon's update to the packet tracing (with a few cosmetic
changes)
Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h 2006-08-11 08:24:29 UTC (rev 2364)
+++ trunk/drbd/drbd_int.h 2006-08-11 08:34:22 UTC (rev 2365)
@@ -1619,9 +1619,10 @@
#ifdef DUMP_EACH_PACKET
/*
- * variable that controls dumping
+ * variables that controls dumping
*/
extern int dump_packets;
+extern int dump_packet_devs;
#define DUMP_NONE 0
#define DUMP_SUMMARY 1
@@ -1638,7 +1639,8 @@
dump_packet(drbd_dev *mdev, struct socket *sock,
int recv, Drbd_Polymorph_Packet *p, char* file, int line)
{
- if (dump_packets > DUMP_NONE)
+ if (dump_packets > DUMP_NONE &&
+ ( ( 1 << (int)(mdev-drbd_conf)) & dump_packet_devs) )
_dump_packet(mdev,sock,recv,p,file,line);
}
#else
Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c 2006-08-11 08:24:29 UTC (rev 2364)
+++ trunk/drbd/drbd_main.c 2006-08-11 08:34:22 UTC (rev 2365)
@@ -131,7 +131,12 @@
// 0 = none
// 1 = summary (trace 'interesting' packets in summary fmt)
// 2 = verbose (trace all packets in full format)
+int dump_packet_devs = 0;// bitmap of drbd devices to have tracing
+ // enabled
+
module_param(dump_packets,int,0644);
+module_param(dump_packet_devs,int,0644);
+
#endif
// devfs name
@@ -305,14 +310,23 @@
hlist_for_each_entry(i, n, slot, colision) {
if (i==req) {
- D_ASSERT(drbd_req_get_sector(i) == sector);
- rv=1;
- break;
+ if (drbd_req_get_sector(i) != sector) {
+ ERR("tl_verify: found req %p but it has wrong sector (%llx versus %llx)\n",
+ req, (long long)drbd_req_get_sector(i), (long long)sector);
+ }
+ rv=1;
+ break;
}
}
spin_unlock_irq(&mdev->tl_lock);
+ // Really better find it!
+ if (!rv) {
+ ERR("tl_verify: failed to find req %p, sector %llx in list\n",
+ req, (long long)sector);
+ }
+
return rv;
}
@@ -1295,6 +1309,8 @@
down(&mdev->data.mutex);
+ dump_packet(mdev,mdev->data.socket,0,(void*)&h, __FILE__, __LINE__);
+
ok = ( sizeof(h) == drbd_send(mdev,mdev->data.socket,&h,sizeof(h),0) );
ok = ok && ( size == drbd_send(mdev,mdev->data.socket,data,size,0) );
@@ -2903,11 +2919,13 @@
if (dump_packets > DUMP_SUMMARY) { \
INFO("%s:%d: %s [%d] %s %s " fmt , \
file, line, current->comm, current->pid, \
- sockname, recv?"<<<":">>>" \
- , ## args ); \
+ sockname, recv?"<<<":">>>", \
+ ## args ); \
} \
else { \
- INFO("%s " fmt, recv?"<<<":">>>", ## args ); \
+ INFO("%s %s " fmt, sockname, \
+ recv?"<<<":">>>", \
+ ## args ); \
} \
} while (0)
@@ -2929,8 +2947,6 @@
break;
case Data:
- case DataReply:
- case RSDataReply:
INFOP("%s (sector %llx, id %llx, seq %x, f %x)\n", cmdname(cmd),
(long long)be64_to_cpu(p->Data.sector),
(long long)be64_to_cpu(p->Data.block_id),
@@ -2939,6 +2955,14 @@
);
break;
+ case DataReply:
+ case RSDataReply:
+ INFOP("%s (sector %llx, id %llx)\n", cmdname(cmd),
+ (long long)be64_to_cpu(p->Data.sector),
+ (long long)be64_to_cpu(p->Data.block_id)
+ );
+ break;
+
case RecvAck:
case WriteAck:
case NegAck:
More information about the drbd-cvs
mailing list