trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [trafficserver] branch master updated: TS-4976: Regularize plugins - thread_pool.
Date Mon, 11 Sep 2017 22:00:12 GMT
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 97db22d  TS-4976: Regularize plugins - thread_pool.
97db22d is described below

commit 97db22db6869bb415828a7e1b09c58889d9fb402
Author: Alan M. Carroll <amc@apache.org>
AuthorDate: Sat Sep 9 13:19:22 2017 -0500

    TS-4976: Regularize plugins - thread_pool.
---
 example/Makefile.am                                |  2 +-
 example/{thread-pool => thread_pool}/README.txt    |  5 +-
 example/{thread-pool => thread_pool}/TESTPLAN.txt  | 12 ++--
 .../include/Makefile.am                            |  0
 example/{thread-pool => thread_pool}/include/gen.c |  0
 .../include/gen_inc.sh                             |  0
 example/{thread-pool => thread_pool}/psi.c         | 72 +++++++++-------------
 .../test/SDKTest/SDKtest_server.config             |  0
 .../test/SDKTest/psi_server.c                      |  0
 .../test/SynTest/Tests/Psi/1.cfg                   |  0
 .../test/SynTest/Tests/Psi/10.cfg                  |  0
 .../test/SynTest/Tests/Psi/11.cfg                  |  0
 .../test/SynTest/Tests/Psi/12.cfg                  |  0
 .../test/SynTest/Tests/Psi/13.cfg                  |  0
 .../test/SynTest/Tests/Psi/2.cfg                   |  0
 .../test/SynTest/Tests/Psi/3.cfg                   |  0
 .../test/SynTest/Tests/Psi/4.cfg                   |  0
 .../test/SynTest/Tests/Psi/5.cfg                   |  0
 .../test/SynTest/Tests/Psi/6.cfg                   |  0
 .../test/SynTest/Tests/Psi/7.cfg                   |  0
 .../test/SynTest/Tests/Psi/8.cfg                   |  0
 .../test/SynTest/Tests/Psi/9.cfg                   |  0
 .../test/SynTest/Tests/Psi/psi_files/tc10_file.txt |  0
 .../test/SynTest/Tests/Psi/psi_files/tc11_file.txt |  0
 .../test/SynTest/Tests/Psi/psi_files/tc12_file.txt |  0
 .../test/SynTest/Tests/Psi/psi_files/tc13_file.txt |  0
 .../test/SynTest/Tests/Psi/psi_files/tc1_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc2_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc3_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc4_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc5_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc6_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc7_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc8_file.txt  |  0
 .../test/SynTest/Tests/Psi/psi_files/tc9_file.txt  |  0
 .../test/SynTest/system.cfg                        |  0
 .../test/SynTest/tests_psi.cfg                     |  0
 example/{thread-pool => thread_pool}/thread.c      |  4 +-
 example/{thread-pool => thread_pool}/thread.h      |  2 +
 39 files changed, 40 insertions(+), 57 deletions(-)

diff --git a/example/Makefile.am b/example/Makefile.am
index 457c970..d4e4213 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -108,7 +108,7 @@ output_header_la_SOURCES = output_header/output_header.c
 passthru_la_SOURCES = passthru/passthru.cc
 protocol_la_SOURCES = protocol/Protocol.c protocol/TxnSM.c
 protocol_stack_la_SOURCES = protocol_stack/protocol_stack.cc
-psi_la_SOURCES = thread-pool/psi.c thread-pool/thread.c
+psi_la_SOURCES = thread_pool/psi.c thread_pool/thread.c
 query_remap_la_SOURCES = query_remap/query_remap.c
 remap_header_add_la_SOURCES = remap_header_add/remap_header_add.cc
 remap_la_SOURCES = remap/remap.cc
diff --git a/example/thread-pool/README.txt b/example/thread_pool/README.txt
similarity index 97%
rename from example/thread-pool/README.txt
rename to example/thread_pool/README.txt
index 78a4573..da64ae4 100644
--- a/example/thread-pool/README.txt
+++ b/example/thread_pool/README.txt
@@ -108,7 +108,7 @@ Plugin Testing
  Sample include file generation
  ------------------------------
  A basic utility ('gen')to generate files to be inserted is provided
- in the directory thread-pool/include.
+ in the directory thread_pool/include.
  This create text files of various sizes.
  Compile gen the execute gen_inc.sh to generate files:
  > cd include
@@ -128,6 +128,5 @@ Plugin Testing
  The rate of responses with X-Psi header is configurable thru a SDKTest config file.
 
  A SDKTest server plugin as well as a SDKTest configuration file
