Hi Yonghong,

Thank you for the patch! Yet something to improve:

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

url:    
https://github.com/0day-ci/linux/commits/Martin-KaFai-Lau/bpf-Add-btf-func-info-support/20181120-181333
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: i386-randconfig-s0-11191736 (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/bpf/core.o: In function `bpf_get_prog_name':
>> kernel/bpf/core.c:414: undefined reference to `btf_type_by_id'
>> kernel/bpf/core.c:415: undefined reference to `btf_name_by_offset'

vim +414 kernel/bpf/core.c

   391  
   392  static void bpf_get_prog_name(const struct bpf_prog *prog, char *sym)
   393  {
   394          const char *end = sym + KSYM_NAME_LEN;
   395          const struct btf_type *type;
   396          const char *func_name;
   397  
   398          BUILD_BUG_ON(sizeof("bpf_prog_") +
   399                       sizeof(prog->tag) * 2 +
   400                       /* name has been null terminated.
   401                        * We should need +1 for the '_' preceding
   402                        * the name.  However, the null character
   403                        * is double counted between the name and the
   404                        * sizeof("bpf_prog_") above, so we omit
   405                        * the +1 here.
   406                        */
   407                       sizeof(prog->aux->name) > KSYM_NAME_LEN);
   408  
   409          sym += snprintf(sym, KSYM_NAME_LEN, "bpf_prog_");
   410          sym  = bin2hex(sym, prog->tag, sizeof(prog->tag));
   411  
   412          /* prog->aux->name will be ignored if full btf name is 
available */
   413          if (prog->aux->btf) {
 > 414                  type = btf_type_by_id(prog->aux->btf, 
 > prog->aux->type_id);
 > 415                  func_name = btf_name_by_offset(prog->aux->btf, 
 > type->name_off);
   416                  snprintf(sym, (size_t)(end - sym), "_%s", func_name);
   417                  return;
   418          }
   419  
   420          if (prog->aux->name[0])
   421                  snprintf(sym, (size_t)(end - sym), "_%s", 
prog->aux->name);
   422          else
   423                  *sym = 0;
   424  }
   425  

---
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