On 03/27/2019 03:45 PM, Daniel T. Lee wrote: > Since, ksym_search added with verification logic for symbols existence, > it could return NULL when the kernel symbols are not loaded. > > This commit will add NULL check logic after ksym_search. > > Signed-off-by: Daniel T. Lee <danieltim...@gmail.com> > --- > Changes in v2: > - Added NULL check for selftests/bpf/prog_tests/get_stack_raw_tp.c > > samples/bpf/offwaketime_user.c | 5 +++++ > samples/bpf/sampleip_user.c | 5 +++++ > samples/bpf/trace_event_user.c | 5 +++++ > tools/testing/selftests/bpf/prog_tests/get_stack_raw_tp.c | 4 ++-- > 4 files changed, 17 insertions(+), 2 deletions(-)
Still not all occurrences from samples covered: $ git grep -n ksym_search samples/bpf/ samples/bpf/offwaketime_user.c:30: sym = ksym_search(addr); samples/bpf/sampleip_user.c:111: sym = ksym_search(counts[i].ip); samples/bpf/spintest_user.c:39: sym = ksym_search(value); samples/bpf/trace_event_user.c:36: sym = ksym_search(addr);