ctdb-common: Drop debugging variable CTDB_EXTERNAL_TRACE
authorMartin Schwenke <martin@meltin.net>
Tue, 20 Feb 2018 07:32:04 +0000 (18:32 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 1 Mar 2018 18:39:15 +0000 (19:39 +0100)
This was an attempt to debug an unexpected situation.  It never
triggered, so delete it and all supporting code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/common.h
ctdb/common/ctdb_util.c
ctdb/config/ctdbd_wrapper
ctdb/config/gcore_trace.sh [deleted file]
ctdb/packaging/RPM/ctdb.spec.in
ctdb/wscript

index 1b276ca21391c384fb384db162f0fc0defc315db..02bb746c9b34ce23b17ebd44633d1c0d9e04f5ca 100644 (file)
@@ -103,8 +103,6 @@ bool ctdb_set_helper(const char *type, char *helper, size_t size,
                     const char *envvar,
                     const char *dir, const char *file);
 
-void ctdb_external_trace(void);
-
 int ctdb_parse_address(TALLOC_CTX *mem_ctx, const char *str,
                       ctdb_sock_addr *address);
 
index 82526b58a1987f75ae35ea0429aa29ab2b8adc9c..cbab3672a675cbe70c148236ea0bc84a45fdeb50 100644 (file)
@@ -136,36 +136,6 @@ bool ctdb_set_helper(const char *type, char *helper, size_t size,
        return true;
 }
 
-/* Invoke an external program to do some sort of tracing on the CTDB
- * process.  This might block for a little while.  The external
- * program is specified by the environment variable
- * CTDB_EXTERNAL_TRACE.  This program should take one argument: the
- * pid of the process to trace.  Commonly, the program would be a
- * wrapper script around gcore.
- */
-void ctdb_external_trace(void)
-{
-       int ret;
-       static char external_trace[PATH_MAX+1] = "";
-       char * cmd;
-
-       if (!ctdb_set_helper("external trace handler",
-                            external_trace, sizeof(external_trace),
-                            "CTDB_EXTERNAL_TRACE", NULL, NULL)) {
-               return;
-       }
-
-       cmd = talloc_asprintf(NULL, "%s %lu", external_trace, (unsigned long) getpid());
-       DEBUG(DEBUG_WARNING,("begin external trace: %s\n", cmd));
-       ret = system(cmd);
-       if (ret == -1) {
-               DEBUG(DEBUG_ERR,
-                     ("external trace command \"%s\" failed\n", cmd));
-       }
-       DEBUG(DEBUG_WARNING,("end external trace: %s\n", cmd));
-       talloc_free(cmd);
-}
-
 /*
   parse a IP:port pair
 */
@@ -462,7 +432,6 @@ char *ctdb_addr_to_str(ctdb_sock_addr *addr)
                break;
        default:
                DEBUG(DEBUG_ERR, (__location__ " ERROR, unknown family %u\n", addr->sa.sa_family));
-               ctdb_external_trace();
        }
 
        return cip;
index 8eec379910ef94da2845a5c49b0924b432589a53..a9587864f5b1a277506f4a33bf5637faa29767eb 100755 (executable)
@@ -148,7 +148,6 @@ build_ctdb_options ()
 export_debug_variables ()
 {
     [ -n "$CTDB_DEBUG_HUNG_SCRIPT" ] && export CTDB_DEBUG_HUNG_SCRIPT
-    [ -n "$CTDB_EXTERNAL_TRACE" ] && export CTDB_EXTERNAL_TRACE
     [ -n "$CTDB_DEBUG_LOCKS" ] && export CTDB_DEBUG_LOCKS
 }
 
diff --git a/ctdb/config/gcore_trace.sh b/ctdb/config/gcore_trace.sh
deleted file mode 100755 (executable)
index 4d3e1d1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-gcore -o "/var/log/core" "$1" 2>&1 | logger -t "ctdb:gcore_trace"
index 5ed9335b28673edb252830c417a3296afcea1823..7e89634eed4db3e2120a300ce5b14f84f9c0fc4a 100644 (file)
@@ -157,7 +157,6 @@ rm -rf $RPM_BUILD_ROOT
 %config(noreplace) %{_sysconfdir}/ctdb/notify.sh
 %config(noreplace) %{_sysconfdir}/ctdb/debug-hung-script.sh
 %config(noreplace) %{_sysconfdir}/ctdb/ctdb-crash-cleanup.sh
-%config(noreplace) %{_sysconfdir}/ctdb/gcore_trace.sh
 %config(noreplace) %{_sysconfdir}/ctdb/debug_locks.sh
 
 %config(noreplace, missingok) %{_sysconfdir}/sysconfig/ctdb
index 059ce3d43d819220c4b31c162429954a1516e240..f96d692cc16e21b8dffc7aace9639d761fca20ca 100644 (file)
@@ -713,7 +713,6 @@ def build(bld):
         'ctdb-crash-cleanup.sh',
         'debug-hung-script.sh',
         'debug_locks.sh',
-        'gcore_trace.sh',
         'nfs-linux-kernel-callout',
         'notify.sh',
         'statd-callout'