mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Olsa <jolsa@kernel.org>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org
Subject: [jolsa-perf:bpf/tramp_29 25/32] kernel/bpf/trampoline.c:948:9: error: call to undeclared function 'ftrace_hash_alloc'; ISO C99 and later do not support implicit function declarations
Date: Tue, 12 Jul 2022 05:41:39 +0800	[thread overview]
Message-ID: <202207120555.rWXO6yao-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/tramp_29
head:   ec522c20e55e48f561146afbb81513e20870ee12
commit: f8f16c805972e534643c5a5d23709766f7af22e4 [25/32] bpf: Add support to attach multi trampolines
config: i386-randconfig-a002 (https://download.01.org/0day-ci/archive/20220712/202207120555.rWXO6yao-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project badda4ac3c489a8c8cccdad1f74b9308c350a9e0)
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://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=f8f16c805972e534643c5a5d23709766f7af22e4
        git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
        git fetch --no-tags jolsa-perf bpf/tramp_29
        git checkout f8f16c805972e534643c5a5d23709766f7af22e4
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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/bpf/trampoline.c:948:9: error: call to undeclared function 'ftrace_hash_alloc'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           hash = ftrace_hash_alloc(FTRACE_HASH_MAX_BITS);
                  ^
>> kernel/bpf/trampoline.c:948:27: error: use of undeclared identifier 'FTRACE_HASH_MAX_BITS'
           hash = ftrace_hash_alloc(FTRACE_HASH_MAX_BITS);
                                    ^
>> kernel/bpf/trampoline.c:975:5: error: call to undeclared function 'ftrace_hash_add_entry'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                                   ftrace_hash_add_entry(hash, entry);
                                   ^
   kernel/bpf/trampoline.c:985:4: error: call to undeclared function 'ftrace_hash_add_entry'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                           ftrace_hash_add_entry(hash, entry);
                           ^
>> kernel/bpf/trampoline.c:989:8: error: call to undeclared function 'set_ftrace_direct'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           err = set_ftrace_direct(hash);
                 ^
>> kernel/bpf/trampoline.c:991:2: error: call to undeclared function 'ftrace_hash_free'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
           ftrace_hash_free(hash);
           ^
   6 errors generated.


vim +/ftrace_hash_alloc +948 kernel/bpf/trampoline.c

   941	
   942	static int bpf_tramp_update_set(struct list_head *upd)
   943	{
   944		struct bpf_trampoline *tr;
   945		struct ftrace_hash *hash;
   946		int i, err;
   947	
 > 948		hash = ftrace_hash_alloc(FTRACE_HASH_MAX_BITS);
   949		if (!hash)
   950			return -ENOMEM;
   951	
   952		list_for_each_entry(tr, upd, update.list) {
   953			struct ftrace_func_entry *entry;
   954			unsigned long direct;
   955	
   956			switch (tr->update.action) {
   957			case BPF_TRAMP_UPDATE_REG:
   958			case BPF_TRAMP_UPDATE_MODIFY:
   959				direct = (unsigned long) tr->update.im->image;
   960				break;
   961			case BPF_TRAMP_UPDATE_UNREG:
   962				direct = 0;
   963				break;
   964			}
   965	
   966			if (tr->multi.id_multi) {
   967				for (i = 0; i < tr->multi.id_multi->cnt; i++) {
   968					entry = kmalloc(sizeof(*entry), GFP_KERNEL);
   969					if (!entry) {
   970						err = -ENOMEM;
   971						goto out_free;
   972					}
   973					entry->ip = (unsigned long) tr->multi.id_multi->addr[i];
   974					entry->direct = direct;
 > 975					ftrace_hash_add_entry(hash, entry);
   976				}
   977			} else {
   978				entry = kmalloc(sizeof(*entry), GFP_KERNEL);
   979				if (!entry) {
   980					err = -ENOMEM;
   981					goto out_free;
   982				}
   983				entry->ip = (unsigned long) tr->func.addr;
   984				entry->direct = direct;
   985				ftrace_hash_add_entry(hash, entry);
   986			}
   987		}
   988	
 > 989		err = set_ftrace_direct(hash);
   990	out_free:
 > 991		ftrace_hash_free(hash);
   992		return err;
   993	}
   994	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

                 reply	other threads:[~2022-07-11 21:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202207120555.rWXO6yao-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jolsa@kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®