- are provided in the directory thread-pool/test/SDKTest.
+ are provided in the directory thread_pool/test/SDKTest.
  Refer to the SDKTest manual for detailed setup instructions.
-
diff --git a/example/thread-pool/TESTPLAN.txt b/example/thread_pool/TESTPLAN.txt
similarity index 90%
rename from example/thread-pool/TESTPLAN.txt
rename to example/thread_pool/TESTPLAN.txt
index 3e5cbc4..a884104 100644
--- a/example/thread-pool/TESTPLAN.txt
+++ b/example/thread_pool/TESTPLAN.txt
@@ -1,4 +1,4 @@
-	Thread-Pool Sample Plugin Testing
+	Thread_Pool Sample Plugin Testing
 	=================================
 
 
@@ -10,7 +10,7 @@ boundary testing.
 
 List of tests:
 --------------
-Test case are under thread-pool/test/SynTest/Tests/Psi
+Test case are under thread_pool/test/SynTest/Tests/Psi
 1.cfg:Description: PSI Plugin - Include tag at the beginning of doc
 2.cfg:Description: PSI Plugin - include tag middle of body doc
 3.cfg:Description: PSI Plugin - include tag end of body doc
@@ -27,14 +27,14 @@ Test case are under thread-pool/test/SynTest/Tests/Psi
 
 SynTest config file:
 --------------------
-SynTest config files are under thread-pool/test/SynTest
+SynTest config files are under thread_pool/test/SynTest
  - system.cfg: master SynTest config file
  - tests_psi.cfg: test plan for SynTest
 
 Tests setup:
 ------------
  - Update plugin.config to add the psi plugin
- - Generate the include files using the gen_inc.sh tool in thread-pool/include
+ - Generate the include files using the gen_inc.sh tool in thread_pool/include
  - Copy the include files into $TS_HOME/etc/trafficserver/plugins/include
  - Start TS
  - Start SynTest
@@ -52,7 +52,7 @@ SDKTest is used for load testing.
 A SDKTest server plugin is required to exercise the plugin (the server
 must send back responses with 'X-Psi' header).
 
-The SDKTest server plugin is located under thread-pool/test/SDKTest
+The SDKTest server plugin is located under thread_pool/test/SDKTest
 A SDKTest configuration file is also provided (allows to change the ratio
 of X-Psi responses).
 
@@ -60,7 +60,7 @@ Tests setup:
 ------------
 TS setup:
  - Update plugin.config to add the psi plugin
- - Generate the include files using the gen_inc.sh tool in thread-pool/include
+ - Generate the include files using the gen_inc.sh tool in thread_pool/include
  - Copy the include files into $TS_HOME/etc/trafficserver/plugins/include
  - Start TS
 
diff --git a/example/thread-pool/include/Makefile.am b/example/thread_pool/include/Makefile.am
similarity index 100%
rename from example/thread-pool/include/Makefile.am
rename to example/thread_pool/include/Makefile.am
diff --git a/example/thread-pool/include/gen.c b/example/thread_pool/include/gen.c
similarity index 100%
rename from example/thread-pool/include/gen.c
rename to example/thread_pool/include/gen.c
diff --git a/example/thread-pool/include/gen_inc.sh b/example/thread_pool/include/gen_inc.sh
similarity index 100%
rename from example/thread-pool/include/gen_inc.sh
rename to example/thread_pool/include/gen_inc.sh
diff --git a/example/thread-pool/psi.c b/example/thread_pool/psi.c
similarity index 94%
rename from example/thread-pool/psi.c
rename to example/thread_pool/psi.c
index 02bc801..1ad6707 100644
--- a/example/thread-pool/psi.c
+++ b/example/thread_pool/psi.c
@@ -2,6 +2,16 @@
 
   Proxy Side Include plugin (PSI)
 
+  Synopsis:
+
+  This plugin allows to insert the content of a file stored on the proxy disk
+  into the body of an html response.
+
+  The plugin illustrates how to use a pool of threads in order to do blocking
+  calls (here, some disk i/o) in a Traffic Server plugin.
+
+  Further details: Refer to README file.
+
   @section license License
 
   Licensed to the Apache Software Foundation (ASF) under one
@@ -21,30 +31,6 @@
   limitations under the License.
  */
 
