Bug 19054 - [ANCK6.6.71-3 rc1][aarch64][倚天710机器]bcc:test_clang.py用例由于类型不匹配、结构体定义改变,BPF编译产生多处报错
Summary: [ANCK6.6.71-3 rc1][aarch64][倚天710机器]bcc:test_clang.py用例由于类型不匹配、结构体定义改变,BPF编译产...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: aarch64 Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: lv0322
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-25 17:56 UTC by zhixin01
Modified: 2025-03-06 17:38 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhixin01 alibaba_cloud_group 2025-02-25 17:56:56 UTC
[缺陷描述]:
倚天710机器,执行bcc测试套中test_clang.py用例有12处报错

已知的失败用例,在此做个纪录

测试日志如下:
#python test_clang.py
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/blkdev.h>\n#include <uapi/linux/ptrace.h>\nint do_request(struct pt_regs *ctx, int req) {\n    bpf_trace_printk("req ptr: 0x%x\\n", req);\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'do_request'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <bcc/proto.h>\nint dns_test(struct __sk_buff *skb) {\n    u8 *cursor = 0;\n    struct ethernet_t *ethernet = cursor_advance(cursor, sizeof(*ethernet));\n    if(ethernet->type == ETH_P_IP) {\n        struct ip_t *ip = cursor_advance(cursor, sizeof(*ip));\n        ip->src = ip->dst;\n        return 0;\n    }\n    return -1;\n}\n        '
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_HASH(table1);\nBPF_HASH(table2, u32);\nBPF_HASH(table3, u32, int);\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_PROG_ARRAY(jmp, 32);\n\n#define JMP_IDX_PIPE (1U << 1)\n\nenum action {\n    ACTION_PASS\n};\n\nint process(struct xdp_md *ctx) {\n    jmp.call((void *)ctx, ACTION_PASS);\n    jmp.call((void *)ctx, JMP_IDX_PIPE);\n    return XDP_PASS;\n}\n        '
  text = _assert_is_bytes(text)
/virtual/main.c:23:20: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'u64' (aka 'unsigned long long') [-Wint-conversion]
    bpf_tail_call_((void *)bpf_pseudo_fd(1, -1), (void *)ctx, ACTION_PASS);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/virtual/include/bcc/helpers.h:552:25: note: passing argument to parameter 'map_fd' here
