]> git.karo-electronics.de Git - linux-beck.git/commit
perf kmaps: Check kmaps to make code more robust
authorWang Nan <wangnan0@huawei.com>
Tue, 7 Apr 2015 08:22:45 +0000 (08:22 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 8 Apr 2015 12:07:03 +0000 (09:07 -0300)
commitba92732e9808df679ddf75c5ea1c0caae6d7dce2
treef00303efe3ed8cd3f2c5508d8af87db9b0137a82
parent8ea92ceb748535799e3e9f35afb85bdc23bf6d7c
perf kmaps: Check kmaps to make code more robust

This patch add checks in places where map__kmap is used to get kmaps
from struct kmap.

Error messages are added at map__kmap to warn invalid accessing of kmap
(for the case of !map->dso->kernel, kmap(map) does not exists at all).

Also, introduces map__kmaps() to warn uninitialized kmaps.

Reviewed-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: pi3orama@163.com
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Link: http://lkml.kernel.org/r/1428394966-131044-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/machine.c
tools/perf/util/map.c
tools/perf/util/map.h
tools/perf/util/probe-event.c
tools/perf/util/session.c
tools/perf/util/symbol-elf.c
tools/perf/util/symbol.c