pidl: add NDR_PRINT_DEBUG output to generated s3 server dispatch tables.
authorGünther Deschner <gd@samba.org>
Fri, 7 May 2010 20:54:08 +0000 (22:54 +0200)
committerGünther Deschner <gd@samba.org>
Sat, 8 May 2010 21:00:20 +0000 (23:00 +0200)
This dramatically helps tracking and debugging usage of the
rpc_pipe_open_internal users.

Guenther

pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm

index 7c9091ea94ef6ff6b805ffaa2d165df74eb966ed..057dca6c50cdb862037f2286d1bfd2f1954f4e0c 100644 (file)
@@ -243,8 +243,18 @@ sub ParseDispatchFunction($)
                pidl "case $op: {";
                indent;
                pidl "struct $fn->{NAME} *r = (struct $fn->{NAME} *)_r;";
+
+               pidl "if (DEBUGLEVEL >= 10) {";
+               pidl "\tNDR_PRINT_IN_DEBUG($fn->{NAME}, r);";
+               pidl "}";
+
                CallWithStruct("cli->pipes_struct", "mem_ctx", $fn, 
                        sub { pidl "\treturn NT_STATUS_NO_MEMORY;"; });
+
+               pidl "if (DEBUGLEVEL >= 10) {";
+               pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, r);";
+               pidl "}";
+
                pidl "return NT_STATUS_OK;";
                deindent;
                pidl "}";