From: kernel test robot <lkp@intel.com>
To: Song Liu <song@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, kernel-team@fb.com, rostedt@goodmis.org,
jolsa@kernel.org, Song Liu <song@kernel.org>
Subject: Re: [PATCH bpf-next 3/5] ftrace: introduce FTRACE_OPS_FL_SHARE_IPMODIFY
Date: Thu, 2 Jun 2022 06:01:43 +0800 [thread overview]
Message-ID: <202206020533.bBh0IXx6-lkp@intel.com> (raw)
In-Reply-To: <20220601175749.3071572-4-song@kernel.org>
Hi Song,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url: https://github.com/intel-lab-lkp/linux/commits/Song-Liu/ftrace-host-klp-and-bpf-trampoline-together/20220602-020112
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: parisc-randconfig-r005-20220531 (https://download.01.org/0day-ci/archive/20220602/202206020533.bBh0IXx6-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/a710d92bb10a7a0376af57af15208ea1b4396545
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Song-Liu/ftrace-host-klp-and-bpf-trampoline-together/20220602-020112
git checkout a710d92bb10a7a0376af57af15208ea1b4396545
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash kernel/trace/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
kernel/trace/ftrace.c: In function 'prepare_direct_functions_for_ipmodify':
kernel/trace/ftrace.c:8005:21: error: 'direct_mutex' undeclared (first use in this function); did you mean 'event_mutex'?
8005 | mutex_lock(&direct_mutex);
| ^~~~~~~~~~~~
| event_mutex
kernel/trace/ftrace.c:8005:21: note: each undeclared identifier is reported only once for each function it appears in
>> kernel/trace/ftrace.c:8007:19: error: 'struct ftrace_ops' has no member named 'func_hash'
8007 | hash = ops->func_hash->filter_hash;
| ^~
>> kernel/trace/ftrace.c:8020:37: error: implicit declaration of function 'ops_references_ip' [-Werror=implicit-function-declaration]
8020 | if (ops_references_ip(op, ip)) {
| ^~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:8028:40: error: 'struct ftrace_ops' has no member named 'ops_func'
8028 | if (!op->ops_func) {
| ^~
kernel/trace/ftrace.c:8032:41: error: 'struct ftrace_ops' has no member named 'ops_func'
8032 | ret = op->ops_func(op, FTRACE_OPS_CMD_ENABLE_SHARE_IPMODIFY);
| ^~
kernel/trace/ftrace.c: In function 'register_ftrace_function':
kernel/trace/ftrace.c:8084:31: error: 'direct_mutex' undeclared (first use in this function); did you mean 'event_mutex'?
8084 | mutex_unlock(&direct_mutex);
| ^~~~~~~~~~~~
| event_mutex
cc1: some warnings being treated as errors
vim +8007 kernel/trace/ftrace.c
7974
7975 /*
7976 * When registering ftrace_ops with IPMODIFY (not direct), it is necessary
7977 * to make sure it doesn't conflict with any direct ftrace_ops. If there is
7978 * existing direct ftrace_ops on a kernel function being patched, call
7979 * FTRACE_OPS_CMD_ENABLE_SHARE_IPMODIFY on it to enable sharing.
7980 *
7981 * @ops: ftrace_ops being registered.
7982 *
7983 * Returns:
7984 * 0 - @ops does have IPMODIFY or @ops itself is DIRECT, no change
7985 * needed;
7986 * 1 - @ops has IPMODIFY, hold direct_mutex;
7987 * -EBUSY - currently registered DIRECT ftrace_ops does not support
7988 * SHARE_IPMODIFY, we need to abort the register.
7989 * -EAGAIN - cannot make changes to currently registered DIRECT
7990 * ftrace_ops at the moment, but we can retry later. This
7991 * is needed to avoid potential deadlocks.
7992 */
7993 static int prepare_direct_functions_for_ipmodify(struct ftrace_ops *ops)
7994 __acquires(&direct_mutex)
7995 {
7996 struct ftrace_func_entry *entry;
7997 struct ftrace_hash *hash;
7998 struct ftrace_ops *op;
7999 int size, i, ret;
8000
8001 if (!(ops->flags & FTRACE_OPS_FL_IPMODIFY) ||
8002 (ops->flags & FTRACE_OPS_FL_DIRECT))
8003 return 0;
8004
8005 mutex_lock(&direct_mutex);
8006
> 8007 hash = ops->func_hash->filter_hash;
8008 size = 1 << hash->size_bits;
8009 for (i = 0; i < size; i++) {
8010 hlist_for_each_entry(entry, &hash->buckets[i], hlist) {
8011 unsigned long ip = entry->ip;
8012 bool found_op = false;
8013
8014 mutex_lock(&ftrace_lock);
8015 do_for_each_ftrace_op(op, ftrace_ops_list) {
8016 if (!(op->flags & FTRACE_OPS_FL_DIRECT))
8017 continue;
8018 if (op->flags & FTRACE_OPS_FL_SHARE_IPMODIFY)
8019 break;
> 8020 if (ops_references_ip(op, ip)) {
8021 found_op = true;
8022 break;
8023 }
8024 } while_for_each_ftrace_op(op);
8025 mutex_unlock(&ftrace_lock);
8026
8027 if (found_op) {
> 8028 if (!op->ops_func) {
8029 ret = -EBUSY;
8030 goto err_out;
8031 }
8032 ret = op->ops_func(op, FTRACE_OPS_CMD_ENABLE_SHARE_IPMODIFY);
8033 if (ret)
8034 goto err_out;
8035 }
8036 }
8037 }
8038
8039 /*
8040 * Didn't find any overlap with any direct function, or the direct
8041 * function can share with ipmodify. Hold direct_mutex to make sure
8042 * this doesn't change until we are done.
8043 */
8044 return 1;
8045
8046 err_out:
8047 mutex_unlock(&direct_mutex);
8048 return ret;
8049
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next prev parent reply other threads:[~2022-06-01 22:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-01 17:57 [PATCH bpf-next 0/5] ftrace: host klp and bpf trampoline together Song Liu
2022-06-01 17:57 ` [PATCH bpf-next 1/5] ftrace: allow customized flags for ftrace_direct_multi ftrace_ops Song Liu
2022-06-01 17:57 ` [PATCH bpf-next 2/5] ftrace: add modify_ftrace_direct_multi_nolock Song Liu
2022-06-01 17:57 ` [PATCH bpf-next 3/5] ftrace: introduce FTRACE_OPS_FL_SHARE_IPMODIFY Song Liu
2022-06-01 22:01 ` kernel test robot [this message]
2022-06-01 17:57 ` [PATCH bpf-next 4/5] bpf, x64: Allow to use caller address from stack Song Liu
2022-06-01 17:57 ` [PATCH bpf-next 5/5] bpf: trampoline: support FTRACE_OPS_FL_SHARE_IPMODIFY Song Liu
2022-06-01 22:44 ` kernel test robot
2022-06-02 0:08 ` kernel test robot
2022-06-02 1:30 ` kernel test robot
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=202206020533.bBh0IXx6-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=jolsa@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=song@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).