Accessing global kernel variable is supported by this method- “@var("varname@src/file.c")”.
When this is used on user space probe, system tap still try to find in kernel space -
semantic error: unable to find global 'malloc_cnt' in kernel, in user-space-path/dir1/dir2/file.c: operator '@var' at :18:43
source: printf("alloc_cnt %d, free_cnt %d\n", @var("malloc_cnt@user-space-path/dir1/dir2/file.c"), @var("free_cnt@user-space-path/dir1/dir2/file.c"))