Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/trace2
diff options
context:
space:
mode:
authorJeff Hostetler <jeffhost@microsoft.com>2022-10-24 16:41:01 +0300
committerJunio C Hamano <gitster@pobox.com>2022-10-24 22:45:25 +0300
commit5bbb9251378b0e62bb06e72bda0574e06dee4933 (patch)
treedf3f4f2db69c371ea0af9f6f34c094022cce93cf /trace2
parent545ddca0c32cb3ccdffed4aa9f063c84b432940c (diff)
tr2tls: clarify TLS terminology
Reduce or eliminate use of the term "TLS" in the Trace2 code. The term "TLS" has two popular meanings: "thread-local storage" and "transport layer security". In the Trace2 source, the term is associated with the former. There was concern on the mailing list about it refering to the latter. Update the source and documentation to eliminate the use of the "TLS" term or replace it with the phrase "thread-local storage" to reduce ambiguity. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace2')
-rw-r--r--trace2/tr2_tls.c6
-rw-r--r--trace2/tr2_tls.h18
2 files changed, 14 insertions, 10 deletions
diff --git a/trace2/tr2_tls.c b/trace2/tr2_tls.c
index 7da94aba52..8d2182fbdb 100644
--- a/trace2/tr2_tls.c
+++ b/trace2/tr2_tls.c
@@ -69,9 +69,9 @@ struct tr2tls_thread_ctx *tr2tls_get_self(void)
ctx = pthread_getspecific(tr2tls_key);
/*
- * If the thread-proc did not call trace2_thread_start(), we won't
- * have any TLS data associated with the current thread. Fix it
- * here and silently continue.
+ * If the current thread's thread-proc did not call
+ * trace2_thread_start(), then the thread will not have any
+ * thread-local storage. Create it now and silently continue.
*/
if (!ctx)
ctx = tr2tls_create_self("unknown", getnanotime() / 1000);
diff --git a/trace2/tr2_tls.h b/trace2/tr2_tls.h
index a90bd639d4..1297509fd2 100644
--- a/trace2/tr2_tls.h
+++ b/trace2/tr2_tls.h
@@ -4,6 +4,12 @@
#include "strbuf.h"
/*
+ * Notice: the term "TLS" refers to "thread-local storage" in the
+ * Trace2 source files. This usage is borrowed from GCC and Windows.
+ * There is NO relation to "transport layer security".
+ */
+
+/*
* Arbitry limit for thread names for column alignment.
*/
#define TR2_MAX_THREAD_NAME (24)
@@ -17,9 +23,7 @@ struct tr2tls_thread_ctx {
};
/*
- * Create TLS data for the current thread. This gives us a place to
- * put per-thread data, such as thread start time, function nesting
- * and a per-thread label for our messages.
+ * Create thread-local storage for the current thread.
*
* We assume the first thread is "main". Other threads are given
* non-zero thread-ids to help distinguish messages from concurrent
@@ -35,7 +39,7 @@ struct tr2tls_thread_ctx *tr2tls_create_self(const char *thread_name,
uint64_t us_thread_start);
/*
- * Get our TLS data.
+ * Get the thread-local storage pointer of the current thread.
*/
struct tr2tls_thread_ctx *tr2tls_get_self(void);
@@ -45,7 +49,7 @@ struct tr2tls_thread_ctx *tr2tls_get_self(void);
int tr2tls_is_main_thread(void);
/*
- * Free our TLS data.
+ * Free the current thread's thread-local storage.
*/
void tr2tls_unset_self(void);
@@ -81,12 +85,12 @@ uint64_t tr2tls_region_elasped_self(uint64_t us);
uint64_t tr2tls_absolute_elapsed(uint64_t us);
/*
- * Initialize the tr2 TLS system.
+ * Initialize thread-local storage for Trace2.
*/
void tr2tls_init(void);
/*
- * Free all tr2 TLS resources.
+ * Free all Trace2 thread-local storage resources.
*/
void tr2tls_release(void);