void bpf_tail_call_(u64 map_fd, void *ctx, int index) {
                        ^
/virtual/main.c:24:20: error: incompatible pointer to integer conversion passing 'void *' to parameter of type 'u64' (aka 'unsigned long long') [-Wint-conversion]
    bpf_tail_call_((void *)bpf_pseudo_fd(1, -1), (void *)ctx, JMP_IDX_PIPE);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/virtual/include/bcc/helpers.h:552:25: note: passing argument to parameter 'map_fd' here
void bpf_tail_call_(u64 map_fd, void *ctx, int index) {
                        ^
2 errors generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#ifndef MYFLAG\n#error "MYFLAG not set as expected"\n#endif\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '#include <linux/blkdev.h>\nint kprobe__blk_update_request(struct pt_regs *ctx, struct request *req) {\n    bpf_trace_printk("%s\\n", req->rq_disk->disk_name);\n    return 0;\n}'
  text = _assert_is_bytes(text)
/virtual/main.c:3:33: error: incomplete definition of type 'struct request'
    bpf_trace_printk("%s\n", req->rq_disk->disk_name);
                             ~~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
1 error generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:423: DeprecationWarning: not a bytes object: 'test_clang_complex.c'
  src_file = _assert_is_bytes(src_file)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'handle_packet'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nstruct list;\nstruct list {\n  struct list *selfp;\n  struct list *another_selfp;\n  struct list *selfp_array[2];\n};\nstruct empty {\n};\nunion emptyu {\n  struct empty *em1;\n  struct empty em2;\n  struct empty em3;\n  struct empty em4;\n};\nBPF_ARRAY(t1, struct list, 1);\nBPF_ARRAY(t2, struct list *, 1);\nBPF_ARRAY(t3, union emptyu, 1);\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 't3'
  name = _assert_is_bytes(name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/fs.h>\n#include <linux/mount.h>\nBPF_HASH(table1, struct super_block *);\nint trace_entry(struct pt_regs *ctx, struct file *file) {\n    if (!file) return 0;\n    struct vfsmount *mnt = file->f_path.mnt;\n    if (mnt) {\n        struct super_block *k = mnt->mnt_sb;\n        u64 zero = 0;\n        table1.update(&k, &zero);\n        k = mnt->mnt_sb;\n        table1.update(&k, &zero);\n    }\n\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'trace_entry'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nenum b {\n    CHOICE_A,\n};\nstruct a {\n    enum b test;\n};\nBPF_HASH(drops, struct a);\n        '
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 'drops'
  name = _assert_is_bytes(name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: 'BPF_TABLE_PUBLIC("hash", int, int, table1, 10);'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: 'BPF_TABLE("extern", int, int, table1, 10);'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 'table1'
  name = _assert_is_bytes(name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\nint test(struct pt_regs *ctx) {\n    struct task_struct *task = (struct task_struct *)bpf_get_current_task();\n    return task->prio;\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'test'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <net/sock.h>\n#include <bcc/proto.h>\n\nBPF_HASH(currsock, u32, struct sock *);\n\nint trace_entry(struct pt_regs *ctx, struct sock *sk,\n    struct sockaddr *uaddr, int addr_len) {\n    u32 pid = bpf_get_current_pid_tgid();\n    currsock.update(&pid, &sk);\n    return 0;\n};\n\nint trace_exit(struct pt_regs *ctx) {\n    u32 pid = bpf_get_current_pid_tgid();\n    struct sock **skpp;\n    skpp = currsock.lookup(&pid);\n    if (skpp) {\n        struct sock *skp = *skpp;\n        return skp->__sk_common.skc_dport;\n    }\n    return 0;\n}\n        '
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'trace_exit'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <net/sock.h>\n#include <bcc/proto.h>\n\nBPF_HASH(currsock, u32, struct sock *);\n\nint trace_entry(struct pt_regs *ctx, struct sock *sk,\n    struct sockaddr *uaddr, int addr_len) {\n    u32 pid = bpf_get_current_pid_tgid();\n    currsock.update(&pid, &sk);\n    return 0;\n};\n\nint trace_exit(struct pt_regs *ctx) {\n    u32 pid = bpf_get_current_pid_tgid();\n    struct sock **skpp = currsock.lookup(&pid);\n    if (skpp) {\n        struct sock *skp = *skpp;\n        return skp->__sk_common.skc_dport;\n    }\n    return 0;\n}\n        '
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <net/sock.h>\n#include <bcc/proto.h>\n\nBPF_HASH(currsock, u32, struct sock *);\n\nint trace_entry(struct pt_regs *ctx, struct sock *sk) {\n    u32 pid = bpf_get_current_pid_tgid();\n    struct sock **skp = &sk;\n    currsock.update(&pid, skp);\n    return 0;\n};\n\nint trace_exit(struct pt_regs *ctx) {\n    u32 pid = bpf_get_current_pid_tgid();\n    struct sock **skpp;\n    skpp = currsock.lookup(&pid);\n    if (skpp) {\n        struct sock *skp = *skpp;\n        return skp->__sk_common.skc_dport;\n    }\n    return 0;\n}\n        '
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <net/sock.h>\n#include <bcc/proto.h>\n\nBPF_HASH(currsock, u32, struct sock *);\n\nint trace_exit(struct pt_regs *ctx) {\n    u32 pid = bpf_get_current_pid_tgid();\n    struct sock **skpp;\n    skpp = currsock.lookup(&pid);\n    if (skpp) {\n        struct sock *skp = *skpp;\n        return skp->__sk_common.skc_dport;\n    }\n    return 0;\n}\n\nint trace_entry(struct pt_regs *ctx, struct sock *sk) {\n    u32 pid = bpf_get_current_pid_tgid();\n    currsock.update(&pid, &sk);\n    return 0;\n};\n        '
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_HASH(drops, struct key_t);\nstruct key_t {\n    u64 location;\n};\n'
  text = _assert_is_bytes(text)
/virtual/main.c:2:1: error: field has incomplete type 'struct key_t'
BPF_HASH(drops, struct key_t);
^
/virtual/include/bcc/helpers.h:278:48: note: expanded from macro 'BPF_HASH'
  BPF_HASHX(__VA_ARGS__, BPF_HASH4, BPF_HASH3, BPF_HASH2, BPF_HASH1)(__VA_ARGS__)
                                               ^
/virtual/main.c:2:24: note: forward declaration of 'struct key_t'
BPF_HASH(drops, struct key_t);
                       ^
/virtual/main.c:2:1: error: field has incomplete type 'struct key_t'
BPF_HASH(drops, struct key_t);
^
/virtual/include/bcc/helpers.h:278:48: note: expanded from macro 'BPF_HASH'
  BPF_HASHX(__VA_ARGS__, BPF_HASH4, BPF_HASH3, BPF_HASH2, BPF_HASH1)(__VA_ARGS__)
                                               ^
/virtual/main.c:2:24: note: forward declaration of 'struct key_t'
BPF_HASH(drops, struct key_t);
                       ^
2 errors generated.
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_HASH(table1, unsigned __int128, __int128);\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nint bar(void) {\n    return 0;\n}\nint foo(struct pt_regs *ctx) {\n    return bar();\n}\n'
  text = _assert_is_bytes(text)
/virtual/main.c:6:12: error: cannot call non-static helper function
    return bar();
           ^
1 error generated.
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/blkdev.h>\n#include <uapi/linux/ptrace.h>\n\nstruct key_t {\n    struct request *req;\n};\n\nBPF_HASH(start, struct key_t, u64, 1024);\nint do_request(struct pt_regs *ctx, struct request *req) {\n    struct key_t key = {};\n\n    bpf_trace_printk("traced start %d\\n", req->__data_len);\n\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/virtual/main.c:13:46: error: incomplete definition of type 'struct request'
    bpf_trace_printk("traced start %d\n", req->__data_len);
                                          ~~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
1 error generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/blk_types.h>\n#include <linux/blkdev.h>\n#include <linux/time64.h>\n\nBPF_PERCPU_ARRAY(rwdf_100ms, u64, 400);\n\nint do_request(struct pt_regs *ctx, struct request *rq) {\n    u32 cmd_flags;\n    u64 base, dur, slot, now = 100000;\n\n    if (!rq->start_time_ns)\n      return 0;\n\n    if (!rq->rq_disk || rq->rq_disk->major != 5 ||\n        rq->rq_disk->first_minor != 6)\n      return 0;\n\n    cmd_flags = rq->cmd_flags;\n    switch (cmd_flags & REQ_OP_MASK) {\n    case REQ_OP_READ:\n      base = 0;\n      break;\n    case REQ_OP_WRITE:\n      base = 100;\n      break;\n    case REQ_OP_DISCARD:\n      base = 200;\n      break;\n    case REQ_OP_FLUSH:\n      base = 300;\n      break;\n    default:\n      return 0;\n    }\n\n    dur = now - rq->start_time_ns;\n    slot = min_t(size_t, div_u64(dur, 100 * NSEC_PER_MSEC), 99);\n    rwdf_100ms.increment(base + slot);\n\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/virtual/main.c:12:12: error: incomplete definition of type 'struct request'
    if (!rq->start_time_ns)
         ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
/virtual/main.c:15:12: error: incomplete definition of type 'struct request'
    if (!rq->rq_disk || rq->rq_disk->major != 5 ||
         ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
/virtual/main.c:15:27: error: incomplete definition of type 'struct request'
    if (!rq->rq_disk || rq->rq_disk->major != 5 ||
                        ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
/virtual/main.c:16:11: error: incomplete definition of type 'struct request'
        rq->rq_disk->first_minor != 6)
        ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
/virtual/main.c:19:19: error: incomplete definition of type 'struct request'
    cmd_flags = rq->cmd_flags;
                ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
/virtual/main.c:37:19: error: incomplete definition of type 'struct request'
    dur = now - rq->start_time_ns;
                ~~^
include/linux/blkdev.h:32:8: note: forward declaration of 'struct request'
struct request;
       ^
6 errors generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nint sockopt(struct bpf_sockopt* ctx){\n\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'sockopt'
  func_name = _assert_is_bytes(func_name)
../usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_HASH(dummy);\nvoid do_trace(struct pt_regs *ctx) {\n    u64 key = 0, val = 2;\n    dummy.insert(&key, &val);\n    key = 1;\n    dummy.update(&key, &val);\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 'dummy'
  name = _assert_is_bytes(name)
/usr/lib/python3.6/site-packages/bcc/__init__.py:801: DeprecationWarning: not a bytes object: 'sync'
  name = _assert_is_bytes(name)
/usr/lib/python3.6/site-packages/bcc/__init__.py:816: DeprecationWarning: not a bytes object: 'do_trace'
  fn_name = _assert_is_bytes(fn_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/fs.h>\nint trace_entry(struct pt_regs *ctx, struct file *file) {\n    if (!file) return 0;\n    const char *name = file->f_path.dentry->d_name.name;\n    bpf_trace_printk("%s\\n", name);\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\nstruct sock {\n    u32 *sk_daddr;\n};\nint test(struct pt_regs *ctx, struct sock *skp) {\n    return *(skp->sk_daddr);\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nBPF_HASH(t1, struct bpf_tunnel_key, int, 1);\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 't1'
  name = _assert_is_bytes(name)
0
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\n#include <net/inet_sock.h>\nstatic inline int test_help(__be16 *addr) {\n    __be16 val = 0;\n    bpf_probe_read_kernel(&val, sizeof(val), addr);\n    return val;\n}\nint test(struct pt_regs *ctx) {\n    struct sock *sk;\n    sk = (struct sock *)PT_REGS_PARM1(ctx);\n    return test_help(&sk->sk_dport);\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:616: DeprecationWarning: not a bytes object: 'testing'
  name = _assert_is_bytes(name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\nstruct key_t {\n  u32 f1_1;               /* offset 0 */\n  struct {\n    char f2_1;            /* offset 16 */\n    __int128 f2_2;        /* offset 32 */\n  };\n  u8 f1_3;                /* offset 48 */\n  unsigned __int128 f1_4; /* offset 64 */\n  char f1_5;              /* offset 80 */\n};\nstruct value_t {\n  u8 src[4] __attribute__ ((aligned (8))); /* offset 0 */\n  u8 dst[4] __attribute__ ((aligned (8))); /* offset 8 */\n};\nBPF_HASH(table1, struct key_t, struct value_t);\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint trace_entry(struct pt_regs *ctx, struct sock *sk) {\n    u16 sport = ((struct inet_sock *)sk)->inet_sport;\n    return sport;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <bcc/proto.h>\nint handle_packet(void *ctx) {\n  u8 *cursor = 0;\n  struct ethernet_t *ethernet = cursor_advance(cursor, sizeof(*ethernet));\n  bpf_trace_printk("ethernet->dst = %llx, ethernet->src = %llx\\n",\n                   ethernet->dst, ethernet->src);\n  return 0;\n}\n'
  text = _assert_is_bytes(text)
..../usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/netdevice.h>\nstruct leaf { struct sk_buff *ptr; };\nint test(struct pt_regs *ctx, struct sk_buff *skb) {\n    struct leaf l = {};\n    struct leaf *lp = &l;\n    lp->ptr = skb;\n    return l.ptr->priority;\n}'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/netdevice.h>\nstruct leaf { struct sk_buff *ptr; };\nint test(struct pt_regs *ctx, struct sk_buff *skb) {\n    struct leaf l = {};\n    struct leaf *lp = &l;\n    lp->ptr = skb;\n    return lp->ptr->priority;\n}'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\n#include <uapi/linux/ptrace.h>\nint count_sched(struct pt_regs *ctx, struct task_struct *prev) {\n    pid_t p = prev->pid;\n    return (p != -1);\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'count_sched'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\n#include <uapi/linux/ptrace.h>\nint count_foo(struct pt_regs *ctx, unsigned long a, unsigned long b) {\n    return (a != b);\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'count_foo'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/tcp.h>\n#define _(P) ({typeof(P) val = 0; bpf_probe_read_kernel(&val, sizeof(val), &P); val;})\nint count_tcp(struct pt_regs *ctx, struct sk_buff *skb) {\n    return _(TCP_SKB_CB(skb)->tcp_gso_size);\n}\n'
  text = _assert_is_bytes(text)
In file included from /virtual/main.c:2:
In file included from include/net/tcp.h:35:
In file included from include/net/sock_reuseport.h:5:
In file included from include/linux/filter.h:9:
include/linux/bpf.h:353:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:353:24: note: forward declaration of 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                                     ^
include/linux/bpf.h:355:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:355:24: note: forward declaration of 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                                     ^
include/linux/bpf.h:357:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:357:24: note: forward declaration of 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                                     ^
include/linux/bpf.h:359:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:359:24: note: forward declaration of 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                                     ^
include/linux/bpf.h:361:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                       ^     ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:361:24: note: forward declaration of 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                                     ^
include/linux/bpf.h:379:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:379:29: note: forward declaration of 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                                          ^
include/linux/bpf.h:381:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:381:29: note: forward declaration of 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                                          ^
include/linux/bpf.h:383:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:383:29: note: forward declaration of 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                                          ^
include/linux/bpf.h:385:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:385:29: note: forward declaration of 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                                          ^
include/linux/bpf.h:387:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                       ^          ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:387:29: note: forward declaration of 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                                          ^
include/linux/bpf.h:2338:30: error: field has incomplete type 'enum bpf_cgroup_iter_order'
                enum bpf_cgroup_iter_order order;
                                           ^
include/linux/bpf.h:2338:8: note: forward declaration of 'enum bpf_cgroup_iter_order'
                enum bpf_cgroup_iter_order order;
                     ^
11 errors generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/tcp.h>\n#define _(P) ({typeof(P) val = 0; bpf_probe_read_kernel(&val, sizeof(val), &P); val;})\nint test(struct pt_regs *ctx, struct sk_buff *skb) {\n    return _(TCP_SKB_CB(skb)->tcp_gso_size) + skb->protocol;\n}\n'
  text = _assert_is_bytes(text)
In file included from /virtual/main.c:2:
In file included from include/net/tcp.h:35:
In file included from include/net/sock_reuseport.h:5:
In file included from include/linux/filter.h:9:
include/linux/bpf.h:353:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:353:24: note: forward declaration of 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                                     ^
include/linux/bpf.h:355:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:355:24: note: forward declaration of 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                                     ^
include/linux/bpf.h:357:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:357:24: note: forward declaration of 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                                     ^
include/linux/bpf.h:359:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:359:24: note: forward declaration of 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                                     ^
include/linux/bpf.h:361:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                       ^     ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:361:24: note: forward declaration of 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                                     ^
include/linux/bpf.h:379:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:379:29: note: forward declaration of 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                                          ^
include/linux/bpf.h:381:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:381:29: note: forward declaration of 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                                          ^
include/linux/bpf.h:383:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:383:29: note: forward declaration of 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                                          ^
include/linux/bpf.h:385:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:385:29: note: forward declaration of 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                                          ^
include/linux/bpf.h:387:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                       ^          ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:387:29: note: forward declaration of 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                                          ^
include/linux/bpf.h:2338:30: error: field has incomplete type 'enum bpf_cgroup_iter_order'
                enum bpf_cgroup_iter_order order;
                                           ^
include/linux/bpf.h:2338:8: note: forward declaration of 'enum bpf_cgroup_iter_order'
                enum bpf_cgroup_iter_order order;
                     ^
11 errors generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\n#include <linux/dcache.h>\nint test(struct pt_regs *ctx, const struct qstr *name) {\n    return name->name[1];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\n#include <linux/dcache.h>\nint test(struct pt_regs *ctx, const struct qstr *name) {\n    return name->name  [ 1];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\n#include <linux/dcache.h>\nint test(struct pt_regs *ctx, const struct qstr *name) {\n    return (name->name)[1];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\nint test(struct pt_regs *ctx, char *name) {\n    return name[1];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\nint test(struct pt_regs *ctx, char **name) {\n    return (*name)[1];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/ptrace.h>\nstruct test_t {\n    int tab[5];\n};\nint test(struct pt_regs *ctx, struct test_t *t) {\n    return *(&t->tab[1]);\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx, struct sock *sk) {\n    return sk->__sk_common.skc_v6_rcv_saddr.in6_u.u6_addr32[0];\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/mm_types.h>\nint test(struct pt_regs *ctx, struct mm_struct *mm) {\n    return mm->rss_stat.count[MM_ANONPAGES].counter;\n}\n'
  text = _assert_is_bytes(text)
/virtual/main.c:4:24: error: member reference base type 'struct percpu_counter[4]' is not a structure or union
    return mm->rss_stat.count[MM_ANONPAGES].counter;
           ~~~~~~~~~~~~^~~~~~
1 error generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx) {\n    struct sock *newsk = (struct sock *)PT_REGS_RC(ctx);\n    return newsk->__sk_common.skc_rcv_saddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/fs.h>\nstatic void print_file_name(struct file *file) {\n    if (!file) return;\n    const char *name = file->f_path.dentry->d_name.name;\n    bpf_trace_printk("%s\\n", name);\n}\nstatic void print_file_name2(int unused, struct file *file) {\n    print_file_name(file);\n}\nint trace_entry1(struct pt_regs *ctx, struct file *file) {\n    print_file_name(file);\n    return 0;\n}\nint trace_entry2(struct pt_regs *ctx, int unused, struct file *file) {\n    print_file_name2(unused, file);\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'trace_entry1'
  func_name = _assert_is_bytes(func_name)
/usr/lib/python3.6/site-packages/bcc/__init__.py:500: DeprecationWarning: not a bytes object: 'trace_entry2'
  func_name = _assert_is_bytes(func_name)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/blkdev.h>\nBPF_HASH(start, struct request *);\nint do_request(struct pt_regs *ctx, struct request *req) {\n    u64 ts = bpf_ktime_get_ns();\n    start.update(&req, &ts);\n    return 0;\n}\n\nint do_completion(struct pt_regs *ctx, struct request *req) {\n    u64 *tsp = start.lookup(&req);\n    if (tsp != 0) {\n        start.delete(&req);\n    }\n    return 0;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/sched.h>\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx) {\n    struct sock *sk;\n    sk = (struct sock *)PT_REGS_PARM1(ctx);\n    return sk->sk_dport;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/tcp.h>\nstatic inline u64 error_function() {\n    return 0;\n}\nstatic inline unsigned char *my_skb_transport_header(struct sk_buff *skb) {\n    if (skb)\n        return skb->head + skb->transport_header;\n    return (unsigned char *)error_function();\n}\nint test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) {\n    struct tcphdr *th = (struct tcphdr *)my_skb_transport_header(skb);\n    return th->seq;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx, struct sock *sk) {\n    struct sock *ptr1;\n    struct sock **ptr2 = &ptr1;\n    *ptr2 = sk;\n    return ((struct sock *)(*ptr2))->sk_daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx, struct sock *sk) {\n    struct sock *ptr1;\n    struct sock **ptr2 = &ptr1;\n    struct sock ***ptr3 = &ptr2;\n    *ptr2 = sk;\n    *ptr3 = ptr2;\n    return ((struct sock *)(**ptr3))->sk_daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx, struct sock *sk) {\n    struct sock **ptr1, **ptr2 = &sk;\n    ptr1 = &sk;\n    return (*ptr1)->sk_daddr + (*ptr2)->sk_daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nstatic struct sock **subtest(struct sock **sk) {\n    return sk;\n}\nint test(struct pt_regs *ctx, struct sock *sk) {\n    struct sock **ptr1, **ptr2 = subtest(&sk);\n    ptr1 = subtest(&sk);\n    return (*ptr1)->sk_daddr + (*ptr2)->sk_daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nstatic int subtest(struct sock ***skp) {\n    return ((struct sock *)(**skp))->sk_daddr;\n}\nint test(struct pt_regs *ctx, struct sock *sk) {\n    struct sock *ptr1;\n    struct sock **ptr2 = &ptr1;\n    struct sock ***ptr3 = &ptr2;\n    *ptr2 = sk;\n    *ptr3 = ptr2;\n    return subtest(ptr3);\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/inet_sock.h>\nint test(struct pt_regs *ctx, struct sock *skp) {\n    u32 *daddr = &skp->sk_daddr;\n    return *daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\nstruct sock {\n    u32 **sk_daddr;\n};\nint test(struct pt_regs *ctx, struct sock *skp) {\n    u32 *daddr = *(skp->sk_daddr);\n    return *daddr;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\nstruct sock {\n    u32 *sk_daddr;\n};\nint test(struct pt_regs *ctx, struct sock *skp) {\n    return *(&skp->sk_daddr);\n}\n'
  text = _assert_is_bytes(text)
/virtual/main.c:7:12: error: incompatible pointer to integer conversion returning 'u32 *' (aka 'unsigned int *') from a function with result type 'int'
      [-Wint-conversion]
    return *(&skp->sk_daddr);
           ^~~~~~~~~~~~~~~~~
1 error generated.
E/usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/tcp.h>\nstatic inline unsigned char *my_skb_transport_header(struct sk_buff *skb) {\n    return skb->head + skb->transport_header;\n}\nint test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) {\n    struct tcphdr *th = (struct tcphdr *)my_skb_transport_header(skb);\n    return th->seq;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/tcp.h>\nstatic inline struct tcphdr *my_skb_transport_header(struct sk_buff *skb) {\n    return (struct tcphdr *)skb->head + skb->transport_header;\n}\nint test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) {\n    return my_skb_transport_header(skb)->seq;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/ptrace.h>\n#include <linux/tcp.h>\nstatic inline unsigned char *my_skb_transport_header(struct sk_buff *skb) {\n    return skb->head + skb->transport_header;\n}\nint test(struct pt_regs *ctx, struct sock *sk, struct sk_buff *skb) {\n    u32 *seq = (u32 *)my_skb_transport_header(skb) + offsetof(struct tcphdr, seq);\n    return *seq;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <uapi/linux/pkt_cls.h>\n#include <linux/if_ether.h>\nint test(struct __sk_buff *ctx) {\n    void* data_end = (void*)(long)ctx->data_end;\n    void* data = (void*)(long)ctx->data;\n    if (data + sizeof(struct ethhdr) > data_end)\n        return TC_ACT_SHOT;\n    struct ethhdr *eh = (struct ethhdr *)data;\n    if (eh->h_proto == 0x1)\n        return TC_ACT_SHOT;\n    return TC_ACT_OK;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <linux/netdevice.h>\nTRACEPOINT_PROBE(skb, kfree_skb) {\n    struct sk_buff *skb = (struct sk_buff *)args->skbaddr;\n    return skb->protocol;\n}\n'
  text = _assert_is_bytes(text)
./usr/lib/python3.6/site-packages/bcc/__init__.py:425: DeprecationWarning: not a bytes object: '\n#include <net/tcp.h>\nint count_tcp(struct pt_regs *ctx, struct sk_buff *skb) {\n    // The below define is in net/tcp.h:\n    //    #define TCP_SKB_CB(__skb)\t((struct tcp_skb_cb *)&((__skb)->cb[0]))\n    // Note that it has AddrOf in the macro, which will cause current rewriter\n    // failing below statement\n    // return TCP_SKB_CB(skb)->tcp_gso_size;\n    u16 val = 0;\n    bpf_probe_read_kernel(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size));\n    return val;\n}\n'
  text = _assert_is_bytes(text)
In file included from /virtual/main.c:2:
In file included from include/net/tcp.h:35:
In file included from include/net/sock_reuseport.h:5:
In file included from include/linux/filter.h:9:
include/linux/bpf.h:353:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:353:24: note: forward declaration of 'struct bpf_list_head'
                return sizeof(struct bpf_list_head);
                                     ^
include/linux/bpf.h:355:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:355:24: note: forward declaration of 'struct bpf_list_node'
                return sizeof(struct bpf_list_node);
                                     ^
include/linux/bpf.h:357:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:357:24: note: forward declaration of 'struct bpf_rb_root'
                return sizeof(struct bpf_rb_root);
                                     ^
include/linux/bpf.h:359:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                       ^     ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:359:24: note: forward declaration of 'struct bpf_rb_node'
                return sizeof(struct bpf_rb_node);
                                     ^
include/linux/bpf.h:361:10: error: invalid application of 'sizeof' to an incomplete type 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                       ^     ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:361:24: note: forward declaration of 'struct bpf_refcount'
                return sizeof(struct bpf_refcount);
                                     ^
include/linux/bpf.h:379:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:379:29: note: forward declaration of 'struct bpf_list_head'
                return __alignof__(struct bpf_list_head);
                                          ^
include/linux/bpf.h:381:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:381:29: note: forward declaration of 'struct bpf_list_node'
                return __alignof__(struct bpf_list_node);
                                          ^
include/linux/bpf.h:383:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:383:29: note: forward declaration of 'struct bpf_rb_root'
                return __alignof__(struct bpf_rb_root);
                                          ^
include/linux/bpf.h:385:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                       ^          ~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:385:29: note: forward declaration of 'struct bpf_rb_node'
                return __alignof__(struct bpf_rb_node);
                                          ^
include/linux/bpf.h:387:10: error: invalid application of '__alignof' to an incomplete type 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
                       ^          ~~~~~~~~~~~~~~~~~~~~~
include/linux/bpf.h:387:29: note: forward declaration of 'struct bpf_refcount'
                return __alignof__(struct bpf_refcount);
================日志太多,省略部分======================================
ERROR: test_probe_read_nested_member3 (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 591, in test_probe_read_nested_member3
    b = BPF(text=text)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 476, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

======================================================================
ERROR: test_probe_read_whitelist1 (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 115, in test_probe_read_whitelist1
    b = BPF(text=text)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 476, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

======================================================================
ERROR: test_probe_read_whitelist2 (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 132, in test_probe_read_whitelist2
    b = BPF(text=text)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 476, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

======================================================================
ERROR: test_task_switch (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 414, in test_task_switch
    """)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 484, in __init__
    self._trace_autoload()
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 1455, in _trace_autoload
    fn_name=fn.name)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 844, in attach_kprobe
    (fn_name, event))
Exception: Failed to attach BPF program b'kprobe__finish_task_switch' to kprobe b'finish_task_switch', it's not traceable (either non-existing, inlined, or marked as "notrace")

======================================================================
ERROR: test_unop_probe_read (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 480, in test_unop_probe_read
    b = BPF(text=text)
  File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 476, in __init__
    raise Exception("Failed to compile BPF module %s" % (src_file or "<text>"))
Exception: Failed to compile BPF module <text>

======================================================================
FAIL: test_sscanf_string (__main__.TestClang)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_clang.py", line 226, in test_sscanf_string
    self.assertEqual(l.stack[0].name, name)
AssertionError: b' ' != b'libxyz'

----------------------------------------------------------------------
Ran 84 tests in 181.567s

FAILED (failures=1, errors=12)

[重现概率]:
必现

[重现环境]:
环境信息:倚天710机器
11.163.178.238

#uname -r
6.6.71-3_rc1.al8.aarch64

#cat /etc/os-release
NAME="Alibaba Cloud Linux"
VERSION="3 (Soaring Falcon)"
ID="alinux"
ID_LIKE="rhel fedora centos anolis"
VERSION_ID="3"
UPDATE_ID="10"
PLATFORM_ID="platform:al8"
PRETTY_NAME="Alibaba Cloud Linux 3 (Soaring Falcon)"
ANSI_COLOR="0;31"
HOME_URL="https://www.aliyun.com/"

#lscpu
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  128
Socket(s):           1
NUMA node(s):        2
Vendor ID:           ARM
BIOS Vendor ID:      T-HEAD
Model:               0
Model name:          Neoverse-N2
BIOS Model name:     Yitian710-128
Stepping:            r0p0
CPU MHz:             2750.000
BogoMIPS:            100.00
Hypervisor vendor:   Alibaba
Virtualization type: full
L1d cache:           64K
L1i cache:           64K
L2 cache:            1024K
L3 cache:            65536K
NUMA node0 CPU(s):   0-63
NUMA node1 CPU(s):   64-127
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm sb dcpodp sve2 sveaes svepmull svebitperm svesha3 svesm4 flagm2 frint svei8mm svebf16 i8mm bf16 dgh

#free -h
              total        used        free      shared  buff/cache   available
Mem:          125Gi       3.6Gi       121Gi        12Mi       1.0Gi       122Gi
Swap:         2.0Gi          0B       2.0Gi

#cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt2)/boot/vmlinuz-6.6.71-3_rc1.al8.aarch64 root=UUID=d0af582f-7147-41de-85e3-deb2e14cde99 ro biosdevname=0 rd.driver.pre=ahci iommu.passthrough=1 iommu.strict=0 nospectre_bhb ssbd=force-off systemd.unified_cgroup_hierarchy=0 cgroup.memory=nokmem console=ttyS0,115200 fsck.repair=yes crashkernel=0M-2G:0M,2G-256G:256M,256G-1024G:320M,1024G-:384M

#rpm -qa |grep bcc
bcc-tools-0.25.0-9.0.1.1.al8.aarch64
bcc-0.25.0-9.0.1.1.al8.aarch64
python3-bcc-0.25.0-9.0.1.1.al8.aarch64

[重现步骤]:
# 下载并编译测试套
git clone http://gitlab.alibaba-inc.com/alinux/bcc.git --branch=a3.2104
cd bcc
wget -O bcc-0.25.0.tar.gz "http://build.openanolis.cn/kojifiles/upstream-source/bcc-0.25.0.tar.gz.6cfc69c9fac8d1efe8902e8cc46f6495"
yum-builddep -y bcc.spec
rpmbuild -D "_topdir $(pwd)" -D "_sourcedir $(pwd)" -D "_builddir $(pwd)" -bp bcc.spec
yum -y install bcc-tools
cd  tests/python

# 执行用例
python test_clang.py

[期望结果]:
用例执行PASS

[实际结果]:
用例执行Fail

[分析]
根据https://project.aone.alibaba-inc.com/v2/project/690768/bug/60822517,开发同学分析除上游需要更新libbpf的case之外 b2d6b329910f396c38d53496cda80ae7bed7ee7f,其他都修复了。libbpf还需要支持5.10内核,所以建议剩余case添加到白名单
Comment 1 zhixin01 alibaba_cloud_group 2025-02-27 18:28:08 UTC
上面分析供参考,麻烦开发同学确认下问题是否需要关注
Comment 2 lv0322 alibaba_cloud_group 2025-03-06 17:38:59 UTC
如缺陷描述,属于已知问题,在此可以当作记录