Re: [PATCH v2 perf,bpf 1/3] perf, bpf: Introduce PERF_RECORD_BPF_EVENT
From: kbuild test robot
Date: Sat Dec 08 2018 - 13:10:47 EST
Hi Song,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/perf/core]
[also build test ERROR on v4.20-rc5 next-20181207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Song-Liu/perf-bpf-Introduce-PERF_RECORD_BPF_EVENT/20181207-083615
config: i386-randconfig-s3-12051035 (attached as .config)
compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
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_bpf_output':
>> kernel/events/core.c:7694:2: error: implicit declaration of function 'bpf_get_prog_name' [-Werror=implicit-function-declaration]
bpf_get_prog_name(bpf_event->prog, name);
^~~~~~~~~~~~~~~~~
kernel/events/core.c: In function 'perf_event_bpf_event_subprog':
kernel/events/core.c:7737:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
.addr = (u64)prog->bpf_func,
^
cc1: some warnings being treated as errors
vim +/bpf_get_prog_name +7694 kernel/events/core.c
7679
7680 static void perf_event_bpf_output(struct perf_event *event,
7681 void *data)
7682 {
7683 struct perf_bpf_event *bpf_event = data;
7684 struct perf_output_handle handle;
7685 struct perf_sample_data sample;
7686 char name[KSYM_NAME_LEN];
7687 int name_len;
7688 int ret;
7689
7690 if (!perf_event_bpf_match(event))
7691 return;
7692
7693 /* get prog name and round up to 64 bit aligned */
> 7694 bpf_get_prog_name(bpf_event->prog, name);
7695 name_len = strlen(name) + 1;
7696 while (!IS_ALIGNED(name_len, sizeof(u64)))
7697 name[name_len++] = '\0';
7698 bpf_event->event_id.len += name_len;
7699
7700 perf_event_header__init_id(&bpf_event->event_id.header, &sample, event);
7701 ret = perf_output_begin(&handle, event,
7702 bpf_event->event_id.header.size);
7703 if (ret)
7704 return;
7705
7706 perf_output_put(&handle, bpf_event->event_id);
7707
7708 __output_copy(&handle, name, name_len);
7709
7710 perf_event__output_id_sample(event, &handle, &sample);
7711
7712 perf_output_end(&handle);
7713 }
7714
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip