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 2016/07/02 16:30:00 UTC

[trafficserver] branch master updated (5e959ec -> 4cd270d)

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

zwoop pushed a change to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git.

      from  5e959ec   TS-4623 Adds a pre-commit script for git
       new  fadb41b   TS-4519 Adds a new log tag, %<crid> for the sm_id
       new  dda9df7   TS-4519 Adds a new log tag, %<puuid> for the process UUID
       new  4cd270d   TS-4519 Adds a new log tag, %<cruuid> client_req unique ID

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


Summary of changes:
 proxy/logging/Log.cc           | 15 +++++++++++++++
 proxy/logging/LogAccess.cc     | 33 +++++++++++++++++++++++++++++++++
 proxy/logging/LogAccess.h      | 21 +++++++++++++--------
 proxy/logging/LogAccessHttp.cc | 37 +++++++++++++++++++++++++++++++++++++
 proxy/logging/LogAccessHttp.h  |  4 +++-
 5 files changed, 101 insertions(+), 9 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 02/03: TS-4519 Adds a new log tag, % for the process UUID

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

zwoop pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit dda9df7ca7b886b5fd54d3ff6e9ed4f741948ba3
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Jun 14 11:10:27 2016 -0600

    TS-4519 Adds a new log tag, %<puuid> for the process UUID
---
 proxy/logging/Log.cc           |  5 +++++
 proxy/logging/LogAccess.cc     | 15 +++++++++++++++
 proxy/logging/LogAccess.h      | 17 ++++++++++-------
 proxy/logging/LogAccessHttp.cc |  1 +
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 1840d85..8cb21b4 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -476,6 +476,11 @@ Log::init_fields()
   global_field_list.add(field, false);
   ink_hash_table_insert(field_symbol_hash, "cluc", field);
 
+  field = new LogField("process_uuid", "puuid", LogField::STRING, &LogAccess::marshal_process_uuid,
+                       (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
+  global_field_list.add(field, false);
+  ink_hash_table_insert(field_symbol_hash, "puuid", field);
+
   field = new LogField("client_req_body_len", "cqbl", LogField::sINT, &LogAccess::marshal_client_req_body_len,
                        &LogAccess::unmarshal_int_to_str);
   global_field_list.add(field, false);
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index f3a47f6..d2d518b 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -96,6 +96,7 @@ LogAccess::marshal_host_interface_ip(char *buf)
 {
   DEFAULT_IP_FIELD;
 }
+
 /*-------------------------------------------------------------------------
   -------------------------------------------------------------------------*/
 int
@@ -710,6 +711,20 @@ LogAccess::marshal_entry_type(char *buf)
 
 /*-------------------------------------------------------------------------
   -------------------------------------------------------------------------*/
+int
+LogAccess::marshal_process_uuid(char *buf)
+{
+  int len = round_strlen(TS_UUID_STRING_LEN + 1);
+
+  if (buf) {
+    const char *str = (char *)Machine::instance()->uuid.getString();
+    marshal_str(buf, str, len);
+  }
+  return len;
+}
+
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
 
 int
 LogAccess::marshal_config_int_var(char *config_var, char *buf)
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index 3c8d226..c90b0df 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -263,13 +263,16 @@ public:
 
   // other fields
   //
-  inkcoreapi virtual int marshal_transfer_time_ms(char *);       // INT
-  inkcoreapi virtual int marshal_transfer_time_s(char *);        // INT
-  inkcoreapi virtual int marshal_file_size(char *);              // INT
-  inkcoreapi virtual int marshal_plugin_identity_id(char *);     // INT
-  inkcoreapi virtual int marshal_plugin_identity_tag(char *);    // STR
-  inkcoreapi virtual int marshal_cache_lookup_url_canon(char *); // STR
-  int marshal_entry_type(char *);                                // INT
+  inkcoreapi virtual int marshal_transfer_time_ms(char *);    // INT
+  inkcoreapi virtual int marshal_transfer_time_s(char *);     // INT
+  inkcoreapi virtual int marshal_file_size(char *);           // INT
+  inkcoreapi virtual int marshal_plugin_identity_id(char *);  // INT
+  inkcoreapi virtual int marshal_plugin_identity_tag(char *); // STR
+  inkcoreapi virtual int marshal_process_uuid(char *);        // STR
+
+  // These two are special, in that they are shared for all log types / implementations
+  inkcoreapi int marshal_entry_type(char *);             // INT
+  inkcoreapi int marshal_cache_lookup_url_canon(char *); // STR
 
   // named fields from within a http header
   //
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index ff462c5..beb9e48 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -756,6 +756,7 @@ LogAccessHttp::marshal_client_req_id(char *buf)
   }
   return INK_MIN_ALIGN;
 }
