Re: [PATCH v7 06/10] trace: Add lock-free tracing_map

From: Steven Rostedt
Date: Fri Jun 12 2015 - 14:17:39 EST


On Mon, 8 Jun 2015 16:32:05 -0500
Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx>


> +/**
> + * 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);
> +}
> +

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/