=
to set an associated value to indexed unique pairs, as in:
array_name
[index_expression
] =value
index_expression
and value
. For example, you can use arrays to set a timestamp as the associated value to a process name (which you wish to use as your unique key), as in:
foo[tid()] = gettimeofday_s()
tid()
value (i.e. the ID of a thread, which is then used as the unique key). At the same time, SystemTap also uses the function gettimeofday_s()
to set the corresponding timestamp as the associated value to the unique key defined by the function tid()
. This creates an array composed of key pairs containing thread IDs and timestamps.
tid()
returns a value that is already defined in the array foo
, the operator will discard the original associated value to it, and replace it with the current timestamp from gettimeofday_s()
.