The branch, master has been updated
       via  67bb12c8f0af5914efb44b76bc6ddbb11fc0fcdf (commit)
      from  00b1a635e3d61ca7c5487d65ac54f3eb6ea7355e (commit)

http://gitweb.samba.org/?p=tridge/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 67bb12c8f0af5914efb44b76bc6ddbb11fc0fcdf
Author: Andrew Tridgell <[EMAIL PROTECTED]>
Date:   Fri Jul 4 18:00:24 2008 +1000

    an extraordinarily ugly patch!
    
    This is a hack to allow backtraces under valgrind to show what opcode
    is getting uninitialised bytes

-----------------------------------------------------------------------

Summary of changes:
 include/ctdb_private.h |    1 +
 server/ctdb_control.c  |    5 +-
 server/ctdb_server.c   |  115 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 118 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 137dbee..ad4805f 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -811,6 +811,7 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, 
TDB_DATA key,
 int ctdb_ltdb_persistent_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, 
                    struct ctdb_ltdb_header *header, TDB_DATA data);
 void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr);
+void ctdb_queue_packet_opcode(struct ctdb_context *ctdb, struct 
ctdb_req_header *hdr, unsigned opcode);
 int ctdb_ltdb_lock_requeue(struct ctdb_db_context *ctdb_db, 
                           TDB_DATA key, struct ctdb_req_header *hdr,
                           void (*recv_pkt)(void *, struct ctdb_req_header *),
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index 7d55413..aaadbae 100644
--- a/server/ctdb_control.c
+++ b/server/ctdb_control.c
@@ -400,7 +400,6 @@ static int32_t ctdb_control_dispatch(struct ctdb_context 
*ctdb,
        }
 }
 
-
 /*
   send a reply for a ctdb control
  */
@@ -433,8 +432,8 @@ void ctdb_request_control_reply(struct ctdb_context *ctdb, 
struct ctdb_req_contr
                r->errorlen = strlen(errormsg);
                memcpy(&r->data[r->datalen], errormsg, r->errorlen);
        }
-       
-       ctdb_queue_packet(ctdb, &r->hdr);       
+
+       ctdb_queue_packet_opcode(ctdb, &r->hdr, c->opcode);     
 
        talloc_free(r);
 }
diff --git a/server/ctdb_server.c b/server/ctdb_server.c
index a4c09a9..017fb9a 100644
--- a/server/ctdb_server.c
+++ b/server/ctdb_server.c
@@ -502,3 +502,118 @@ void ctdb_queue_packet(struct ctdb_context *ctdb, struct 
ctdb_req_header *hdr)
 }
 
 
+
+
+/*
+  a valgrind hack to allow us to get opcode specific backtraces
+  very ugly, and relies on no compiler optimisation!
+*/
+void ctdb_queue_packet_opcode(struct ctdb_context *ctdb, struct 
ctdb_req_header *hdr, unsigned opcode)
+{
+       switch (opcode) {
+#define DO_OP(x) ctdb_queue_packet(ctdb, hdr); break
+               DO_OP(1);
+               DO_OP(2);
+               DO_OP(3);
+               DO_OP(4);
+               DO_OP(5);
+               DO_OP(6);
+               DO_OP(7);
+               DO_OP(8);
+               DO_OP(9);
+               DO_OP(10);
+               DO_OP(11);
+               DO_OP(12);
+               DO_OP(13);
+               DO_OP(14);
+               DO_OP(15);
+               DO_OP(16);
+               DO_OP(17);
+               DO_OP(18);
+               DO_OP(19);
+               DO_OP(20);
+               DO_OP(21);
+               DO_OP(22);
+               DO_OP(23);
+               DO_OP(24);
+               DO_OP(25);
+               DO_OP(26);
+               DO_OP(27);
+               DO_OP(28);
+               DO_OP(29);
+               DO_OP(30);
+               DO_OP(31);
+               DO_OP(32);
+               DO_OP(33);
+               DO_OP(34);
+               DO_OP(35);
+               DO_OP(36);
+               DO_OP(37);
+               DO_OP(38);
+               DO_OP(39);
+               DO_OP(40);
+               DO_OP(41);
+               DO_OP(42);
+               DO_OP(43);
+               DO_OP(44);
+               DO_OP(45);
+               DO_OP(46);
+               DO_OP(47);
+               DO_OP(48);
+               DO_OP(49);
+               DO_OP(50);
+               DO_OP(51);
+               DO_OP(52);
+               DO_OP(53);
+               DO_OP(54);
+               DO_OP(55);
+               DO_OP(56);
+               DO_OP(57);
+               DO_OP(58);
+               DO_OP(59);
+               DO_OP(60);
+               DO_OP(61);
+               DO_OP(62);
+               DO_OP(63);
+               DO_OP(64);
+               DO_OP(65);
+               DO_OP(66);
+               DO_OP(67);
+               DO_OP(68);
+               DO_OP(69);
+               DO_OP(70);
+               DO_OP(71);
+               DO_OP(72);
+               DO_OP(73);
+               DO_OP(74);
+               DO_OP(75);
+               DO_OP(76);
+               DO_OP(77);
+               DO_OP(78);
+               DO_OP(79);
+               DO_OP(80);
+               DO_OP(81);
+               DO_OP(82);
+               DO_OP(83);
+               DO_OP(84);
+               DO_OP(85);
+               DO_OP(86);
+               DO_OP(87);
+               DO_OP(88);
+               DO_OP(89);
+               DO_OP(90);
+               DO_OP(91);
+               DO_OP(92);
+               DO_OP(93);
+               DO_OP(94);
+               DO_OP(95);
+               DO_OP(96);
+               DO_OP(97);
+               DO_OP(98);
+               DO_OP(99);
+               DO_OP(100);
+       default: 
+               ctdb_queue_packet(ctdb, hdr);
+               break;
+       }
+}


-- 
CTDB repository

Reply via email to