lkml.org 
[lkml]   [2015]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7 06/10] trace: Add lock-free tracing_map
On Mon,  8 Jun 2015 16:32:05 -0500
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:

> Add tracing_map, a special-purpose lock-free map for tracing.
>
> tracing_map is designed to aggregate or 'sum' one or more values
> associated with a specific object of type tracing_map_elt, which

What is "elt"? I don't see it explained anywhere.


> is associated by the map to a given key.
>
> It provides various hooks allowing per-tracer customization and is
> separated out into a separate file in order to allow it to be shared
> between multiple tracers, but isn't meant to be generally used outside
> of that context.
>
> The tracing_map implementation was inspired by lock-free map
> algorithms originated by Dr. Cliff Click:
>
> http://www.azulsystems.com/blog/cliff/2007-03-26-non-blocking-hashtable
> http://www.azulsystems.com/events/javaone_2007/2007_LockFreeHash.pdf
>
> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>


> +/**
> + * tracing_map_update_sum - Add a value to a tracing_map_elt's sum
> + * @elt: The tracing_map_elt

Not a very useful comment, as I have no idea what "elt" is.

I'll continue to review this patch about the mysterious element "elt".

-- Steve

> + * @i: The index of the given sum associated with the tracing_map_elt
> + * @n: The value to add to the sum
> + *
> + * Add n to sum i associated with the specified tracing_map_elt
> + * instance. The index i is the index returned by the call to
> + * tracing_map_add_sum_field() when the tracing map was set up.
> + */
> +void tracing_map_update_sum(struct tracing_map_elt *elt, unsigned int i, u64 n)
> +{
> + atomic64_add(n, &elt->fields[i].sum);
> +}
> +



\
 
 \ /
  Last update: 2015-06-12 20:41    [W:0.078 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site