All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrii Nakryiko <andrii@kernel.org>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net
Cc: kbuild-all@lists.01.org, andrii@kernel.org, kernel-team@fb.com,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH bpf-next 04/14] bpf: implement minimal BPF perf link
Date: Mon, 26 Jul 2021 03:52:00 +0800	[thread overview]
Message-ID: <202107260340.clhEA5P9-lkp@intel.com> (raw)
In-Reply-To: <20210725173845.2593626-5-andrii@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4334 bytes --]

Hi Andrii,

I love your patch! Yet something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Andrii-Nakryiko/BPF-perf-link-and-user-provided-context-value/20210726-014304
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: powerpc64-randconfig-s032-20210725 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/aebdacfee760371d78456f088ddcc6c5450ce5f5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andrii-Nakryiko/BPF-perf-link-and-user-provided-context-value/20210726-014304
        git checkout aebdacfee760371d78456f088ddcc6c5450ce5f5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/bpf/syscall.c: In function 'bpf_perf_link_release':
>> kernel/bpf/syscall.c:2919:2: error: implicit declaration of function 'perf_event_free_bpf_prog'; did you mean 'perf_event_detach_bpf_prog'? [-Werror=implicit-function-declaration]
    2919 |  perf_event_free_bpf_prog(event);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~
         |  perf_event_detach_bpf_prog
   kernel/bpf/syscall.c: In function 'bpf_perf_link_attach':
>> kernel/bpf/syscall.c:2965:8: error: implicit declaration of function 'perf_event_set_bpf_prog'; did you mean 'perf_event_detach_bpf_prog'? [-Werror=implicit-function-declaration]
    2965 |  err = perf_event_set_bpf_prog(event, prog);
         |        ^~~~~~~~~~~~~~~~~~~~~~~
         |        perf_event_detach_bpf_prog
   cc1: some warnings being treated as errors


vim +2919 kernel/bpf/syscall.c

  2913	
  2914	static void bpf_perf_link_release(struct bpf_link *link)
  2915	{
  2916		struct bpf_perf_link *perf_link = container_of(link, struct bpf_perf_link, link);
  2917		struct perf_event *event = perf_link->perf_file->private_data;
  2918	
> 2919		perf_event_free_bpf_prog(event);
  2920		fput(perf_link->perf_file);
  2921	}
  2922	
  2923	static void bpf_perf_link_dealloc(struct bpf_link *link)
  2924	{
  2925		struct bpf_perf_link *perf_link = container_of(link, struct bpf_perf_link, link);
  2926	
  2927		kfree(perf_link);
  2928	}
  2929	
  2930	static const struct bpf_link_ops bpf_perf_link_lops = {
  2931		.release = bpf_perf_link_release,
  2932		.dealloc = bpf_perf_link_dealloc,
  2933	};
  2934	
  2935	static int bpf_perf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
  2936	{
  2937		struct bpf_link_primer link_primer;
  2938		struct bpf_perf_link *link;
  2939		struct perf_event *event;
  2940		struct file *perf_file;
  2941		int err;
  2942	
  2943		if (attr->link_create.flags)
  2944			return -EINVAL;
  2945	
  2946		perf_file = perf_event_get(attr->link_create.target_fd);
  2947		if (IS_ERR(perf_file))
  2948			return PTR_ERR(perf_file);
  2949	
  2950		link = kzalloc(sizeof(*link), GFP_USER);
  2951		if (!link) {
  2952			err = -ENOMEM;
  2953			goto out_put_file;
  2954		}
  2955		bpf_link_init(&link->link, BPF_LINK_TYPE_PERF_EVENT, &bpf_perf_link_lops, prog);
  2956		link->perf_file = perf_file;
  2957	
  2958		err = bpf_link_prime(&link->link, &link_primer);
  2959		if (err) {
  2960			kfree(link);
  2961			goto out_put_file;
  2962		}
  2963	
  2964		event = perf_file->private_data;
> 2965		err = perf_event_set_bpf_prog(event, prog);
  2966		if (err) {
  2967			bpf_link_cleanup(&link_primer);
  2968			goto out_put_file;
  2969		}
  2970		/* perf_event_set_bpf_prog() doesn't take its own refcnt on prog */
  2971		bpf_prog_inc(prog);
  2972	
  2973		return bpf_link_settle(&link_primer);
  2974	
  2975	out_put_file:
  2976		fput(perf_file);
  2977		return err;
  2978	}
  2979	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36089 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH bpf-next 04/14] bpf: implement minimal BPF perf link
Date: Mon, 26 Jul 2021 03:52:00 +0800	[thread overview]
Message-ID: <202107260340.clhEA5P9-lkp@intel.com> (raw)
In-Reply-To: <20210725173845.2593626-5-andrii@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 4449 bytes --]

Hi Andrii,

I love your patch! Yet something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Andrii-Nakryiko/BPF-perf-link-and-user-provided-context-value/20210726-014304
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: powerpc64-randconfig-s032-20210725 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 10.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/aebdacfee760371d78456f088ddcc6c5450ce5f5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andrii-Nakryiko/BPF-perf-link-and-user-provided-context-value/20210726-014304
        git checkout aebdacfee760371d78456f088ddcc6c5450ce5f5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-10.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=powerpc64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/bpf/syscall.c: In function 'bpf_perf_link_release':
