Re: [PATCH 03/27] perf tools: Add reference counting for cpu_map object

From: Jiri Olsa
Date: Tue Jun 23 2015 - 17:54:58 EST


On Tue, Jun 23, 2015 at 06:06:45PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jun 23, 2015 at 12:36:04AM +0200, Jiri Olsa escreveu:
> > -void cpu_map__delete(struct cpu_map *map)
> > +static void cpu_map__delete(struct cpu_map *map)
> > {
> > - free(map);
> > + if (map) {
> > + WARN_ONCE(atomic_read(&map->refcnt) != 0,
> > + "cpu map refcnt disbalanced\n");
>
> Have you used this to catch some bug or is this just some attempt at a
> proactive check? s/disbalanced/unbalanced/g

yep, proactive check

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/