Skip to content
Commit 1a096ae4 authored by Jackie Liu's avatar Jackie Liu Committed by Arnaldo Carvalho de Melo
Browse files

perf top: Fix BPF support related crash with perf_event_paranoid=3 + kptr_restrict



After installing the libelf-dev package and compiling perf, if we have
kptr_restrict=2 and perf_event_paranoid=3 'perf top' will crash because
the value of /proc/kallsyms cannot be obtained, which leads to
info->jited_ksyms == NULL. In order to solve this problem, Add a
check before use.

Also plug some leaks on the error path.

Suggested-by: default avatarJiri Olsa <jolsa@redhat.com>
Signed-off-by: default avatarJackie Liu <liuyun01@kylinos.cn>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: jackie liu <liuyun01@kylinos.cn>
Link: http://lore.kernel.org/lkml/20210316012453.1156-1-liuyun01@kylinos.cn


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent e4064776
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment