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 2019/11/19 06:28:13 UTC

[trafficserver] branch 9.0.x updated (5841e56 -> ffcc973)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a change to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 5841e56  Add test to catch regressions in sni and override configs (#6170)
     new c7e32a8  Add basic SystemTap markers support
     new ffcc973  Reduce doc build errors

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                                        | 19 +++++++++++++++++++
 doc/admin-guide/plugins/slice.en.rst                |  4 ++--
 doc/developer-guide/debugging/debug-builds.en.rst   | 19 +++++++++++++++++++
 doc/release-notes/whats-new.en.rst                  |  1 +
 .../background_fetch/headers.h => include/ts/sdt.h  | 21 ++++++++++++++++-----
 proxy/http/HttpSM.cc                                |  3 +++
 6 files changed, 60 insertions(+), 7 deletions(-)
 copy plugins/background_fetch/headers.h => include/ts/sdt.h (68%)


[trafficserver] 01/02: Add basic SystemTap markers support

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit c7e32a84eb724e45a6ef18e55aa9a41e4b71a644
Author: Emanuele Rocca <em...@wikimedia.org>
AuthorDate: Thu Oct 10 13:48:43 2019 -0700

    Add basic SystemTap markers support
    
    Introduce a new ./configure flag, --enable-systemtap, to build
    traffic_server with SystemTap markers support. Also include a marker
    called "new_origin_server_connection" under the "trafficserver"
    provider.
    
    See https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps
    
    (cherry picked from commit dd27599720cfccbfd77fa20e47f529fa972d0469)
---
 configure.ac                                      | 19 +++++++++++
 doc/developer-guide/debugging/debug-builds.en.rst | 19 +++++++++++
 doc/release-notes/whats-new.en.rst                |  1 +
 include/ts/sdt.h                                  | 40 +++++++++++++++++++++++
 proxy/http/HttpSM.cc                              |  3 ++
 5 files changed, 82 insertions(+)

diff --git a/configure.ac b/configure.ac
index 8a9bb93..c03c6df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2085,6 +2085,25 @@ AC_CHECK_TYPE([struct tcp_info],
   ]]
 )
 