+
 /*-------------------------------------------------------------------------
 -------------------------------------------------------------------------*/
 int

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 03/03: TS-4519 Adds a new log tag, % client_req unique ID

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

zwoop pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 4cd270dc5be6ae0e7f985daebb4e6f666848e741
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Tue Jun 14 11:27:31 2016 -0600

    TS-4519 Adds a new log tag, %<cruuid> client_req unique ID
    
    This is in reality just a concatenation of %<puiid>-%<crid>, but
    is convenient to have, and also assures consistency with other
    features (e.g. header_rewrite, and Debug() in the HttpSM).
---
 proxy/logging/Log.cc           |  5 +++++
 proxy/logging/LogAccess.cc     |  9 +++++++++
 proxy/logging/LogAccess.h      |  1 +
 proxy/logging/LogAccessHttp.cc | 22 ++++++++++++++++++++++
 proxy/logging/LogAccessHttp.h  |  1 +
 5 files changed, 38 insertions(+)

diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 8cb21b4..1d568b0 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -524,6 +524,11 @@ Log::init_fields()
   global_field_list.add(field, false);
   ink_hash_table_insert(field_symbol_hash, "crid", field);
 
+  field = new LogField("client_req_uuid", "cruuid", LogField::STRING, &LogAccess::marshal_client_req_uuid,
+                       (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
+  global_field_list.add(field, false);
+  ink_hash_table_insert(field_symbol_hash, "cruuid", field);
+
   // proxy -> client fields
   field = new LogField("proxy_resp_content_type", "psct", LogField::STRING, &LogAccess::marshal_proxy_resp_content_type,
                        (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index d2d518b..8c1c8ae 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -309,6 +309,15 @@ LogAccess::marshal_client_req_id(char *buf)
   -------------------------------------------------------------------------*/
 
 int
+LogAccess::marshal_client_req_uuid(char *buf)
+{
+  DEFAULT_STR_FIELD;
+}
+
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
 LogAccess::marshal_proxy_resp_content_type(char *buf)
 {
   DEFAULT_STR_FIELD;
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index c90b0df..7ba8bb6 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -194,6 +194,7 @@ public:
   inkcoreapi virtual int marshal_client_security_cipher_suite(char *);  // STR
   inkcoreapi virtual int marshal_client_finish_status_code(char *);     // INT
   inkcoreapi virtual int marshal_client_req_id(char *);                 // INT
+  inkcoreapi virtual int marshal_client_req_uuid(char *);               // STR
 
   //
   // proxy -> client fields
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index beb9e48..fbb19c5 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -40,6 +40,7 @@
 #include "LogObject.h"
 #include "LogConfig.h"
 #include "Log.h"
+#include "I_Machine.h"
 
 /*-------------------------------------------------------------------------
   LogAccessHttp
@@ -758,6 +759,27 @@ LogAccessHttp::marshal_client_req_id(char *buf)
 }
 
 /*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
+LogAccessHttp::marshal_client_req_uuid(char *buf)
+{
+  static unsigned _MAX_CRUUID_LEN = TS_UUID_STRING_LEN + 1 + 20; // 20 == max len of int64_t
+
+  if (buf) {
+    char str[_MAX_CRUUID_LEN + 1];
+    const char *uuid = (char *)Machine::instance()->uuid.getString();
+    int len;
+
+    len = snprintf(str, _MAX_CRUUID_LEN, "%s-%" PRId64 "", uuid, m_http_sm->sm_id);
+    marshal_str(buf, str, round_strlen(len + 1));
+    return len;
+  }
+
+  return round_strlen(_MAX_CRUUID_LEN + 1);
+}
+
+/*-------------------------------------------------------------------------
 -------------------------------------------------------------------------*/
 int
 LogAccessHttp::marshal_client_security_protocol(char *buf)
diff --git a/proxy/logging/LogAccessHttp.h b/proxy/logging/LogAccessHttp.h
index d4ed0f1..3ed4934 100644
--- a/proxy/logging/LogAccessHttp.h
+++ b/proxy/logging/LogAccessHttp.h
@@ -78,6 +78,7 @@ public:
   virtual int marshal_client_security_cipher_suite(char *);  // STR
   virtual int marshal_client_finish_status_code(char *);     // INT
   virtual int marshal_client_req_id(char *);                 // INT
+  virtual int marshal_client_req_uuid(char *);               // STR
 
   //
   // proxy -> client fields

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 01/03: TS-4519 Adds a new log tag, % for the sm_id

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

zwoop pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit fadb41bc5509de232c91f43444670a38445583a9
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Mon Jun 13 15:47:38 2016 -0600

    TS-4519 Adds a new log tag, %<crid> for the sm_id
---
 proxy/logging/Log.cc           |  5 +++++
 proxy/logging/LogAccess.cc     |  9 +++++++++
 proxy/logging/LogAccess.h      |  3 ++-
 proxy/logging/LogAccessHttp.cc | 14 ++++++++++++++
 proxy/logging/LogAccessHttp.h  |  3 ++-
 5 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 802f955..1840d85 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -514,6 +514,11 @@ Log::init_fields()
   global_field_list.add(field, false);
   ink_hash_table_insert(field_symbol_hash, "cfsc", field);
 
+  field =
+    new LogField("client_req_id", "crid", LogField::sINT, &LogAccess::marshal_client_req_id, &LogAccess::unmarshal_int_to_str);
+  global_field_list.add(field, false);
+  ink_hash_table_insert(field_symbol_hash, "crid", field);
+
   // proxy -> client fields
   field = new LogField("proxy_resp_content_type", "psct", LogField::STRING, &LogAccess::marshal_proxy_resp_content_type,
                        (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 5f77557..f3a47f6 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -299,6 +299,15 @@ LogAccess::marshal_client_finish_status_code(char *buf)
   -------------------------------------------------------------------------*/
 
 int
+LogAccess::marshal_client_req_id(char *buf)
+{
+  DEFAULT_INT_FIELD;
+}
+
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
 LogAccess::marshal_proxy_resp_content_type(char *buf)
 {
   DEFAULT_STR_FIELD;
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index 89844f8..3c8d226 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -190,9 +190,10 @@ public:
   inkcoreapi virtual int marshal_client_req_tcp_reused(char *);         // INT
   inkcoreapi virtual int marshal_client_req_is_ssl(char *);             // INT
   inkcoreapi virtual int marshal_client_req_ssl_reused(char *);         // INT
-  inkcoreapi virtual int marshal_client_finish_status_code(char *);     // INT
   inkcoreapi virtual int marshal_client_security_protocol(char *);      // STR
   inkcoreapi virtual int marshal_client_security_cipher_suite(char *);  // STR
+  inkcoreapi virtual int marshal_client_finish_status_code(char *);     // INT
+  inkcoreapi virtual int marshal_client_req_id(char *);                 // INT
 
   //
   // proxy -> client fields
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index 96ee885..ff462c5 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -722,6 +722,9 @@ LogAccessHttp::marshal_client_req_ssl_reused(char *buf)
   return INK_MIN_ALIGN;
 }
 
+/*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
 int
 LogAccessHttp::marshal_client_finish_status_code(char *buf)
 {
@@ -743,6 +746,17 @@ LogAccessHttp::marshal_client_finish_status_code(char *buf)
 }
 
 /*-------------------------------------------------------------------------
+  -------------------------------------------------------------------------*/
+
+int
+LogAccessHttp::marshal_client_req_id(char *buf)
+{
+  if (buf) {
+    marshal_int(buf, m_http_sm->sm_id);
+  }
+  return INK_MIN_ALIGN;
+}
+/*-------------------------------------------------------------------------
 -------------------------------------------------------------------------*/
 int
 LogAccessHttp::marshal_client_security_protocol(char *buf)
diff --git a/proxy/logging/LogAccessHttp.h b/proxy/logging/LogAccessHttp.h
index 8ddde20..d4ed0f1 100644
--- a/proxy/logging/LogAccessHttp.h
+++ b/proxy/logging/LogAccessHttp.h
@@ -74,9 +74,10 @@ public:
   virtual int marshal_client_req_tcp_reused(char *);         // INT
   virtual int marshal_client_req_is_ssl(char *);             // INT
   virtual int marshal_client_req_ssl_reused(char *);         // INT
-  virtual int marshal_client_finish_status_code(char *);     // INT
   virtual int marshal_client_security_protocol(char *);      // STR
   virtual int marshal_client_security_cipher_suite(char *);  // STR
+  virtual int marshal_client_finish_status_code(char *);     // INT
+  virtual int marshal_client_req_id(char *);                 // INT
 
   //
   // proxy -> client fields

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.