perf tools: Initialize reference counts in map__clone()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 18 Aug 2015 18:19:50 +0000 (15:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 21 Aug 2015 15:39:30 +0000 (12:39 -0300)
commit66671d001aeb525b9101e0ccb9062627539de555
tree03813a786b503317b6b06dc93f2b53c1ac715ef5
parent4b715d24f4f14731c7b553cbb8604fe865cb8d3c
perf tools: Initialize reference counts in map__clone()

Map clone was written before we introduced reference counts for
maps and dsos, so all that was needed was just a copy and then we
would insert it into the new map_groups instance.

Fix it by, after copying, initializing the map->refcnt, grabbing
a struct dso refcount and resetting pointers that may be used
to determine if a map, when deleted, is in a rb_tree.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-pd4mr80o5b9gvk50iineacec@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/map.c