lkml.org 
[lkml]   [2014]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 05/18] perf tools: Add ordered_events_(get|put) interface
On 6/18/14, 8:58 AM, Jiri Olsa wrote:
>
> +static struct ordered_event*
> +ordered_events_get(struct ordered_events_queue *q, u64 timestamp)
> +{
> + struct ordered_event *new;
> +
> + new = alloc_event(q);
> + if (new) {
> + new->timestamp = timestamp;
> + queue_event(q, new);
> + }
> +
> + return new;
> +}

The _get name does not really correlate with what is happening -- ie.,
allocate a new event and add it to the queue. There is no reference
taken either.

> +
> +static void
> +ordered_event_put(struct ordered_events_queue *q, struct ordered_event *iter)
> +{
> + list_del(&iter->list);
> + list_add(&iter->list, &q->cache);
> + q->nr_events--;
> +}

Similarly here with the _put. In this case the function is moving the
event from one list to another. And how about something else for the
name besides iter -- oe, or oevent?

David



\
 
 \ /
  Last update: 2014-06-28 01:41    [W:0.226 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site