[peterz-queue:perf/wip.self 1/2] kernel/events/internal.h:119:12: warning: unused function 'data_page_nr'

kernel test robot
2022-04-15T07:44:22Z

tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/wip.self
head: f1d67e1a09eeba97cd3f849659d5e5f42628b40b
commit: 4b2def7729bd01b55ffb35992f6d01e3e5a8c808 [1/2] perf/core: Fix perf_mmap fail when CONFIG_PERF_USE_VMALLOC enabled
config: mips-randconfig-c004-20220414 (https://download.01.org/0day-ci/archive/20220415/202204151530.OGcSofvs-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 6b7e6ea489f6dd45a9b0da9ac20871560917b9b0)
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
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=4b2def7729bd01b55ffb35992f6d01e3e5a8c808
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue perf/wip.self
git checkout 4b2def7729bd01b55ffb35992f6d01e3e5a8c808
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash kernel/

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

All warnings (new ones prefixed by >>):

In file included from kernel/events/callchain.c:15:
>> kernel/events/internal.h:119:12: warning: unused function 'data_page_nr'
static int data_page_nr(struct perf_buffer
^
fatal error: error in backend: Nested variants found in inline asm string: ' .set push
.set mips64r2
.if ( 0x00 ) != -1)) 0x00 ) != -1)) : ($( static struct ftrace_branch_data __attribute__((__aligned__(4))) __attribute__((__section__("_ftrace_branch"))) __if_trace = $( .func = __func__, .file = "arch/mips/include/asm/atomic.h", .line = 155, $); 0x00 ) != -1)) : $))) ) && ( 0 ); .set push; .set mips64r2; .rept 1; sync 0x00; .endr; .set pop; .else; ; .endif
1: ll $1, $2 # atomic_add_return
addu $0, $1, $3
sc $0, $2
beqz $0, 1b
addu $0, $1, $3
.set pop
'
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -Wp,-MMD,kernel/events/.callchain.o.d -nostdinc -Iarch/mips/include -I./arch/mips/include/generated -Iinclude -I./include -Iarch/mips/include/uapi -I./arch/mips/include/generated/uapi -Iinclude/uapi -I./include/generated/uapi -include include/linux/compiler-version.h -include include/linux/kconfig.h -include include/linux/compiler_types.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff84000000 -DLINKER_LOAD_ADDRESS=0x84000000 -DDATAOFFSET=0 -Qunused-arguments -fmacro-prefix-map== -DKBUILD_EXTRA_WARN1 -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu11 --target=mips-linux -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -ffreestanding -EB -fno-stack-check -march=mips32r2 -Wa,--trap -DTOOLCHAIN_SUPPORTS_VIRT -Iarch/mips/include/asm/mach-ath79 -Iarch/mips/include/asm/mach-generic -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=1024 -fstack-protector -Wimplicit-fallthrough -Wno-gnu -Wno-unused-but-set-variable -Wno-unused-const-variable -fno-stack-clash-protection -pg -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wextra -Wunused -Wno-unused-parameter -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wmissing-include-dirs -Wunused-but-set-variable -Wunused-const-variable -Wno-missing-field-initializers -Wno-sign-compare -Wno-type-limits -Wno-shift-negative-value -gsplit-dwarf -gdwarf-5 -I kernel/events -I ./kernel/events -ffunction-sections -fdata-sections -DKBUILD_MODFILE="kernel/events/callchain" -DKBUILD_BASENAME="callchain" -DKBUILD_MODNAME="callchain" -D__KBUILD_MODNAME=kmod_callchain -c -o kernel/events/callchain.o kernel/events/callchain.c
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module 'kernel/events/callchain.c'.
4. Running pass 'Mips Assembly Printer' on function '@get_callchain_buffers'
#0 0x000055dd1484ea7f Signals.cpp:0:0
#1 0x000055dd1484c8a4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x34f18a4)
#2 0x000055dd1478c087 llvm::CrashRecoveryContext::HandleExit(int) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3431087)
#3 0x000055dd14844ede llvm::sys::Process::Exit(int, bool) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x34e9ede)
#4 0x000055dd1241892b (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x10bd92b)
#5 0x000055dd14792bac llvm::report_fatal_error(llvm::Twine const&, bool) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3437bac)
#6 0x000055dd154c2260 llvm::AsmPrinter::emitInlineAsm(llvm::MachineInstr const (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x4167260)
#7 0x000055dd154be162 llvm::AsmPrinter::emitFunctionBody() (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x4163162)
#8 0x000055dd12e9ed07 llvm::MipsAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x1b43d07)
#9 0x000055dd13b7a47d llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.53) MachineFunctionPass.cpp:0:0
#10 0x000055dd13fc4457 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x2c69457)
#11 0x000055dd13fc45d1 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x2c695d1)
#12 0x000055dd13fc514f llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x2c6a14f)
#13 0x000055dd14b794c6 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x381e4c6)
#14 0x000055dd157e2ca3 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x4487ca3)
#15 0x000055dd16316a01 clang::ParseAST(clang::Sema&, bool, bool) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x4fbba01)
#16 0x000055dd157e2395 clang::CodeGenAction::ExecuteAction() (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x4487395)
#17 0x000055dd151d8831 clang::FrontendAction::Execute() (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3e7d831)
#18 0x000055dd1516db1a clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3e12b1a)
#19 0x000055dd1529f63b (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3f4463b)
#20 0x000055dd12419edc cc1_main(llvm::ArrayRef<char char (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x10beedc)
#21 0x000055dd12416bab ExecuteCC1Tool(llvm::SmallVectorImpl<char driver.cpp:0:0
#22 0x000055dd150003f5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const::'lambda'()>(long) Job.cpp:0:0
#23 0x000055dd1478bf43 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3430f43)
#24 0x000055dd15000cee clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> const (.part.216) Job.cpp:0:0
#25 0x000055dd14fd4de7 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3c79de7)
#26 0x000055dd14fd57c7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) const (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3c7a7c7)
#27 0x000055dd14fdee19 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command >&) (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x3c83e19)
#28 0x000055dd12363d2f main (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x1008d2f)
#29 0x00007f18176877fd __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x237fd)
#30 0x000055dd124166ca _start (/opt/cross/clang-6b7e6ea489/bin/clang-15+0x10bb6ca)
clang-15: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 15.0.0 (git://gitmirror/llvm_project 6b7e6ea489f6dd45a9b0da9ac20871560917b9b0)
Target: mips-unknown-linux
Thread model: posix
InstalledDir: /opt/cross/clang-6b7e6ea489/bin
clang-15: note: diagnostic msg:
Makefile arch include kernel nr_bisected scripts source usr

vim +/data_page_nr +119 kernel/events/internal.h

118
> 119 static int data_page_nr(struct perf_buffer *rb)
120 {
121 return rb->nr_pages << page_order(rb);
122 }
123

--
0-DAY CI Kernel Test Service