summaryrefslogtreecommitdiff
path: root/samples/bpf/spintest_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bpf/spintest_user.c')
-rw-r--r--samples/bpf/spintest_user.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/samples/bpf/spintest_user.c b/samples/bpf/spintest_user.c
index 8d3e9cfa1909..2556af2d9b3e 100644
--- a/samples/bpf/spintest_user.c
+++ b/samples/bpf/spintest_user.c
@@ -37,8 +37,13 @@ int main(int ac, char **argv)
bpf_map_lookup_elem(map_fd[0], &next_key, &value);
assert(next_key == value);
sym = ksym_search(value);
- printf(" %s", sym->name);
key = next_key;
+ if (!sym) {
+ printf("ksym not found. Is kallsyms loaded?\n");
+ continue;
+ }
+
+ printf(" %s", sym->name);
}
if (key)
printf("\n");