Skip to content

bpftrace error on aliyun linux 2.0

今天测试了一下aliyun Linux 2.0,想看看它自带的ebcc工具到底如何。结果在跑一个bpftrace示例脚本的时候报错。

[root@AliYun ~]#  bpftrace -d -e 'tracepoint:syscalls:sys_enter_openat {printf("%-18s %-4d %s\n",comm,pid,str(args->filename));}'
#include <linux/types.h>
struct _tracepoint_syscalls_sys_enter_openat
{
  unsigned short common_type;
  unsigned char common_flags;
  unsigned char common_preempt_count;
  int common_pid;
  int __syscall_nr;
  s64 dfd;
  const char * filename;
  s64 flags;
  umode_t mode;
};

Program
 tracepoint:syscalls:sys_enter_openat
  call: printf
   string: %-18s %-4d %s\n
   builtin: comm
   builtin: pid
   call: str
    .
     dereference
      builtin: args
     filename

modprobe: FATAL: Module kheaders not found.
definitions.h:9:3: error: unknown type name 's64'
definitions.h:11:3: error: unknown type name 's64'
definitions.h:12:3: error: unknown type name 'umode_t'
Input (276): #include <linux/types.h>
struct _tracepoint_syscalls_sys_enter_openat
{
  unsigned short common_type;
  unsigned char common_flags;
  unsigned char common_preempt_count;
  int common_pid;
  int __syscall_nr;
  s64 dfd;
  const char * filename;
  s64 flags;
  umode_t mode;
};
Avatar

专业Linux/Unix/Windows系统管理员,开源技术爱好者。对操作系统底层技术,TCP/IP协议栈以及信息系统安全有强烈兴趣。电脑技术之外,则喜欢书法,古典诗词,数码摄影和背包行。

Sidebar