Re: [PATCH 05/37] perf tools: Create separate mmap for dummy tracking event

From: Jiri Olsa
Date: Thu Dec 25 2014 - 17:09:39 EST


On Wed, Dec 24, 2014 at 04:15:01PM +0900, Namhyung Kim wrote:

SNIP

>
> union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx);
> -
> void perf_evlist__mmap_consume(struct perf_evlist *evlist, int idx);
> +struct perf_mmap *perf_evlist__mmap_desc(struct perf_evlist *evlist, int idx);
>
> int perf_evlist__open(struct perf_evlist *evlist);
> void perf_evlist__close(struct perf_evlist *evlist);
> @@ -211,6 +214,12 @@ bool perf_evlist__can_select_event(struct perf_evlist *evlist, const char *str);
> void perf_evlist__to_front(struct perf_evlist *evlist,
> struct perf_evsel *move_evsel);
>
> +/* convert from/to negative idx for track mmaps */
> +static inline int track_mmap_idx(int idx)
> +{
> + return -idx - 1;
> +}

hum, whats the logic with negative numbers in here?
you still access track_mmap array with this index no?

thanks,
jirka
--
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/