tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: d35b2284e966c0bef3e2182a5c5ea02177dd32e4 commit: c132be2c4fcc1150ad0791c2a85dd4c9ad0bd0c8 [3354/4582] function_graph: Have the instances use their own ftrace_ops for filtering config: mips-randconfig-r052-20240607 (https://download.01.org/0day-ci/archive/20240607/202406072042.h0bVZTGa-lkp@xxxxxxxxx/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project d7d2d4f53fc79b4b58e8d8d08151b577c3699d4a) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406072042.h0bVZTGa-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202406072042.h0bVZTGa-lkp@xxxxxxxxx/ Note: the linux-next/master HEAD d35b2284e966c0bef3e2182a5c5ea02177dd32e4 builds fine. It may have been fixed somewhere. All errors (new ones prefixed by >>): In file included from kernel/trace/fgraph.c:12: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:21: In file included from include/linux/mm.h:2253: include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 514 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ >> kernel/trace/fgraph.c:934:8: error: call to undeclared function 'ftrace_startup_subops'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 934 | ret = ftrace_startup_subops(&graph_ops, &gops->ops, command); | ^ >> kernel/trace/fgraph.c:973:2: error: call to undeclared function 'ftrace_shutdown_subops'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 973 | ftrace_shutdown_subops(&graph_ops, &gops->ops, command); | ^ 1 warning and 2 errors generated. vim +/ftrace_startup_subops +934 kernel/trace/fgraph.c 888 889 int register_ftrace_graph(struct fgraph_ops *gops) 890 { 891 int command = 0; 892 int ret = 0; 893 int i; 894 895 mutex_lock(&ftrace_lock); 896 897 if (!fgraph_array[0]) { 898 /* The array must always have real data on it */ 899 for (i = 0; i < FGRAPH_ARRAY_SIZE; i++) 900 fgraph_array[i] = &fgraph_stub; 901 } 902 903 /* Look for an available spot */ 904 for (i = 0; i < FGRAPH_ARRAY_SIZE; i++) { 905 if (fgraph_array[i] == &fgraph_stub) 906 break; 907 } 908 if (i >= FGRAPH_ARRAY_SIZE) { 909 ret = -ENOSPC; 910 goto out; 911 } 912 913 fgraph_array[i] = gops; 914 if (i + 1 > fgraph_array_cnt) 915 fgraph_array_cnt = i + 1; 916 gops->idx = i; 917 918 ftrace_graph_active++; 919 920 if (ftrace_graph_active == 1) { 921 register_pm_notifier(&ftrace_suspend_notifier); 922 ret = start_graph_tracing(); 923 if (ret) 924 goto error; 925 /* 926 * Some archs just test to see if these are not 927 * the default function 928 */ 929 ftrace_graph_return = return_run; 930 ftrace_graph_entry = entry_run; 931 command = FTRACE_START_FUNC_RET; 932 } 933 > 934 ret = ftrace_startup_subops(&graph_ops, &gops->ops, command); 935 error: 936 if (ret) { 937 fgraph_array[i] = &fgraph_stub; 938 ftrace_graph_active--; 939 } 940 out: 941 mutex_unlock(&ftrace_lock); 942 return ret; 943 } 944 945 void unregister_ftrace_graph(struct fgraph_ops *gops) 946 { 947 int command = 0; 948 int i; 949 950 mutex_lock(&ftrace_lock); 951 952 if (unlikely(!ftrace_graph_active)) 953 goto out; 954 955 if (unlikely(gops->idx < 0 || gops->idx >= fgraph_array_cnt)) 956 goto out; 957 958 WARN_ON_ONCE(fgraph_array[gops->idx] != gops); 959 960 fgraph_array[gops->idx] = &fgraph_stub; 961 if (gops->idx + 1 == fgraph_array_cnt) { 962 i = gops->idx; 963 while (i >= 0 && fgraph_array[i] == &fgraph_stub) 964 i--; 965 fgraph_array_cnt = i + 1; 966 } 967 968 ftrace_graph_active--; 969 970 if (!ftrace_graph_active) 971 command = FTRACE_STOP_FUNC_RET; 972 > 973 ftrace_shutdown_subops(&graph_ops, &gops->ops, command); -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki