perf evlist: Add thread_map__nr() helper
authorNamhyung Kim <namhyung.kim@lge.com>
Mon, 11 Mar 2013 07:43:14 +0000 (16:43 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 15 Mar 2013 16:06:02 +0000 (13:06 -0300)
commitb3a319d528fd57ef600731ee1b84d00b7204881d
treefadbcc4a692d5a4e841af9823c527eca7c5dc7dc
parent85397956de304106e2fdace2db8f69ab4e966bc5
perf evlist: Add thread_map__nr() helper

Introduce and use the thread_map__nr() function to protect a possible
NULL pointer dereference and cleanup the code a bit.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1362987798-24969-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c
tools/perf/util/evlist.c
tools/perf/util/thread_map.h