-/*
- *
- *
- *
- *	Usage:
- *	  psi.so
- *
- *  Proxy Side Include plugin (PSI)
- *
- *   Synopsis:
- *
- *  This plugin allows to insert the content of a file stored on the proxy disk
- *  into the body of an html response.
- *
- *  The plugin illustrates how to use a pool of threads in order to do blocking
- *  calls (here, some disk i/o) in a Traffic Server plugin.
- *
- *
- *   Details:
- *
- *  Refer to README file.
- *
- */
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <limits.h>
@@ -54,8 +40,6 @@
 #include "thread.h"
 #include "ts/ink_defs.h"
 
-#define DBG_TAG "xpsi"
-
 /* This is the number of threads spawned by the plugin.
    Should be tuned based on performance requirements,
    blocking calls duration, etc... */
@@ -167,7 +151,7 @@ cont_data_alloc()
 static void
 cont_data_destroy(ContData *data)
 {
-  TSDebug(DBG_TAG, "Destroying continuation data");
+  TSDebug(PLUGIN_NAME, "Destroying continuation data");
   if (data) {
     TSAssert(data->magic == MAGIC_ALIVE);
     if (data->output_reader) {
@@ -242,13 +226,13 @@ strsearch_ioreader(TSIOBufferReader reader, const char *pattern, int
*nparse)
 
   *nparse -= index; /* Adjust nparse so it doesn't include matching chars */
   if (index == slen) {
-    TSDebug(DBG_TAG, "strfind: match for %s at position %d", pattern, *nparse);
+    TSDebug(PLUGIN_NAME, "strfind: match for %s at position %d", pattern, *nparse);
     return STR_SUCCESS;
   } else if (index > 0) {
-    TSDebug(DBG_TAG, "strfind: partial match for %s at position %d", pattern, *nparse);
+    TSDebug(PLUGIN_NAME, "strfind: partial match for %s at position %d", pattern, *nparse);
     return STR_PARTIAL;
   } else {
-    TSDebug(DBG_TAG, "strfind no match for %s", pattern);
+    TSDebug(PLUGIN_NAME, "strfind no match for %s", pattern);
     return STR_FAIL;
   }
 }
@@ -317,7 +301,7 @@ strextract_ioreader(TSIOBufferReader reader, int offset, const char *end_pattern
 
   /* Error, could not read end of filename */
   if (buf_idx >= PSI_FILENAME_MAX_SIZE) {
-    TSDebug(DBG_TAG, "strextract: filename too long");
+    TSDebug(PLUGIN_NAME, "strextract: filename too long");
     *buflen = 0;
     return STR_FAIL;
   }
@@ -327,12 +311,12 @@ strextract_ioreader(TSIOBufferReader reader, int offset, const char
*end_pattern
     /* Nul terminate the filename, remove the end_pattern copied into the buffer */
     *buflen         = buf_idx - plen;
     buffer[*buflen] = '\0';
-    TSDebug(DBG_TAG, "strextract: filename = |%s|", buffer);
+    TSDebug(PLUGIN_NAME, "strextract: filename = |%s|", buffer);
     return STR_SUCCESS;
   }
   /* End of filename not yet reached we need to read some more data */
   else {
-    TSDebug(DBG_TAG, "strextract: partially extracted filename");
+    TSDebug(PLUGIN_NAME, "strextract: partially extracted filename");
     *buflen = buf_idx - p_idx;
     return STR_PARTIAL;
   }
@@ -485,7 +469,7 @@ psi_include(TSCont contp, void *edata ATS_UNUSED)
 
   /* Read the include file and copy content into iobuffer */
   if ((filep = TSfopen(inc_file, "r")) != NULL) {
-    TSDebug(DBG_TAG, "Reading include file %s", inc_file);
+    TSDebug(PLUGIN_NAME, "Reading include file %s", inc_file);
 
     while (TSfgets(filep, buf, BUFFER_SIZE) != NULL) {
       TSIOBufferBlock block;
@@ -564,7 +548,7 @@ wake_up_streams(TSCont contp)
     TSVIOReenable(data->output_vio);
     TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_READY, input_vio);
   } else {
-    TSDebug(DBG_TAG, "Total bytes produced by transform = %d", data->transform_bytes);
+    TSDebug(PLUGIN_NAME, "Total bytes produced by transform = %d", data->transform_bytes);
     TSVIONBytesSet(data->output_vio, data->transform_bytes);
     TSVIOReenable(data->output_vio);
     TSContCall(TSVIOContGet(input_vio), TS_EVENT_VCONN_WRITE_COMPLETE, input_vio);
@@ -615,7 +599,7 @@ handle_transform(TSCont contp)
 
   /* If the input VIO's buffer is NULL, the transformation is over */
   if (!TSVIOBufferGet(input_vio)) {
-    TSDebug(DBG_TAG, "input_vio NULL, terminating transformation");
+    TSDebug(PLUGIN_NAME, "input_vio NULL, terminating transformation");
     TSVIONBytesSet(data->output_vio, data->transform_bytes);
     TSVIOReenable(data->output_vio);
     return 1;
@@ -664,7 +648,7 @@ handle_transform(TSCont contp)
         Job *new_job;
         /* Add a request to include a file into the jobs queue.. */
         /* We'll be called back once it's done with an EVENT_IMMEDIATE */
-        TSDebug(DBG_TAG, "Psi filename extracted, adding an include job to thread queue");
+        TSDebug(PLUGIN_NAME, "Psi filename extracted, adding an include job to thread queue");
         data->state = STATE_READ_PSI;
 
         /* Create a new job request and add it to the queue */
@@ -718,7 +702,7 @@ dump_psi(TSCont contp)
     if (psi_output_len > 0) {
       data->transform_bytes += psi_output_len;
 
-      TSDebug(DBG_TAG, "Inserting %d bytes from include file", psi_output_len);
+      TSDebug(PLUGIN_NAME, "Inserting %d bytes from include file", psi_output_len);
       /* TODO: Should we check the return value of TSIOBufferCopy() ? */
       TSIOBufferCopy(TSVIOBufferGet(data->output_vio), data->psi_reader, psi_output_len,
0);
       /* Consume all the output data */
@@ -881,7 +865,7 @@ transformable(TSHttpTxn txnp)
 
     field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, TS_MIME_FIELD_CONTENT_TYPE, -1);
     if (field_loc == TS_NULL_MLOC) {
-      TSError("[psi] Unable to search Content-Type field");
+      TSError("[%s] Unable to search Content-Type field", PLUGIN_NAME);
       TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
       return 0;
     }
@@ -948,7 +932,7 @@ read_response_handler(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
   switch (event) {
   case TS_EVENT_HTTP_READ_RESPONSE_HDR:
     if (transformable(txnp)) {
-      TSDebug(DBG_TAG, "Add a transformation");
+      TSDebug(PLUGIN_NAME, "Add a transformation");
       transform_add(txnp);
     }
     TSHttpTxnReenable(txnp, TS_EVENT_HTTP_CONTINUE);
@@ -982,7 +966,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
   info.support_email = "";
 
   if (TSPluginRegister(&info) != TS_SUCCESS) {
-    TSError("[psi] Plugin registration failed");
+    TSError("[%s] Plugin registration failed", PLUGIN_NAME);
   }
 
   /* Initialize the psi directory = <plugin_path>/include */
@@ -991,7 +975,7 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
   /* create an TSTextLogObject to log any psi include */
   retval = TSTextLogObjectCreate("psi", TS_LOG_MODE_ADD_TIMESTAMP, &log);
   if (retval == TS_ERROR) {
-    TSError("[psi] Failed creating log for psi plugin");
+    TSError("[%s] Failed creating log for psi plugin", PLUGIN_NAME);
     log = NULL;
   }
 
@@ -1003,11 +987,11 @@ TSPluginInit(int argc ATS_UNUSED, const char *argv[] ATS_UNUSED)
     char *thread_name = (char *)TSmalloc(64);
     sprintf(thread_name, "Thread[%d]", i);
     if (!TSThreadCreate((TSThreadFunc)thread_loop, thread_name)) {
-      TSError("[psi] Failed creating threads");
+      TSError("[%s] Failed creating threads", PLUGIN_NAME);
       return;
     }
   }
 
   TSHttpHookAdd(TS_HTTP_READ_RESPONSE_HDR_HOOK, TSContCreate(read_response_handler, TSMutexCreate()));
-  TSDebug(DBG_TAG, "Plugin started");
+  TSDebug(PLUGIN_NAME, "Plugin started");
 }
diff --git a/example/thread-pool/test/SDKTest/SDKtest_server.config b/example/thread_pool/test/SDKTest/SDKtest_server.config
similarity index 100%
rename from example/thread-pool/test/SDKTest/SDKtest_server.config
rename to example/thread_pool/test/SDKTest/SDKtest_server.config
diff --git a/example/thread-pool/test/SDKTest/psi_server.c b/example/thread_pool/test/SDKTest/psi_server.c
similarity index 100%
rename from example/thread-pool/test/SDKTest/psi_server.c
rename to example/thread_pool/test/SDKTest/psi_server.c
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/1.cfg b/example/thread_pool/test/SynTest/Tests/Psi/1.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/1.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/1.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/10.cfg b/example/thread_pool/test/SynTest/Tests/Psi/10.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/10.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/10.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/11.cfg b/example/thread_pool/test/SynTest/Tests/Psi/11.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/11.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/11.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/12.cfg b/example/thread_pool/test/SynTest/Tests/Psi/12.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/12.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/12.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/13.cfg b/example/thread_pool/test/SynTest/Tests/Psi/13.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/13.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/13.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/2.cfg b/example/thread_pool/test/SynTest/Tests/Psi/2.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/2.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/2.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/3.cfg b/example/thread_pool/test/SynTest/Tests/Psi/3.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/3.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/3.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/4.cfg b/example/thread_pool/test/SynTest/Tests/Psi/4.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/4.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/4.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/5.cfg b/example/thread_pool/test/SynTest/Tests/Psi/5.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/5.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/5.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/6.cfg b/example/thread_pool/test/SynTest/Tests/Psi/6.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/6.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/6.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/7.cfg b/example/thread_pool/test/SynTest/Tests/Psi/7.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/7.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/7.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/8.cfg b/example/thread_pool/test/SynTest/Tests/Psi/8.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/8.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/8.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/9.cfg b/example/thread_pool/test/SynTest/Tests/Psi/9.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/9.cfg
rename to example/thread_pool/test/SynTest/Tests/Psi/9.cfg
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc10_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc10_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc10_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc10_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc11_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc11_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc11_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc11_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc12_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc12_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc12_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc12_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc13_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc13_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc13_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc13_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc1_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc1_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc1_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc1_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc2_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc2_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc2_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc2_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc3_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc3_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc3_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc3_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc4_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc4_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc4_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc4_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc5_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc5_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc5_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc5_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc6_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc6_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc6_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc6_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc7_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc7_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc7_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc7_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc8_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc8_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc8_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc8_file.txt
diff --git a/example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc9_file.txt b/example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc9_file.txt
similarity index 100%
rename from example/thread-pool/test/SynTest/Tests/Psi/psi_files/tc9_file.txt
rename to example/thread_pool/test/SynTest/Tests/Psi/psi_files/tc9_file.txt
diff --git a/example/thread-pool/test/SynTest/system.cfg b/example/thread_pool/test/SynTest/system.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/system.cfg
rename to example/thread_pool/test/SynTest/system.cfg
diff --git a/example/thread-pool/test/SynTest/tests_psi.cfg b/example/thread_pool/test/SynTest/tests_psi.cfg
similarity index 100%
rename from example/thread-pool/test/SynTest/tests_psi.cfg
rename to example/thread_pool/test/SynTest/tests_psi.cfg
diff --git a/example/thread-pool/thread.c b/example/thread_pool/thread.c
similarity index 96%
rename from example/thread-pool/thread.c
rename to example/thread_pool/thread.c
index 6a6c1bd..be41cfc 100644
--- a/example/thread-pool/thread.c
+++ b/example/thread_pool/thread.c
@@ -28,8 +28,6 @@
 #include "thread.h"
 #include "ts/ink_defs.h"
 
-#define DBGTAG "xthread"
-
 struct timespec tp1;
 struct timespec tp2;
 
@@ -77,7 +75,7 @@ add_to_queue(Queue *q, void *data)
     TSMutexUnlock(q->mutex);
 
     if (n > MAX_JOBS_ALARM) {
-      TSError("[thread_pool] Warning:Too many jobs in plugin thread pool queue (%d). Maximum
allowed is %d", n, MAX_JOBS_ALARM);
+      TSError("[%s] Warning:Too many jobs in plugin thread pool queue (%d). Maximum allowed
is %d", PLUGIN_NAME, n, MAX_JOBS_ALARM);
     }
   }
 }
diff --git a/example/thread-pool/thread.h b/example/thread_pool/thread.h
similarity index 98%
rename from example/thread-pool/thread.h
rename to example/thread_pool/thread.h
index 54df3ec..1e6ed99 100644
--- a/example/thread-pool/thread.h
+++ b/example/thread_pool/thread.h
@@ -24,6 +24,8 @@
 #ifndef _THREAD_H_
 #define _THREAD_H_
 
+#define PLUGIN_NAME "psi"
+
 #define MAGIC_ALIVE 0xfeedbabe
 #define MAGIC_DEAD 0xdeadbeef
 

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

Mime
View raw message