[DTrace-devel] [PATCH v2] Implement TLS variables

Eugene Loh eugene.loh at oracle.com
Wed Nov 24 01:54:35 UTC 2021


The tests refer often to "clause-local" variables, though I suspect 
"thread-local" is intended.

On 11/23/21 2:46 AM, Kris Van Hees via DTrace-devel wrote:
> Thread-local storage (TLS) variables are a form of dynamic variables in
> DTrace.  They are implemented using a global BPF hash map, indexed using
> a key value that is derived from the task ID and the variable ID (with
> some special magic to handle the idle task that has TID 0 on all CPUs).
>
> Access to the TLS variables is handled through a pre-compiled BPF
> function : dt_get_tvar.  It returns the address of the storage location
> for the given variable in the current task.  This is used for both load
> and store operations.
>
> The dvars BPF map contains an element at key 0 that contains a value of
> all zeros.  This is used to initialize new TLS variables.



More information about the DTrace-devel mailing list