>> kernel/bpf/syscall.c:2919:2: error: implicit declaration of function 'perf_event_free_bpf_prog'; did you mean 'perf_event_detach_bpf_prog'? [-Werror=implicit-function-declaration]
    2919 |  perf_event_free_bpf_prog(event);
         |  ^~~~~~~~~~~~~~~~~~~~~~~~
         |  perf_event_detach_bpf_prog
   kernel/bpf/syscall.c: In function 'bpf_perf_link_attach':
>> kernel/bpf/syscall.c:2965:8: error: implicit declaration of function 'perf_event_set_bpf_prog'; did you mean 'perf_event_detach_bpf_prog'? [-Werror=implicit-function-declaration]
    2965 |  err = perf_event_set_bpf_prog(event, prog);
         |        ^~~~~~~~~~~~~~~~~~~~~~~
         |        perf_event_detach_bpf_prog
   cc1: some warnings being treated as errors


vim +2919 kernel/bpf/syscall.c

  2913	
  2914	static void bpf_perf_link_release(struct bpf_link *link)
  2915	{
  2916		struct bpf_perf_link *perf_link = container_of(link, struct bpf_perf_link, link);
  2917		struct perf_event *event = perf_link->perf_file->private_data;
  2918	
> 2919		perf_event_free_bpf_prog(event);
  2920		fput(perf_link->perf_file);
  2921	}
  2922	
  2923	static void bpf_perf_link_dealloc(struct bpf_link *link)
  2924	{
  2925		struct bpf_perf_link *perf_link = container_of(link, struct bpf_perf_link, link);
  2926	
  2927		kfree(perf_link);
  2928	}
  2929	
  2930	static const struct bpf_link_ops bpf_perf_link_lops = {
  2931		.release = bpf_perf_link_release,
  2932		.dealloc = bpf_perf_link_dealloc,
  2933	};
  2934	
  2935	static int bpf_perf_link_attach(const union bpf_attr *attr, struct bpf_prog *prog)
  2936	{
  2937		struct bpf_link_primer link_primer;
  2938		struct bpf_perf_link *link;
  2939		struct perf_event *event;
  2940		struct file *perf_file;
  2941		int err;
  2942	
  2943		if (attr->link_create.flags)
  2944			return -EINVAL;
  2945	
  2946		perf_file = perf_event_get(attr->link_create.target_fd);
  2947		if (IS_ERR(perf_file))
  2948			return PTR_ERR(perf_file);
  2949	
  2950		link = kzalloc(sizeof(*link), GFP_USER);
  2951		if (!link) {
  2952			err = -ENOMEM;
  2953			goto out_put_file;
  2954		}
  2955		bpf_link_init(&link->link, BPF_LINK_TYPE_PERF_EVENT, &bpf_perf_link_lops, prog);
  2956		link->perf_file = perf_file;
  2957	
  2958		err = bpf_link_prime(&link->link, &link_primer);
  2959		if (err) {
  2960			kfree(link);
  2961			goto out_put_file;
  2962		}
  2963	
  2964		event = perf_file->private_data;
> 2965		err = perf_event_set_bpf_prog(event, prog);
  2966		if (err) {
  2967			bpf_link_cleanup(&link_primer);
  2968			goto out_put_file;
  2969		}
  2970		/* perf_event_set_bpf_prog() doesn't take its own refcnt on prog */
  2971		bpf_prog_inc(prog);
  2972	
  2973		return bpf_link_settle(&link_primer);
  2974	
  2975	out_put_file:
  2976		fput(perf_file);
  2977		return err;
  2978	}
  2979	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 36089 bytes --]

  reply	other threads:[~2021-07-25 19:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-25 17:38 [PATCH bpf-next 00/14] BPF perf link and user-provided context value Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 01/14] bpf: refactor BPF_PROG_RUN into a function Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 02/14] bpf: refactor BPF_PROG_RUN_ARRAY family of macros into functions Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 03/14] bpf: refactor perf_event_set_bpf_prog() to use struct bpf_prog input Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 04/14] bpf: implement minimal BPF perf link Andrii Nakryiko
2021-07-25 19:52   ` kernel test robot [this message]
2021-07-25 19:52     ` kernel test robot
2021-07-25 20:09     ` Andrii Nakryiko
2021-07-25 20:09       ` Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 05/14] bpf: allow to specify user-provided context value for BPF perf links Andrii Nakryiko
2021-07-25 19:52   ` kernel test robot
2021-07-25 19:52     ` kernel test robot
2021-07-25 21:01   ` kernel test robot
2021-07-25 21:01     ` kernel test robot
2021-07-25 17:38 ` [PATCH bpf-next 06/14] bpf: add bpf_get_user_ctx() BPF helper to access user_ctx value Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 07/14] libbpf: re-build libbpf.so when libbpf.map changes Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 08/14] libbpf: remove unused bpf_link's destroy operation, but add dealloc Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 09/14] libbpf: use BPF perf link when supported by kernel Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 10/14] libbpf: add user_ctx support to bpf_link_create() API Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 11/14] libbpf: add user_ctx to perf_event, kprobe, uprobe, and tp attach APIs Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 12/14] selftests/bpf: test low-level perf BPF link API Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 13/14] selftests/bpf: extract uprobe-related helpers into trace_helpers.{c,h} Andrii Nakryiko
2021-07-25 17:38 ` [PATCH bpf-next 14/14] selftests/bpf: add user_ctx selftests for high-level APIs Andrii Nakryiko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107260340.clhEA5P9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kbuild-all@lists.01.org \
    --cc=kernel-team@fb.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.