Hi Yonghong,

[auto build test ERROR on net-next/master]

url:    
https://github.com/0day-ci/linux/commits/Yonghong-Song/bpf-add-support-for-sys_-enter-exit-_-tracepoints/20170803-213504
config: i386-randconfig-x019-201731 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   kernel/events/core.c: In function 'perf_event_set_bpf_prog':
>> kernel/events/core.c:8073:18: error: implicit declaration of function 
>> 'is_syscall_trace_event' [-Werror=implicit-function-declaration]
     is_syscall_tp = is_syscall_trace_event(event->tp_event);
                     ^~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/is_syscall_trace_event +8073 kernel/events/core.c

  8059  
  8060  static int perf_event_set_bpf_prog(struct perf_event *event, u32 
prog_fd)
  8061  {
  8062          bool is_kprobe, is_tracepoint, is_syscall_tp;
  8063          struct bpf_prog *prog;
  8064  
  8065          if (event->attr.type != PERF_TYPE_TRACEPOINT)
  8066                  return perf_event_set_bpf_handler(event, prog_fd);
  8067  
  8068          if (event->tp_event->prog)
  8069                  return -EEXIST;
  8070  
  8071          is_kprobe = event->tp_event->flags & TRACE_EVENT_FL_UKPROBE;
  8072          is_tracepoint = event->tp_event->flags & 
TRACE_EVENT_FL_TRACEPOINT;
> 8073          is_syscall_tp = is_syscall_trace_event(event->tp_event);
  8074          if (!is_kprobe && !is_tracepoint && !is_syscall_tp)
  8075                  /* bpf programs can only be attached to u/kprobe or 
tracepoint */
  8076                  return -EINVAL;
  8077  
  8078          prog = bpf_prog_get(prog_fd);
  8079          if (IS_ERR(prog))
  8080                  return PTR_ERR(prog);
  8081  
  8082          if ((is_kprobe && prog->type != BPF_PROG_TYPE_KPROBE) ||
  8083              (is_tracepoint && prog->type != BPF_PROG_TYPE_TRACEPOINT) ||
  8084              (is_syscall_tp && prog->type != BPF_PROG_TYPE_TRACEPOINT)) {
  8085                  /* valid fd, but invalid bpf program type */
  8086                  bpf_prog_put(prog);
  8087                  return -EINVAL;
  8088          }
  8089  
  8090          if (is_tracepoint) {
  8091                  int off = trace_event_get_offsets(event->tp_event);
  8092  
  8093                  if (prog->aux->max_ctx_offset > off) {
  8094                          bpf_prog_put(prog);
  8095                          return -EACCES;
  8096                  }
  8097          }
  8098          event->tp_event->prog = prog;
  8099  
  8100          return 0;
  8101  }
  8102  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip

Reply via email to