+AC_MSG_CHECKING([whether to include systemtap tracing support])
+AC_ARG_ENABLE([systemtap],
+              [AS_HELP_STRING([--enable-systemtap],
+                              [Enable inclusion of systemtap trace support])],
+              [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no'])
+AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes])
+AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
+
+if test "x${ENABLE_SYSTEMTAP}" = xyes; then
+  AC_CHECK_PROGS(DTRACE, dtrace)
+  if test -z "$DTRACE"; then
+    AC_MSG_ERROR([dtrace not found])
+  fi
+  AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
+                  [SDT_H_FOUND='no';
+                     AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
+  AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using probes.])
+fi
+
 # See if we can build the remap_stats plugin
 AS_IF([test "x$enable_experimental_plugins" = "xyes"],
   [
diff --git a/doc/developer-guide/debugging/debug-builds.en.rst b/doc/developer-guide/debugging/debug-builds.en.rst
index 53ad22c..d1e823f 100644
--- a/doc/developer-guide/debugging/debug-builds.en.rst
+++ b/doc/developer-guide/debugging/debug-builds.en.rst
@@ -41,3 +41,22 @@ Debugging Tips:
 -  Use assertions in your plugin (:c:func:`TSAssert` and :c:func:`TSReleaseAssert`).
 
 
+SystemTap and DTrace support
+****************************
+
+Traffic Server can be instrumented with **SystemTap** on Linux systems, or
+**DTrace** on *BSDs and macOS. In order to use such tools, Traffic Server needs
+to be built with ``-g``, or the debug symbols need to be installed. On Debian
+systems, install the ``trafficserver-dbgsym`` package to install the debug
+symbols.
+
+In addition to the normal probe points that can be used with SystemTap and
+DTrace, such as function calls and specific statements, Traffic Server does
+provide SDT markers at various interesting code paths.
+
+Pass the ``--enable-systemtap`` flag to ``./configure`` in order to build
+Traffic Server with dtrace style markers (SDT). On Traffic Server builds with
+SDT markers enabled, you can list the available markers with ``stap -L
+'process("/path/to/traffic_server").mark("*")``.
+
+See the `SystemTap documentation <https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps>`_ and the `DTrace guide <http://dtrace.org/guide/chp-sdt.html>`_ for more information.
diff --git a/doc/release-notes/whats-new.en.rst b/doc/release-notes/whats-new.en.rst
index 93486a0..4ddf378 100644
--- a/doc/release-notes/whats-new.en.rst
+++ b/doc/release-notes/whats-new.en.rst
@@ -29,6 +29,7 @@ of <z> contributors have participated in this development cycle.
 
 New Features
 ------------
+- Add support for dtrace style markers (SDT) and include a few markers at locations of interest to users of SystemTap, dtrace, and gdb. See :ref:`developer-debug-builds`.
 
 This version of ATS has a number of new features (details below), but we're
 particularly excited about the following features:
diff --git a/include/ts/sdt.h b/include/ts/sdt.h
new file mode 100644
index 0000000..68f8d92
--- /dev/null
+++ b/include/ts/sdt.h
@@ -0,0 +1,40 @@
+/** @file
+
+    A brief file description
+
+    @section license License
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+*/
+
+#pragma once
+
+#ifdef HAVE_SYSTEMTAP
+
+#include <sys/sdt.h>
+
+#define ATS_PROBE(probe) DTRACE_PROBE(trafficserver, probe)
+#define ATS_PROBE1(probe, param1) DTRACE_PROBE1(trafficserver, probe, param1)
+#define ATS_PROBE2(probe, param1, param2) DTRACE_PROBE2(trafficserver, probe, param1, param2)
+
+#else
+
+#define ATS_PROBE(...)
+#define ATS_PROBE1(...)
+#define ATS_PROBE2(...)
+
+#endif
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 9f3eb4b..45d3e5b 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -44,6 +44,7 @@
 #include "IPAllow.h"
 #include "tscore/I_Layout.h"
 #include "tscore/bwf_std_format.h"
+#include "ts/sdt.h"
 
 #include <openssl/ossl_typ.h>
 #include <openssl/ssl.h>
@@ -1712,6 +1713,8 @@ HttpSM::state_http_server_open(int event, void *data)
 
     session->new_connection(vc);
 
+    ATS_PROBE1(new_origin_server_connection, t_state.current.server->name);
+
     session->state = HSS_ACTIVE;
     ats_ip_copy(&t_state.server_info.src_addr, netvc->get_local_addr());
 


[trafficserver] 02/02: Reduce doc build errors

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit ffcc9737e55728def769fea46c2f49031291db89
Author: Miles Libbey <ml...@apache.org>
AuthorDate: Wed Nov 6 17:54:27 2019 -0800

    Reduce doc build errors
    
    Had these build errors
    trafficserver/doc/admin-guide/plugins/slice.en.rst:141: WARNING: Literal block expected; none found.
    trafficserver/doc/developer-guide/debugging/debug-builds.en.rst:47: WARNING: Inline emphasis start-string without end-string.
    trafficserver/doc/release-notes/whats-new.en.rst:36: WARNING: Title underline too short.
    
    Fixes were
    - Added indentation to slice code block
    - The * in *BSD needed escaping
    - Added and extra underline
    
    (cherry picked from commit ca01eac678e99c7639f151a0d6c6969bfd749ccf)
    
     Conflicts:
    	doc/release-notes/whats-new.en.rst
---
 doc/admin-guide/plugins/slice.en.rst              | 4 ++--
 doc/developer-guide/debugging/debug-builds.en.rst | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/plugins/slice.en.rst b/doc/admin-guide/plugins/slice.en.rst
index f928fa1..e848312 100644
--- a/doc/admin-guide/plugins/slice.en.rst
+++ b/doc/admin-guide/plugins/slice.en.rst
@@ -138,9 +138,9 @@ Under normal logging these slice block errors tend to show up as::
 By default more detailed stitching errors are written to ``diags.log``.
 Examples are as follows::
 
-ERROR: [slice.cc: 288] logSliceError(): 1555705573.639 reason="Non 206 internal block response" uri="http://ats_ep/someasset.mp4" uas="curl" req_range="bytes=1000000-" norm_range="bytes 1000000-52428799/52428800" etag_exp="%221603934496%22" lm_exp="Fri, 19 Apr 2019 18:53:20 GMT" blk_range="21000000-21999999" status_got="206" cr_got="" etag_got="%221603934496%22" lm_got="" cc="no-store" via=""
+    ERROR: [slice.cc: 288] logSliceError(): 1555705573.639 reason="Non 206 internal block response" uri="http://ats_ep/someasset.mp4" uas="curl" req_range="bytes=1000000-" norm_range="bytes 1000000-52428799/52428800" etag_exp="%221603934496%22" lm_exp="Fri, 19 Apr 2019 18:53:20 GMT" blk_range="21000000-21999999" status_got="206" cr_got="" etag_got="%221603934496%22" lm_got="" cc="no-store" via=""
 
-ERROR: [server.cc: 288] logSliceError(): 1572370000.219 reason="Mismatch block Etag" uri="http://ats_ep/someasset.mp4" uas="curl" req_range="bytes=1092779033-1096299354" norm_range="bytes 1092779033-1096299354/2147483648" etag_exp="%223719843648%22" lm_exp="Tue, 29 Oct 2019 14:40:00 GMT" blk_range="1095000000-1095999999" status_got="206" cr_got="bytes 1095000000-1095999999/2147483648" etag_got="%223719853648%22" lm_got="Tue, 29 Oct 2019 17:26:40 GMT" cc="max-age=10000" via=""
+    ERROR: [server.cc: 288] logSliceError(): 1572370000.219 reason="Mismatch block Etag" uri="http://ats_ep/someasset.mp4" uas="curl" req_range="bytes=1092779033-1096299354" norm_range="bytes 1092779033-1096299354/2147483648" etag_exp="%223719843648%22" lm_exp="Tue, 29 Oct 2019 14:40:00 GMT" blk_range="1095000000-1095999999" status_got="206" cr_got="bytes 1095000000-1095999999/2147483648" etag_got="%223719853648%22" lm_got="Tue, 29 Oct 2019 17:26:40 GMT" cc="max-age=10000" via=""
 
 Whether or how often these detailed log entries are written are
 configurable plugin options.
diff --git a/doc/developer-guide/debugging/debug-builds.en.rst b/doc/developer-guide/debugging/debug-builds.en.rst
index d1e823f..099312b 100644
--- a/doc/developer-guide/debugging/debug-builds.en.rst
+++ b/doc/developer-guide/debugging/debug-builds.en.rst
@@ -45,7 +45,7 @@ SystemTap and DTrace support
 ****************************
 
 Traffic Server can be instrumented with **SystemTap** on Linux systems, or
-**DTrace** on *BSDs and macOS. In order to use such tools, Traffic Server needs
+**DTrace** on \*BSDs and macOS. In order to use such tools, Traffic Server needs
 to be built with ``-g``, or the debug symbols need to be installed. On Debian
 systems, install the ``trafficserver-dbgsym`` package to install the debug
 symbols.