From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755718AbbFLSRg (ORCPT ); Fri, 12 Jun 2015 14:17:36 -0400 Received: from smtprelay0155.hostedemail.com ([216.40.44.155]:47558 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751247AbbFLSRe (ORCPT ); Fri, 12 Jun 2015 14:17:34 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:960:965:966:967:973:978:988:989:1183:1260:1263:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2525:2553:2561:2564:2682:2685:2731:2859:2898:2911:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:4390:4395:4425:5007:6119:6261:7875:7903:7904:8660:8957:9025:9388:10004:10049:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12740:13069:13148:13230:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: goose85_7b40c06d1a19 X-Filterd-Recvd-Size: 2762 Date: Fri, 12 Jun 2015 14:17:31 -0400 From: Steven Rostedt To: Tom Zanussi Cc: daniel.wagner@bmw-carit.de, masami.hiramatsu.pt@hitachi.com, namhyung@kernel.org, josh@joshtriplett.org, andi@firstfloor.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 06/10] trace: Add lock-free tracing_map Message-ID: <20150612141731.01232907@gandalf.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Jun 2015 16:32:05 -0500 Tom Zanussi 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 > +/** > + * 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); > +} > +