You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/04/23 19:35:09 UTC
[1/2] git commit: TS-1218 Make traffic_cop tracing configureable at
build time
Updated Branches:
refs/heads/master fdf124199 -> f87611535
TS-1218 Make traffic_cop tracing configureable at build time
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b8f30b99
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b8f30b99
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b8f30b99
Branch: refs/heads/master
Commit: b8f30b9946ceeafb4182089689f58aa8f9e3f200
Parents: fdf1241
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Mar 18 21:25:45 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Apr 23 11:28:43 2013 -0600
----------------------------------------------------------------------
configure.ac | 17 ++++++++++++++++-
cop/TrafficCop.cc | 16 ++++++++--------
lib/ts/ink_config.h.in | 1 +
3 files changed, 25 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b8f30b99/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index c6d323f..dccde25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -336,13 +336,28 @@ AC_MSG_RESULT([$enable_hwloc])
#
AC_MSG_CHECKING([whether to enable ccache])
AC_ARG_ENABLE([ccache],
- [AS_HELP_STRING([--enable-ccache],[Enable ccache (can cause bad builds)])],
+ [AS_HELP_STRING([--enable-ccache],[Enable ccache (for developers)])],
[],
[enable_ccache="no"]
)
AC_MSG_RESULT([$enable_ccache])
#
+# Enble traffic_cop debugging
+#
+AC_MSG_CHECKING([whether to enable traffic_cop debugging])
+AC_ARG_ENABLE([cop-debug],
+ [AS_HELP_STRING([--enable-cop-debug],[Enable Traffic Cop debugging (for developers)])],
+ [],
+ [enable_cop-debug="no"]
+)
+AC_MSG_RESULT([$enable_cop_debug])
+TS_ARG_ENABLE_VAR([use], [cop-debug])
+AC_SUBST(use_cop_debug)
+
+
+
+#
# Use TPROXY for connection transparency.
#
AC_MSG_CHECKING([whether to enable TPROXY based transparency])
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b8f30b99/cop/TrafficCop.cc
----------------------------------------------------------------------
diff --git a/cop/TrafficCop.cc b/cop/TrafficCop.cc
index 6509f76..fd383c6 100644
--- a/cop/TrafficCop.cc
+++ b/cop/TrafficCop.cc
@@ -43,10 +43,8 @@ union semun
};
#endif // linux check
-// For debugging, turn this on.
-// #define TRACE_LOG_COP 1
-
static const long MAX_LOGIN = sysconf(_SC_LOGIN_NAME_MAX) <= 0 ? _POSIX_LOGIN_NAME_MAX : sysconf(_SC_LOGIN_NAME_MAX);
+static const char COP_TRACE_FILE[] = "/tmp/traffic_cop.trace";
#define OPTIONS_MAX 32
#define OPTIONS_LEN_MAX 1024
@@ -142,7 +140,7 @@ dummy_cop_log_trace(const char *format, ...)
(void)format;
}
-#ifdef TRACE_LOG_COP
+#if TS_USE_COP_DEBUG
#define cop_log_trace(...) cop_log(COP_DEBUG, __VA_ARGS__)
#else
#define cop_log_trace(...) if (0) dummy_cop_log_trace(__VA_ARGS__)
@@ -154,7 +152,7 @@ cop_log(int priority, const char *format, ...)
{
va_list args;
char buffer[8192];
-#ifdef TRACE_LOG_COP
+#if TS_USE_COP_DEBUG
static FILE *trace_file = NULL;
struct timeval now;
double now_f;
@@ -162,9 +160,11 @@ cop_log(int priority, const char *format, ...)
va_start(args, format);
-#ifdef TRACE_LOG_COP
- if (!trace_file)
- trace_file = fopen("/tmp/traffic_cop.trace", "w");
+#if TS_USE_COP_DEBUG
+ if (!trace_file) {
+ if (!unlink(COP_TRACE_FILE))
+ trace_file = fopen(COP_TRACE_FILE, "w");
+ }
if (trace_file) {
gettimeofday(&now, NULL);
now_f = now.tv_sec + now.tv_usec / 1000000.0f;
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b8f30b99/lib/ts/ink_config.h.in
----------------------------------------------------------------------
diff --git a/lib/ts/ink_config.h.in b/lib/ts/ink_config.h.in
index 93e393c..1a89bb2 100644
--- a/lib/ts/ink_config.h.in
+++ b/lib/ts/ink_config.h.in
@@ -123,6 +123,7 @@
#define TS_USE_TLS_NPN @use_tls_npn@
#define TS_USE_TLS_SNI @use_tls_sni@
#define TS_USE_LINUX_NATIVE_AIO @use_linux_native_aio@
+#define TS_USE_COP_DEBUG @use_cop_debug@
/* OS API definitions */
#define GETHOSTBYNAME_R_HOSTENT_DATA @gethostbyname_r_hostent_data@
[2/2] git commit: Added TS-1218,
and cleaning up recent additions to this file.
Posted by zw...@apache.org.
Added TS-1218, and cleaning up recent additions to this file.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f8761153
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f8761153
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f8761153
Branch: refs/heads/master
Commit: f876115351e56521c4c5bbd5d6b60d3f66205089
Parents: b8f30b9
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Apr 23 11:29:57 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Apr 23 11:29:57 2013 -0600
----------------------------------------------------------------------
CHANGES | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8761153/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 29b8745..645a1ce 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,9 +2,11 @@
Changes with Apache Traffic Server 3.3.3
- *) [TS-1846] remove TestHook
+ *) [TS-1218] Make traffic_cop tracing configureable at build time.
- *) [TS-1844] efficient HostDB file allocation
+ *) [TS-1846] Remove TestHook.
+
+ *) [TS-1844] Efficient HostDB file allocation.
*) [TS-1586] Fix the SPDY plugin build under clang on Linux.