aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-11-07 10:30:18 +0100
committerIngo Molnar <mingo@kernel.org>2017-11-07 10:30:18 +0100
commit15bcdc9477b03eb035052412c3a087e11e855e76 (patch)
treee1e3c1f2b89e3a705d1737d61a4d8a9394a1930e /tools
parent340b5319c98eb14f7a70947a38e17d06f5beea88 (diff)
parente4880bc5dfb1f02b152e62a894b5c6f3e995b3cf (diff)
downloadlinux-befs-15bcdc9477b03eb035052412c3a087e11e855e76.tar.gz
Merge branch 'linus' into perf/core, to fix conflicts
Conflicts: tools/perf/arch/arm/annotate/instructions.c tools/perf/arch/arm64/annotate/instructions.c tools/perf/arch/powerpc/annotate/instructions.c tools/perf/arch/s390/annotate/instructions.c tools/perf/arch/x86/tests/intel-cqm.c tools/perf/ui/tui/progress.c tools/perf/util/zlib.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile1
-rw-r--r--tools/accounting/Makefile1
-rw-r--r--tools/accounting/getdelays.c1
-rw-r--r--tools/arch/alpha/include/asm/barrier.h1
-rw-r--r--tools/arch/alpha/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/alpha/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/arc/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/arm/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/arm/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/arm/include/uapi/asm/perf_regs.h1
-rw-r--r--tools/arch/arm64/include/asm/barrier.h1
-rw-r--r--tools/arch/arm64/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/arm64/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/arm64/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/arm64/include/uapi/asm/perf_regs.h1
-rw-r--r--tools/arch/frv/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/frv/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/h8300/include/asm/bitsperlong.h1
-rw-r--r--tools/arch/h8300/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/hexagon/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/hexagon/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/ia64/include/asm/barrier.h1
-rw-r--r--tools/arch/ia64/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/ia64/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/m32r/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/m32r/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/microblaze/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/microblaze/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/mips/include/asm/barrier.h1
-rw-r--r--tools/arch/mips/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/mips/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/mips/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/mn10300/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/parisc/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/parisc/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/powerpc/include/asm/barrier.h1
-rw-r--r--tools/arch/powerpc/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/powerpc/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/powerpc/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/powerpc/include/uapi/asm/perf_regs.h1
-rw-r--r--tools/arch/s390/include/asm/barrier.h1
-rw-r--r--tools/arch/s390/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/s390/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/s390/include/uapi/asm/kvm_perf.h1
-rw-r--r--tools/arch/s390/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/s390/include/uapi/asm/sie.h1
-rw-r--r--tools/arch/score/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/score/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/sh/include/asm/barrier.h1
-rw-r--r--tools/arch/sh/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/sparc/include/asm/barrier.h1
-rw-r--r--tools/arch/sparc/include/asm/barrier_32.h1
-rw-r--r--tools/arch/sparc/include/asm/barrier_64.h1
-rw-r--r--tools/arch/sparc/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/sparc/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/tile/include/asm/barrier.h1
-rw-r--r--tools/arch/tile/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/tile/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/x86/include/asm/atomic.h1
-rw-r--r--tools/arch/x86/include/asm/barrier.h1
-rw-r--r--tools/arch/x86/include/asm/cmpxchg.h1
-rw-r--r--tools/arch/x86/include/asm/cpufeatures.h1
-rw-r--r--tools/arch/x86/include/asm/rmwcc.h1
-rw-r--r--tools/arch/x86/include/asm/unistd_32.h1
-rw-r--r--tools/arch/x86/include/asm/unistd_64.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/bitsperlong.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/kvm.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/kvm_perf.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/mman.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/perf_regs.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/svm.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/unistd.h1
-rw-r--r--tools/arch/x86/include/uapi/asm/vmx.h1
-rw-r--r--tools/arch/x86/lib/memcpy_64.S4
-rw-r--r--tools/arch/x86/lib/memset_64.S1
-rw-r--r--tools/arch/xtensa/include/uapi/asm/mman.h1
-rw-r--r--tools/build/Makefile1
-rw-r--r--tools/build/Makefile.build1
-rw-r--r--tools/build/feature/Makefile1
-rw-r--r--tools/build/feature/test-all.c1
-rw-r--r--tools/build/feature/test-backtrace.c1
-rw-r--r--tools/build/feature/test-bionic.c1
-rw-r--r--tools/build/feature/test-bpf.c1
-rw-r--r--tools/build/feature/test-clang.cpp1
-rw-r--r--tools/build/feature/test-compile.c1
-rw-r--r--tools/build/feature/test-cplus-demangle.c1
-rw-r--r--tools/build/feature/test-cxx.cpp1
-rw-r--r--tools/build/feature/test-dwarf.c1
-rw-r--r--tools/build/feature/test-dwarf_getlocations.c1
-rw-r--r--tools/build/feature/test-get_cpuid.c1
-rw-r--r--tools/build/feature/test-glibc.c1
-rw-r--r--tools/build/feature/test-gtk2-infobar.c1
-rw-r--r--tools/build/feature/test-gtk2.c1
-rw-r--r--tools/build/feature/test-jvmti.c1
-rw-r--r--tools/build/feature/test-libaudit.c1
-rw-r--r--tools/build/feature/test-libbabeltrace.c1
-rw-r--r--tools/build/feature/test-libbfd.c1
-rw-r--r--tools/build/feature/test-libcrypto.c1
-rw-r--r--tools/build/feature/test-libdw-dwarf-unwind.c1
-rw-r--r--tools/build/feature/test-libelf-gelf_getnote.c1
-rw-r--r--tools/build/feature/test-libelf-getphdrnum.c1
-rw-r--r--tools/build/feature/test-libelf-getshdrstrndx.c1
-rw-r--r--tools/build/feature/test-libelf-mmap.c1
-rw-r--r--tools/build/feature/test-libelf.c1
-rw-r--r--tools/build/feature/test-libnuma.c1
-rw-r--r--tools/build/feature/test-libperl.c1
-rw-r--r--tools/build/feature/test-libpython-version.c1
-rw-r--r--tools/build/feature/test-libpython.c1
-rw-r--r--tools/build/feature/test-libslang.c1
-rw-r--r--tools/build/feature/test-libunwind-aarch64.c1
-rw-r--r--tools/build/feature/test-libunwind-arm.c1
-rw-r--r--tools/build/feature/test-libunwind-debug-frame-aarch64.c1
-rw-r--r--tools/build/feature/test-libunwind-debug-frame-arm.c1
-rw-r--r--tools/build/feature/test-libunwind-debug-frame.c1
-rw-r--r--tools/build/feature/test-libunwind-x86.c1
-rw-r--r--tools/build/feature/test-libunwind-x86_64.c1
-rw-r--r--tools/build/feature/test-libunwind.c1
-rw-r--r--tools/build/feature/test-llvm-version.cpp1
-rw-r--r--tools/build/feature/test-llvm.cpp1
-rw-r--r--tools/build/feature/test-lzma.c1
-rw-r--r--tools/build/feature/test-numa_num_possible_cpus.c1
-rw-r--r--tools/build/feature/test-pthread-attr-setaffinity-np.c1
-rw-r--r--tools/build/feature/test-sched_getcpu.c1
-rw-r--r--tools/build/feature/test-sdt.c1
-rw-r--r--tools/build/feature/test-stackprotector-all.c1
-rw-r--r--tools/build/feature/test-sync-compare-and-swap.c1
-rw-r--r--tools/build/feature/test-timerfd.c1
-rw-r--r--tools/build/feature/test-zlib.c1
-rw-r--r--tools/build/fixdep.c1
-rw-r--r--tools/build/tests/ex/Makefile1
-rw-r--r--tools/build/tests/ex/a.c1
-rw-r--r--tools/build/tests/ex/arch/e.c1
-rw-r--r--tools/build/tests/ex/arch/f.c1
-rw-r--r--tools/build/tests/ex/b.c1
-rw-r--r--tools/build/tests/ex/c.c1
-rw-r--r--tools/build/tests/ex/d.c1
-rw-r--r--tools/build/tests/ex/ex.c1
-rw-r--r--tools/build/tests/ex/inc.c1
-rwxr-xr-xtools/build/tests/run.sh1
-rw-r--r--tools/cgroup/Makefile1
-rw-r--r--tools/cgroup/cgroup_event_listener.c1
-rw-r--r--tools/firewire/Makefile1
-rw-r--r--tools/firewire/decode-fcp.c1
-rw-r--r--tools/firewire/list.h1
-rw-r--r--tools/firewire/nosy-dump.h1
-rw-r--r--tools/gpio/Makefile1
-rw-r--r--tools/hv/Makefile1
-rwxr-xr-xtools/hv/hv_get_dhcp_info.sh1
-rwxr-xr-xtools/hv/hv_set_ifconfig.sh1
-rw-r--r--tools/hv/lsvmbus1
-rw-r--r--tools/iio/Makefile1
-rw-r--r--tools/include/asm-generic/atomic-gcc.h1
-rw-r--r--tools/include/asm-generic/bitops.h1
-rw-r--r--tools/include/asm-generic/bitops/__ffs.h1
-rw-r--r--tools/include/asm-generic/bitops/__fls.h1
-rw-r--r--tools/include/asm-generic/bitops/arch_hweight.h1
-rw-r--r--tools/include/asm-generic/bitops/atomic.h1
-rw-r--r--tools/include/asm-generic/bitops/const_hweight.h1
-rw-r--r--tools/include/asm-generic/bitops/find.h1
-rw-r--r--tools/include/asm-generic/bitops/fls.h1
-rw-r--r--tools/include/asm-generic/bitops/fls64.h1
-rw-r--r--tools/include/asm-generic/bitops/hweight.h1
-rw-r--r--tools/include/asm-generic/bitsperlong.h1
-rw-r--r--tools/include/asm/alternative-asm.h1
-rw-r--r--tools/include/asm/atomic.h1
-rw-r--r--tools/include/asm/barrier.h1
-rw-r--r--tools/include/asm/bug.h1
-rw-r--r--tools/include/asm/export.h7
-rw-r--r--tools/include/linux/atomic.h1
-rw-r--r--tools/include/linux/bitmap.h1
-rw-r--r--tools/include/linux/bitops.h1
-rw-r--r--tools/include/linux/bug.h1
-rw-r--r--tools/include/linux/compiler-gcc.h1
-rw-r--r--tools/include/linux/compiler.h1
-rw-r--r--tools/include/linux/debug_locks.h1
-rw-r--r--tools/include/linux/err.h1
-rw-r--r--tools/include/linux/filter.h1
-rw-r--r--tools/include/linux/hardirq.h1
-rw-r--r--tools/include/linux/hashtable.h1
-rw-r--r--tools/include/linux/irqflags.h1
-rw-r--r--tools/include/linux/kallsyms.h1
-rw-r--r--tools/include/linux/kern_levels.h1
-rw-r--r--tools/include/linux/kernel.h1
-rw-r--r--tools/include/linux/kmemcheck.h1
-rw-r--r--tools/include/linux/list.h1
-rw-r--r--tools/include/linux/lockdep.h1
-rw-r--r--tools/include/linux/module.h1
-rw-r--r--tools/include/linux/poison.h1
-rw-r--r--tools/include/linux/rcu.h1
-rw-r--r--tools/include/linux/refcount.h1
-rw-r--r--tools/include/linux/spinlock.h1
-rw-r--r--tools/include/linux/stacktrace.h1
-rw-r--r--tools/include/linux/string.h1
-rw-r--r--tools/include/linux/stringify.h1
-rw-r--r--tools/include/linux/time64.h1
-rw-r--r--tools/include/linux/types.h1
-rw-r--r--tools/include/linux/unaligned/packed_struct.h1
-rw-r--r--tools/include/tools/be_byteshift.h1
-rw-r--r--tools/include/tools/endian.h1
-rw-r--r--tools/include/tools/le_byteshift.h1
-rw-r--r--tools/include/uapi/asm-generic/ioctls.h1
-rw-r--r--tools/include/uapi/asm-generic/mman-common.h1
-rw-r--r--tools/include/uapi/asm-generic/mman.h3
-rw-r--r--tools/include/uapi/linux/bpf.h11
-rw-r--r--tools/include/uapi/linux/bpf_common.h1
-rw-r--r--tools/include/uapi/linux/fcntl.h1
-rw-r--r--tools/include/uapi/linux/hw_breakpoint.h1
-rw-r--r--tools/include/uapi/linux/kvm.h1
-rw-r--r--tools/include/uapi/linux/mman.h1
-rw-r--r--tools/include/uapi/linux/perf_event.h1
-rw-r--r--tools/include/uapi/linux/sched.h1
-rw-r--r--tools/include/uapi/linux/stat.h1
-rw-r--r--tools/include/uapi/linux/vhost.h1
-rw-r--r--tools/include/uapi/sound/asound.h1
-rw-r--r--tools/kvm/kvm_stat/Makefile1
-rw-r--r--tools/laptop/dslm/Makefile1
-rw-r--r--tools/laptop/freefall/Makefile1
-rw-r--r--tools/leds/Makefile1
-rw-r--r--tools/leds/led_hw_brightness_mon.c1
-rw-r--r--tools/leds/uledmon.c1
-rw-r--r--tools/lib/api/Makefile1
-rw-r--r--tools/lib/api/cpu.c1
-rw-r--r--tools/lib/api/cpu.h1
-rw-r--r--tools/lib/api/debug-internal.h1
-rw-r--r--tools/lib/api/debug.c1
-rw-r--r--tools/lib/api/debug.h1
-rw-r--r--tools/lib/api/fd/array.h1
-rw-r--r--tools/lib/api/fs/fs.c1
-rw-r--r--tools/lib/api/fs/fs.h1
-rw-r--r--tools/lib/api/fs/tracing_path.c1
-rw-r--r--tools/lib/api/fs/tracing_path.h1
-rw-r--r--tools/lib/bpf/Makefile1
-rw-r--r--tools/lib/hweight.c1
-rw-r--r--tools/lib/lockdep/Makefile1
-rw-r--r--tools/lib/lockdep/common.c1
-rw-r--r--tools/lib/lockdep/include/liblockdep/common.h1
-rw-r--r--tools/lib/lockdep/include/liblockdep/mutex.h1
-rw-r--r--tools/lib/lockdep/include/liblockdep/rwlock.h1
-rw-r--r--tools/lib/lockdep/lockdep.c1
-rw-r--r--tools/lib/lockdep/preload.c1
-rwxr-xr-xtools/lib/lockdep/run_tests.sh1
-rw-r--r--tools/lib/lockdep/tests/AA.c1
-rw-r--r--tools/lib/lockdep/tests/ABA.c1
-rw-r--r--tools/lib/lockdep/tests/ABBA.c1
-rw-r--r--tools/lib/lockdep/tests/ABBA_2threads.c1
-rw-r--r--tools/lib/lockdep/tests/ABBCCA.c1
-rw-r--r--tools/lib/lockdep/tests/ABBCCDDA.c1
-rw-r--r--tools/lib/lockdep/tests/ABCABC.c1
-rw-r--r--tools/lib/lockdep/tests/ABCDBCDA.c1
-rw-r--r--tools/lib/lockdep/tests/ABCDBDDA.c1
-rw-r--r--tools/lib/lockdep/tests/WW.c1
-rw-r--r--tools/lib/lockdep/tests/common.h1
-rw-r--r--tools/lib/lockdep/tests/unlock_balance.c1
-rw-r--r--tools/lib/str_error_r.c1
-rw-r--r--tools/lib/string.c1
-rw-r--r--tools/lib/subcmd/Makefile1
-rw-r--r--tools/lib/subcmd/exec-cmd.c1
-rw-r--r--tools/lib/subcmd/exec-cmd.h1
-rw-r--r--tools/lib/subcmd/help.c1
-rw-r--r--tools/lib/subcmd/help.h1
-rw-r--r--tools/lib/subcmd/pager.c1
-rw-r--r--tools/lib/subcmd/pager.h1
-rw-r--r--tools/lib/subcmd/parse-options.c1
-rw-r--r--tools/lib/subcmd/parse-options.h1
-rw-r--r--tools/lib/subcmd/run-command.c1
-rw-r--r--tools/lib/subcmd/run-command.h1
-rw-r--r--tools/lib/subcmd/sigchain.c1
-rw-r--r--tools/lib/subcmd/sigchain.h1
-rw-r--r--tools/lib/subcmd/subcmd-config.c1
-rw-r--r--tools/lib/subcmd/subcmd-config.h1
-rw-r--r--tools/lib/subcmd/subcmd-util.h1
-rw-r--r--tools/lib/symbol/kallsyms.c1
-rw-r--r--tools/lib/symbol/kallsyms.h1
-rw-r--r--tools/lib/traceevent/Makefile1
-rw-r--r--tools/lib/traceevent/plugin_cfg80211.c1
-rw-r--r--tools/lib/traceevent/plugin_scsi.c1
-rw-r--r--tools/lib/traceevent/plugin_xen.c1
-rw-r--r--tools/lib/vsprintf.c1
-rw-r--r--tools/net/Makefile1
-rwxr-xr-xtools/nfsd/inject_fault.sh1
-rw-r--r--tools/objtool/Makefile1
-rw-r--r--tools/objtool/arch/x86/insn/gen-insn-attr-x86.awk1
-rw-r--r--tools/pci/pcitest.sh1
-rw-r--r--tools/pcmcia/Makefile1
-rw-r--r--tools/perf/Makefile1
-rw-r--r--tools/perf/arch/arm/annotate/instructions.c1
-rw-r--r--tools/perf/arch/arm/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/arm/include/perf_regs.h1
-rw-r--r--tools/perf/arch/arm/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/arch/arm/tests/regs_load.S1
-rw-r--r--tools/perf/arch/arm/util/unwind-libdw.c1
-rw-r--r--tools/perf/arch/arm/util/unwind-libunwind.c1
-rw-r--r--tools/perf/arch/arm64/Makefile1
-rw-r--r--tools/perf/arch/arm64/annotate/instructions.c1
-rw-r--r--tools/perf/arch/arm64/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/arm64/include/perf_regs.h1
-rw-r--r--tools/perf/arch/arm64/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/arch/arm64/tests/regs_load.S1
-rw-r--r--tools/perf/arch/arm64/util/unwind-libunwind.c1
-rw-r--r--tools/perf/arch/common.c1
-rw-r--r--tools/perf/arch/common.h1
-rw-r--r--tools/perf/arch/powerpc/Makefile1
-rw-r--r--tools/perf/arch/powerpc/annotate/instructions.c1
-rw-r--r--tools/perf/arch/powerpc/include/arch-tests.h1
-rw-r--r--tools/perf/arch/powerpc/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/powerpc/include/perf_regs.h1
-rw-r--r--tools/perf/arch/powerpc/tests/arch-tests.c1
-rw-r--r--tools/perf/arch/powerpc/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/arch/powerpc/tests/regs_load.S1
-rw-r--r--tools/perf/arch/powerpc/util/book3s_hcalls.h1
-rw-r--r--tools/perf/arch/powerpc/util/book3s_hv_exits.h1
-rw-r--r--tools/perf/arch/powerpc/util/header.c1
-rw-r--r--tools/perf/arch/powerpc/util/kvm-stat.c1
-rw-r--r--tools/perf/arch/powerpc/util/perf_regs.c1
-rw-r--r--tools/perf/arch/powerpc/util/unwind-libdw.c1
-rw-r--r--tools/perf/arch/s390/annotate/instructions.c1
-rw-r--r--tools/perf/arch/s390/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/s390/util/dwarf-regs.c1
-rw-r--r--tools/perf/arch/s390/util/machine.c1
-rw-r--r--tools/perf/arch/sh/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/sparc/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/x86/Makefile1
-rw-r--r--tools/perf/arch/x86/annotate/instructions.c1
-rwxr-xr-xtools/perf/arch/x86/entry/syscalls/syscalltbl.sh1
-rw-r--r--tools/perf/arch/x86/include/arch-tests.h1
-rw-r--r--tools/perf/arch/x86/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/arch/x86/include/perf_regs.h1
-rw-r--r--tools/perf/arch/x86/tests/arch-tests.c1
-rw-r--r--tools/perf/arch/x86/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/arch/x86/tests/insn-x86-dat-32.c1
-rw-r--r--tools/perf/arch/x86/tests/insn-x86-dat-64.c1
-rw-r--r--tools/perf/arch/x86/tests/insn-x86-dat-src.c1
-rw-r--r--tools/perf/arch/x86/tests/insn-x86.c1
-rw-r--r--tools/perf/arch/x86/tests/intel-cqm.c128
-rw-r--r--tools/perf/arch/x86/tests/perf-time-to-tsc.c1
-rw-r--r--tools/perf/arch/x86/tests/rdpmc.c1
-rw-r--r--tools/perf/arch/x86/tests/regs_load.S1
-rw-r--r--tools/perf/arch/x86/util/group.c1
-rw-r--r--tools/perf/arch/x86/util/header.c1
-rw-r--r--tools/perf/arch/x86/util/kvm-stat.c1
-rw-r--r--tools/perf/arch/x86/util/perf_regs.c1
-rw-r--r--tools/perf/arch/x86/util/pmu.c1
-rw-r--r--tools/perf/arch/x86/util/tsc.c1
-rw-r--r--tools/perf/arch/x86/util/unwind-libdw.c1
-rw-r--r--tools/perf/arch/x86/util/unwind-libunwind.c1
-rw-r--r--tools/perf/arch/xtensa/include/dwarf-regs-table.h1
-rw-r--r--tools/perf/bench/bench.h1
-rw-r--r--tools/perf/bench/futex-hash.c1
-rw-r--r--tools/perf/bench/futex-lock-pi.c1
-rw-r--r--tools/perf/bench/futex-requeue.c1
-rw-r--r--tools/perf/bench/futex-wake-parallel.c1
-rw-r--r--tools/perf/bench/futex-wake.c1
-rw-r--r--tools/perf/bench/futex.h1
-rw-r--r--tools/perf/bench/mem-functions.c1
-rw-r--r--tools/perf/bench/mem-memcpy-arch.h1
-rw-r--r--tools/perf/bench/mem-memcpy-x86-64-asm-def.h1
-rw-r--r--tools/perf/bench/mem-memcpy-x86-64-asm.S1
-rw-r--r--tools/perf/bench/mem-memset-arch.h1
-rw-r--r--tools/perf/bench/mem-memset-x86-64-asm-def.h1
-rw-r--r--tools/perf/bench/mem-memset-x86-64-asm.S1
-rw-r--r--tools/perf/bench/numa.c1
-rw-r--r--tools/perf/bench/sched-messaging.c1
-rw-r--r--tools/perf/bench/sched-pipe.c1
-rw-r--r--tools/perf/builtin-annotate.c1
-rw-r--r--tools/perf/builtin-bench.c1
-rw-r--r--tools/perf/builtin-buildid-cache.c1
-rw-r--r--tools/perf/builtin-buildid-list.c1
-rw-r--r--tools/perf/builtin-c2c.c1
-rw-r--r--tools/perf/builtin-config.c1
-rw-r--r--tools/perf/builtin-data.c1
-rw-r--r--tools/perf/builtin-diff.c1
-rw-r--r--tools/perf/builtin-evlist.c1
-rw-r--r--tools/perf/builtin-help.c1
-rw-r--r--tools/perf/builtin-inject.c1
-rw-r--r--tools/perf/builtin-kmem.c1
-rw-r--r--tools/perf/builtin-kvm.c1
-rw-r--r--tools/perf/builtin-list.c1
-rw-r--r--tools/perf/builtin-lock.c1
-rw-r--r--tools/perf/builtin-mem.c1
-rw-r--r--tools/perf/builtin-record.c1
-rw-r--r--tools/perf/builtin-report.c1
-rw-r--r--tools/perf/builtin-sched.c1
-rw-r--r--tools/perf/builtin-script.c1
-rw-r--r--tools/perf/builtin-version.c1
-rw-r--r--tools/perf/builtin.h1
-rwxr-xr-xtools/perf/check-headers.sh1
-rw-r--r--tools/perf/jvmti/jvmti_agent.h1
-rw-r--r--tools/perf/jvmti/libjvmti.c1
-rw-r--r--tools/perf/perf-archive.sh1
-rw-r--r--tools/perf/perf-completion.sh1
-rw-r--r--tools/perf/perf-read-vdso.c1
-rw-r--r--tools/perf/perf-sys.h1
-rw-r--r--tools/perf/perf.c1
-rw-r--r--tools/perf/perf.h1
-rw-r--r--tools/perf/pmu-events/jevents.h1
-rw-r--r--tools/perf/pmu-events/jsmn.h1
-rw-r--r--tools/perf/pmu-events/json.h1
-rw-r--r--tools/perf/pmu-events/pmu-events.h1
-rwxr-xr-xtools/perf/python/tracepoint.py1
-rw-r--r--tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL1
-rwxr-xr-xtools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py1
-rw-r--r--tools/perf/scripts/python/event_analyzing_sample.py1
-rwxr-xr-xtools/perf/scripts/python/net_dropmonitor.py1
-rw-r--r--tools/perf/scripts/python/netdev-times.py1
-rwxr-xr-xtools/perf/scripts/python/stackcollapse.py1
-rw-r--r--tools/perf/scripts/python/stat-cpi.py1
-rw-r--r--tools/perf/tests/attr.c1
-rw-r--r--tools/perf/tests/attr.py1
-rw-r--r--tools/perf/tests/backward-ring-buffer.c1
-rw-r--r--tools/perf/tests/bitmap.c1
-rw-r--r--tools/perf/tests/bp_signal.c1
-rw-r--r--tools/perf/tests/bp_signal_overflow.c1
-rw-r--r--tools/perf/tests/builtin-test.c1
-rw-r--r--tools/perf/tests/clang.c1
-rw-r--r--tools/perf/tests/code-reading.c1
-rw-r--r--tools/perf/tests/cpumap.c1
-rw-r--r--tools/perf/tests/dso-data.c1
-rw-r--r--tools/perf/tests/dwarf-unwind.c1
-rw-r--r--tools/perf/tests/event-times.c1
-rw-r--r--tools/perf/tests/event_update.c1
-rw-r--r--tools/perf/tests/evsel-roundtrip-name.c1
-rw-r--r--tools/perf/tests/evsel-tp-sched.c1
-rw-r--r--tools/perf/tests/expr.c1
-rw-r--r--tools/perf/tests/fdarray.c1
-rw-r--r--tools/perf/tests/hists_common.c1
-rw-r--r--tools/perf/tests/hists_common.h1
-rw-r--r--tools/perf/tests/hists_cumulate.c1
-rw-r--r--tools/perf/tests/hists_filter.c1
-rw-r--r--tools/perf/tests/hists_link.c1
-rw-r--r--tools/perf/tests/hists_output.c1
-rw-r--r--tools/perf/tests/is_printable_array.c1
-rw-r--r--tools/perf/tests/keep-tracking.c1
-rw-r--r--tools/perf/tests/kmod-path.c1
-rw-r--r--tools/perf/tests/llvm.c1
-rw-r--r--tools/perf/tests/llvm.h1
-rw-r--r--tools/perf/tests/mmap-basic.c1
-rw-r--r--tools/perf/tests/mmap-thread-lookup.c1
-rw-r--r--tools/perf/tests/openat-syscall-all-cpus.c1
-rw-r--r--tools/perf/tests/openat-syscall-tp-fields.c1
-rw-r--r--tools/perf/tests/openat-syscall.c1
-rw-r--r--tools/perf/tests/parse-events.c1
-rw-r--r--tools/perf/tests/parse-no-sample-id-all.c1
-rw-r--r--tools/perf/tests/perf-hooks.c1
-rw-r--r--tools/perf/tests/perf-record.c1
-rwxr-xr-xtools/perf/tests/perf-targz-src-pkg1
-rw-r--r--tools/perf/tests/pmu.c1
-rw-r--r--tools/perf/tests/python-use.c1
-rw-r--r--tools/perf/tests/sample-parsing.c1
-rw-r--r--tools/perf/tests/sdt.c1
-rw-r--r--tools/perf/tests/stat.c1
-rw-r--r--tools/perf/tests/sw-clock.c1
-rw-r--r--tools/perf/tests/switch-tracking.c1
-rw-r--r--tools/perf/tests/task-exit.c1
-rw-r--r--tools/perf/tests/tests.h1
-rw-r--r--tools/perf/tests/thread-map.c1
-rw-r--r--tools/perf/tests/thread-mg-share.c1
-rw-r--r--tools/perf/tests/topology.c1
-rw-r--r--tools/perf/tests/unit_number__scnprintf.c1
-rw-r--r--tools/perf/tests/vmlinux-kallsyms.c1
-rw-r--r--tools/perf/trace/beauty/beauty.h1
-rw-r--r--tools/perf/trace/beauty/eventfd.c1
-rw-r--r--tools/perf/trace/beauty/flock.c1
-rw-r--r--tools/perf/trace/beauty/futex_op.c1
-rw-r--r--tools/perf/trace/beauty/mmap.c1
-rw-r--r--tools/perf/trace/beauty/mode_t.c1
-rw-r--r--tools/perf/trace/beauty/msg_flags.c1
-rw-r--r--tools/perf/trace/beauty/open_flags.c1
-rw-r--r--tools/perf/trace/beauty/perf_event_open.c1
-rw-r--r--tools/perf/trace/beauty/pid.c1
-rw-r--r--tools/perf/trace/beauty/sched_policy.c1
-rw-r--r--tools/perf/trace/beauty/seccomp.c1
-rw-r--r--tools/perf/trace/beauty/signum.c1
-rw-r--r--tools/perf/trace/beauty/socket_type.c1
-rw-r--r--tools/perf/trace/beauty/waitid_options.c1
-rw-r--r--tools/perf/ui/browser.c1
-rw-r--r--tools/perf/ui/browser.h1
-rw-r--r--tools/perf/ui/browsers/annotate.c1
-rw-r--r--tools/perf/ui/browsers/header.c1
-rw-r--r--tools/perf/ui/browsers/hists.c1
-rw-r--r--tools/perf/ui/browsers/hists.h1
-rw-r--r--tools/perf/ui/browsers/map.c1
-rw-r--r--tools/perf/ui/browsers/map.h1
-rw-r--r--tools/perf/ui/browsers/scripts.c1
-rw-r--r--tools/perf/ui/gtk/annotate.c1
-rw-r--r--tools/perf/ui/gtk/browser.c1
-rw-r--r--tools/perf/ui/gtk/gtk.h1
-rw-r--r--tools/perf/ui/gtk/helpline.c1
-rw-r--r--tools/perf/ui/gtk/hists.c1
-rw-r--r--tools/perf/ui/gtk/progress.c1
-rw-r--r--tools/perf/ui/gtk/setup.c1
-rw-r--r--tools/perf/ui/gtk/util.c1
-rw-r--r--tools/perf/ui/helpline.c1
-rw-r--r--tools/perf/ui/helpline.h1
-rw-r--r--tools/perf/ui/hist.c1
-rw-r--r--tools/perf/ui/keysyms.h1
-rw-r--r--tools/perf/ui/libslang.h1
-rw-r--r--tools/perf/ui/progress.c1
-rw-r--r--tools/perf/ui/progress.h1
-rw-r--r--tools/perf/ui/setup.c1
-rw-r--r--tools/perf/ui/stdio/hist.c1
-rw-r--r--tools/perf/ui/tui/helpline.c1
-rw-r--r--tools/perf/ui/tui/progress.c1
-rw-r--r--tools/perf/ui/tui/setup.c1
-rw-r--r--tools/perf/ui/tui/tui.h1
-rw-r--r--tools/perf/ui/tui/util.c1
-rw-r--r--tools/perf/ui/ui.h1
-rw-r--r--tools/perf/ui/util.c1
-rw-r--r--tools/perf/ui/util.h1
-rwxr-xr-xtools/perf/util/PERF-VERSION-GEN1
-rw-r--r--tools/perf/util/annotate.c12
-rw-r--r--tools/perf/util/annotate.h1
-rw-r--r--tools/perf/util/block-range.c1
-rw-r--r--tools/perf/util/block-range.h1
-rw-r--r--tools/perf/util/bpf-loader.c1
-rw-r--r--tools/perf/util/bpf-loader.h1
-rw-r--r--tools/perf/util/bpf-prologue.c1
-rw-r--r--tools/perf/util/bpf-prologue.h1
-rw-r--r--tools/perf/util/build-id.c1
-rw-r--r--tools/perf/util/build-id.h1
-rw-r--r--tools/perf/util/c++/clang-c.h1
-rw-r--r--tools/perf/util/c++/clang-test.cpp1
-rw-r--r--tools/perf/util/c++/clang.cpp1
-rw-r--r--tools/perf/util/c++/clang.h1
-rw-r--r--tools/perf/util/cache.h1
-rw-r--r--tools/perf/util/callchain.c1
-rw-r--r--tools/perf/util/callchain.h1
-rw-r--r--tools/perf/util/cgroup.c1
-rw-r--r--tools/perf/util/cgroup.h1
-rw-r--r--tools/perf/util/cloexec.c1
-rw-r--r--tools/perf/util/cloexec.h1
-rw-r--r--tools/perf/util/color.c1
-rw-r--r--tools/perf/util/color.h1
-rw-r--r--tools/perf/util/comm.c1
-rw-r--r--tools/perf/util/comm.h1
-rw-r--r--tools/perf/util/compress.h1
-rw-r--r--tools/perf/util/config.c1
-rw-r--r--tools/perf/util/config.h1
-rw-r--r--tools/perf/util/counts.c1
-rw-r--r--tools/perf/util/counts.h1
-rw-r--r--tools/perf/util/cpumap.c1
-rw-r--r--tools/perf/util/cpumap.h1
-rw-r--r--tools/perf/util/ctype.c1
-rw-r--r--tools/perf/util/data-convert-bt.h1
-rw-r--r--tools/perf/util/data-convert.h1
-rw-r--r--tools/perf/util/data.c1
-rw-r--r--tools/perf/util/data.h1
-rw-r--r--tools/perf/util/debug.c1
-rw-r--r--tools/perf/util/debug.h1
-rw-r--r--tools/perf/util/demangle-java.c1
-rw-r--r--tools/perf/util/demangle-java.h1
-rw-r--r--tools/perf/util/demangle-rust.c1
-rw-r--r--tools/perf/util/demangle-rust.h1
-rw-r--r--tools/perf/util/dso.c1
-rw-r--r--tools/perf/util/dso.h1
-rw-r--r--tools/perf/util/dump-insn.c1
-rw-r--r--tools/perf/util/dump-insn.h1
-rw-r--r--tools/perf/util/dwarf-regs.c1
-rw-r--r--tools/perf/util/env.c1
-rw-r--r--tools/perf/util/env.h1
-rw-r--r--tools/perf/util/event.c1
-rw-r--r--tools/perf/util/event.h1
-rw-r--r--tools/perf/util/evlist.h1
-rw-r--r--tools/perf/util/evsel.h1
-rw-r--r--tools/perf/util/evsel_fprintf.c1
-rw-r--r--tools/perf/util/expr.h1
-rw-r--r--tools/perf/util/find-vdso-map.c1
-rw-r--r--tools/perf/util/genelf.h1
-rwxr-xr-xtools/perf/util/generate-cmdlist.sh1
-rw-r--r--tools/perf/util/group.h1
-rw-r--r--tools/perf/util/header.c1
-rw-r--r--tools/perf/util/header.h1
-rw-r--r--tools/perf/util/help-unknown-cmd.c1
-rw-r--r--tools/perf/util/hist.c1
-rw-r--r--tools/perf/util/hist.h1
-rw-r--r--tools/perf/util/include/asm/asm-offsets.h1
-rw-r--r--tools/perf/util/include/asm/cpufeature.h1
-rw-r--r--tools/perf/util/include/asm/dwarf2.h1
-rw-r--r--tools/perf/util/include/asm/uaccess.h1
-rw-r--r--tools/perf/util/include/dwarf-regs.h1
-rw-r--r--tools/perf/util/include/linux/linkage.h1
-rw-r--r--tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk1
-rw-r--r--tools/perf/util/intlist.h1
-rw-r--r--tools/perf/util/jit.h1
-rw-r--r--tools/perf/util/jitdump.c1
-rw-r--r--tools/perf/util/kvm-stat.h1
-rw-r--r--tools/perf/util/levenshtein.c1
-rw-r--r--tools/perf/util/levenshtein.h1
-rw-r--r--tools/perf/util/libunwind/arm64.c1
-rw-r--r--tools/perf/util/libunwind/x86_32.c1
-rw-r--r--tools/perf/util/llvm-utils.c1
-rw-r--r--tools/perf/util/llvm-utils.h1
-rw-r--r--tools/perf/util/lzma.c1
-rw-r--r--tools/perf/util/machine.c1
-rw-r--r--tools/perf/util/machine.h1
-rw-r--r--tools/perf/util/map.c1
-rw-r--r--tools/perf/util/map.h1
-rw-r--r--tools/perf/util/mem-events.c1
-rw-r--r--tools/perf/util/mem-events.h1
-rw-r--r--tools/perf/util/memswap.c1
-rw-r--r--tools/perf/util/memswap.h1
-rw-r--r--tools/perf/util/ordered-events.c1
-rw-r--r--tools/perf/util/ordered-events.h1
-rw-r--r--tools/perf/util/parse-branch-options.c1
-rw-r--r--tools/perf/util/parse-branch-options.h1
-rw-r--r--tools/perf/util/parse-events.c1
-rw-r--r--tools/perf/util/parse-events.h1
-rw-r--r--tools/perf/util/parse-events.l8
-rw-r--r--tools/perf/util/parse-regs-options.c1
-rw-r--r--tools/perf/util/parse-regs-options.h1
-rw-r--r--tools/perf/util/path.c1
-rw-r--r--tools/perf/util/path.h1
-rw-r--r--tools/perf/util/perf-hooks.c1
-rw-r--r--tools/perf/util/perf-hooks.h1
-rw-r--r--tools/perf/util/perf_regs.c1
-rw-r--r--tools/perf/util/perf_regs.h1
-rw-r--r--tools/perf/util/pmu.c1
-rw-r--r--tools/perf/util/pmu.h1
-rw-r--r--tools/perf/util/print_binary.c1
-rw-r--r--tools/perf/util/print_binary.h1
-rw-r--r--tools/perf/util/probe-event.h1
-rw-r--r--tools/perf/util/probe-file.h1
-rw-r--r--tools/perf/util/probe-finder.h1
-rw-r--r--tools/perf/util/pstack.c1
-rw-r--r--tools/perf/util/pstack.h1
-rw-r--r--tools/perf/util/python.c1
-rw-r--r--tools/perf/util/quote.c1
-rw-r--r--tools/perf/util/quote.h1
-rw-r--r--tools/perf/util/rb_resort.h1
-rw-r--r--tools/perf/util/rblist.h1
-rw-r--r--tools/perf/util/record.c1
-rw-r--r--tools/perf/util/sane_ctype.h1
-rw-r--r--tools/perf/util/session.c1
-rw-r--r--tools/perf/util/session.h1
-rw-r--r--tools/perf/util/sort.c1
-rw-r--r--tools/perf/util/sort.h1
-rw-r--r--tools/perf/util/srcline.c1
-rw-r--r--tools/perf/util/srcline.h1
-rw-r--r--tools/perf/util/stat-shadow.c1
-rw-r--r--tools/perf/util/stat.c1
-rw-r--r--tools/perf/util/stat.h1
-rw-r--r--tools/perf/util/strbuf.c1
-rw-r--r--tools/perf/util/strbuf.h1
-rw-r--r--tools/perf/util/strfilter.c1
-rw-r--r--tools/perf/util/strfilter.h1
-rw-r--r--tools/perf/util/string.c1
-rw-r--r--tools/perf/util/string2.h1
-rw-r--r--tools/perf/util/strlist.h1
-rw-r--r--tools/perf/util/svghelper.h1
-rw-r--r--tools/perf/util/symbol-elf.c1
-rw-r--r--tools/perf/util/symbol-minimal.c1
-rw-r--r--tools/perf/util/symbol.c1
-rw-r--r--tools/perf/util/symbol.h1
-rw-r--r--tools/perf/util/symbol_fprintf.c1
-rw-r--r--tools/perf/util/syscalltbl.h1
-rw-r--r--tools/perf/util/target.h1
-rw-r--r--tools/perf/util/term.c1
-rw-r--r--tools/perf/util/term.h1
-rw-r--r--tools/perf/util/thread.c1
-rw-r--r--tools/perf/util/thread.h1
-rw-r--r--tools/perf/util/thread_map.c1
-rw-r--r--tools/perf/util/thread_map.h1
-rw-r--r--tools/perf/util/time-utils.c1
-rw-r--r--tools/perf/util/time-utils.h1
-rw-r--r--tools/perf/util/tool.h1
-rw-r--r--tools/perf/util/top.h1
-rw-r--r--tools/perf/util/trace-event.c1
-rw-r--r--tools/perf/util/trace-event.h1
-rw-r--r--tools/perf/util/trigger.h1
-rw-r--r--tools/perf/util/tsc.c1
-rw-r--r--tools/perf/util/tsc.h1
-rw-r--r--tools/perf/util/units.c1
-rw-r--r--tools/perf/util/units.h1
-rw-r--r--tools/perf/util/unwind-libdw.c1
-rw-r--r--tools/perf/util/unwind-libdw.h1
-rw-r--r--tools/perf/util/unwind-libunwind-local.c1
-rw-r--r--tools/perf/util/unwind-libunwind.c1
-rw-r--r--tools/perf/util/unwind.h1
-rw-r--r--tools/perf/util/usage.c1
-rw-r--r--tools/perf/util/util-cxx.h1
-rw-r--r--tools/perf/util/util.c1
-rw-r--r--tools/perf/util/util.h1
-rw-r--r--tools/perf/util/values.c1
-rw-r--r--tools/perf/util/values.h1
-rw-r--r--tools/perf/util/vdso.c1
-rw-r--r--tools/perf/util/vdso.h1
-rw-r--r--tools/perf/util/xyarray.c1
-rw-r--r--tools/perf/util/xyarray.h1
-rw-r--r--tools/perf/util/zlib.c1
-rw-r--r--tools/power/cpupower/Makefile2
-rw-r--r--tools/power/cpupower/bench/Makefile1
-rw-r--r--tools/power/cpupower/debug/i386/Makefile1
-rw-r--r--tools/power/cpupower/debug/kernel/Makefile1
-rw-r--r--tools/power/cpupower/debug/x86_64/Makefile1
-rw-r--r--tools/power/cpupower/lib/cpuidle.h1
-rw-r--r--tools/power/cpupower/lib/cpupower.h1
-rw-r--r--tools/power/cpupower/lib/cpupower_intern.h1
-rw-r--r--tools/power/cpupower/utils/builtin.h1
-rw-r--r--tools/power/cpupower/utils/cpuidle-set.c1
-rw-r--r--tools/power/cpupower/utils/helpers/amd.c1
-rw-r--r--tools/power/cpupower/utils/helpers/bitmask.c1
-rw-r--r--tools/power/cpupower/utils/helpers/bitmask.h1
-rw-r--r--tools/power/cpupower/utils/helpers/cpuid.c1
-rw-r--r--tools/power/cpupower/utils/helpers/misc.c1
-rw-r--r--tools/power/cpupower/utils/helpers/msr.c1
-rw-r--r--tools/power/cpupower/utils/helpers/pci.c1
-rw-r--r--tools/power/cpupower/utils/helpers/sysfs.h1
-rwxr-xr-xtools/power/cpupower/utils/version-gen.sh1
-rw-r--r--tools/power/pm-graph/Makefile1
-rw-r--r--tools/power/x86/turbostat/Makefile1
-rw-r--r--tools/power/x86/x86_energy_perf_policy/Makefile1
-rw-r--r--tools/scripts/Makefile.arch1
-rw-r--r--tools/scripts/Makefile.include7
-rw-r--r--tools/spi/spidev_fdx.c1
-rw-r--r--tools/testing/fault-injection/failcmd.sh1
-rwxr-xr-xtools/testing/ktest/compare-ktest-sample.pl1
-rw-r--r--tools/testing/nvdimm/Kbuild1
-rw-r--r--tools/testing/nvdimm/Makefile1
-rw-r--r--tools/testing/nvdimm/config_check.c1
-rw-r--r--tools/testing/nvdimm/test/Kbuild1
-rw-r--r--tools/testing/radix-tree/Makefile1
-rw-r--r--tools/testing/radix-tree/linux.c1
-rw-r--r--tools/testing/radix-tree/linux/gfp.h1
-rw-r--r--tools/testing/radix-tree/linux/kernel.h1
-rw-r--r--tools/testing/radix-tree/linux/percpu.h1
-rw-r--r--tools/testing/radix-tree/linux/preempt.h1
-rw-r--r--tools/testing/radix-tree/linux/radix-tree.h1
-rw-r--r--tools/testing/radix-tree/linux/rcupdate.h1
-rw-r--r--tools/testing/radix-tree/linux/slab.h1
-rw-r--r--tools/testing/radix-tree/main.c1
-rw-r--r--tools/testing/radix-tree/regression.h1
-rw-r--r--tools/testing/radix-tree/regression1.c1
-rw-r--r--tools/testing/radix-tree/regression2.c1
-rw-r--r--tools/testing/radix-tree/regression3.c1
-rw-r--r--tools/testing/radix-tree/tag_check.c1
-rw-r--r--tools/testing/radix-tree/test.c1
-rw-r--r--tools/testing/radix-tree/test.h1
-rw-r--r--tools/testing/selftests/Makefile1
-rw-r--r--tools/testing/selftests/bpf/Makefile1
-rw-r--r--tools/testing/selftests/bpf/bpf_endian.h1
-rw-r--r--tools/testing/selftests/bpf/bpf_helpers.h1
-rw-r--r--tools/testing/selftests/bpf/bpf_util.h1
-rw-r--r--tools/testing/selftests/bpf/include/uapi/linux/types.h1
-rwxr-xr-xtools/testing/selftests/bpf/test_kmod.sh1
-rw-r--r--tools/testing/selftests/bpf/test_lpm_map.c1
-rw-r--r--tools/testing/selftests/bpf/test_tag.c1
-rw-r--r--tools/testing/selftests/breakpoints/Makefile1
-rw-r--r--tools/testing/selftests/capabilities/Makefile1
-rw-r--r--tools/testing/selftests/capabilities/test_execve.c1
-rw-r--r--tools/testing/selftests/capabilities/validate_cap.c1
-rw-r--r--tools/testing/selftests/cpu-hotplug/Makefile1
-rwxr-xr-xtools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh1
-rw-r--r--tools/testing/selftests/cpufreq/Makefile1
-rwxr-xr-xtools/testing/selftests/cpufreq/cpu.sh1
-rwxr-xr-xtools/testing/selftests/cpufreq/cpufreq.sh1
-rwxr-xr-xtools/testing/selftests/cpufreq/governor.sh1
-rwxr-xr-xtools/testing/selftests/cpufreq/main.sh1
-rwxr-xr-xtools/testing/selftests/cpufreq/module.sh1
-rwxr-xr-xtools/testing/selftests/cpufreq/special-tests.sh1
-rwxr-xr-xtools/testing/selftests/drivers/gpu/drm_mm.sh1
-rwxr-xr-xtools/testing/selftests/drivers/gpu/i915.sh1
-rw-r--r--tools/testing/selftests/efivarfs/create-read.c1
-rwxr-xr-xtools/testing/selftests/efivarfs/efivarfs.sh1
-rw-r--r--tools/testing/selftests/efivarfs/open-unlink.c1
-rw-r--r--tools/testing/selftests/exec/Makefile1
-rw-r--r--tools/testing/selftests/filesystems/Makefile1
-rw-r--r--tools/testing/selftests/filesystems/dnotify_test.c1
-rwxr-xr-xtools/testing/selftests/firmware/fw_fallback.sh1
-rwxr-xr-xtools/testing/selftests/firmware/fw_filesystem.sh1
-rw-r--r--tools/testing/selftests/ftrace/Makefile1
-rw-r--r--tools/testing/selftests/ftrace/test.d/00basic/basic2.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/00basic/basic3.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/event/event-enable.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/event/event-pid.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/instances/instance-event.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/instances/instance.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc1
-rw-r--r--tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc1
-rw-r--r--tools/testing/selftests/futex/Makefile1
-rw-r--r--tools/testing/selftests/futex/functional/Makefile1
-rw-r--r--tools/testing/selftests/gpio/Makefile1
-rwxr-xr-xtools/testing/selftests/gpio/gpio-mockup-sysfs.sh1
-rwxr-xr-xtools/testing/selftests/gpio/gpio-mockup.sh1
-rw-r--r--tools/testing/selftests/ia64/Makefile1
-rw-r--r--tools/testing/selftests/intel_pstate/Makefile1
-rw-r--r--tools/testing/selftests/intel_pstate/aperf.c1
-rw-r--r--tools/testing/selftests/intel_pstate/msr.c1
-rwxr-xr-xtools/testing/selftests/intel_pstate/run.sh1
-rw-r--r--tools/testing/selftests/ipc/Makefile1
-rw-r--r--tools/testing/selftests/ipc/msgque.c1
-rw-r--r--tools/testing/selftests/kcmp/kcmp_test.c1
-rw-r--r--tools/testing/selftests/lib.mk6
-rwxr-xr-xtools/testing/selftests/lib/bitmap.sh1
-rwxr-xr-xtools/testing/selftests/lib/prime_numbers.sh1
-rwxr-xr-xtools/testing/selftests/lib/printf.sh1
-rw-r--r--tools/testing/selftests/locking/ww_mutex.sh1
-rw-r--r--tools/testing/selftests/media_tests/Makefile1
-rwxr-xr-xtools/testing/selftests/media_tests/bind_unbind_sample.sh1
-rwxr-xr-xtools/testing/selftests/media_tests/open_loop_test.sh1
-rw-r--r--tools/testing/selftests/membarrier/membarrier_test.c1
-rw-r--r--tools/testing/selftests/memfd/Makefile1
-rw-r--r--tools/testing/selftests/memfd/fuse_mnt.c1
-rw-r--r--tools/testing/selftests/memfd/fuse_test.c1
-rw-r--r--tools/testing/selftests/memfd/memfd_test.c1
-rwxr-xr-xtools/testing/selftests/memfd/run_fuse_test.sh1
-rw-r--r--tools/testing/selftests/memory-hotplug/Makefile1
-rwxr-xr-xtools/testing/selftests/memory-hotplug/mem-on-off-test.sh1
-rw-r--r--tools/testing/selftests/mount/Makefile1
-rw-r--r--tools/testing/selftests/mount/unprivileged-remount-test.c1
-rw-r--r--tools/testing/selftests/mqueue/Makefile1
-rw-r--r--tools/testing/selftests/net/Makefile1
-rwxr-xr-xtools/testing/selftests/net/netdevice.sh1
-rw-r--r--tools/testing/selftests/net/reuseport_bpf_cpu.c1
-rw-r--r--tools/testing/selftests/net/reuseport_bpf_numa.c1
-rw-r--r--tools/testing/selftests/net/reuseport_dualstack.c1
-rwxr-xr-xtools/testing/selftests/net/run_afpackettests1
-rwxr-xr-xtools/testing/selftests/net/run_netsocktests1
-rw-r--r--tools/testing/selftests/net/socket.c1
-rwxr-xr-xtools/testing/selftests/net/test_bpf.sh1
-rw-r--r--tools/testing/selftests/networking/timestamping/Makefile1
-rw-r--r--tools/testing/selftests/networking/timestamping/hwtstamp_config.c1
-rw-r--r--tools/testing/selftests/nsfs/owner.c1
-rw-r--r--tools/testing/selftests/nsfs/pidns.c1
-rw-r--r--tools/testing/selftests/powerpc/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/benchmarks/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/cache_shape/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/copyloops/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/copyloops/asm/export.h1
-rw-r--r--tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h1
-rw-r--r--tools/testing/selftests/powerpc/copyloops/validate.c1
-rw-r--r--tools/testing/selftests/powerpc/dscr/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/include/basic_asm.h1
-rw-r--r--tools/testing/selftests/powerpc/include/instructions.h1
-rw-r--r--tools/testing/selftests/powerpc/math/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/mm/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c1
-rw-r--r--tools/testing/selftests/powerpc/pmu/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/pmu/ebb/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/ptrace/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/signal/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/stringloops/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h1
-rw-r--r--tools/testing/selftests/powerpc/stringloops/memcmp.c1
-rw-r--r--tools/testing/selftests/powerpc/switch_endian/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/switch_endian/check.S1
-rw-r--r--tools/testing/selftests/powerpc/switch_endian/common.h1
-rw-r--r--tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S1
-rw-r--r--tools/testing/selftests/powerpc/syscalls/ipc.h1
-rw-r--r--tools/testing/selftests/powerpc/tm/Makefile1
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-resched-dscr.c1
-rw-r--r--tools/testing/selftests/powerpc/tm/tm-syscall-asm.S1
-rw-r--r--tools/testing/selftests/powerpc/vphn/test-vphn.c1
-rw-r--r--tools/testing/selftests/prctl/Makefile1
-rw-r--r--tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c1
-rw-r--r--tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c1
-rw-r--r--tools/testing/selftests/prctl/disable-tsc-test.c1
-rw-r--r--tools/testing/selftests/pstore/Makefile1
-rw-r--r--tools/testing/selftests/ptp/Makefile1
-rw-r--r--tools/testing/selftests/ptrace/peeksiginfo.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h1
-rwxr-xr-xtools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/assume.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/barriers.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/bug_on.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/combined_source.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/include_srcu.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/int_typedefs.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/locks.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/misc.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/percpu.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/simple_sync_srcu.c1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/workqueues.h1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile1
-rw-r--r--tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/test.c1
-rwxr-xr-xtools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/test_script.sh1
-rw-r--r--tools/testing/selftests/seccomp/Makefile1
-rw-r--r--tools/testing/selftests/sigaltstack/sas.c1
-rw-r--r--tools/testing/selftests/splice/Makefile1
-rw-r--r--tools/testing/selftests/splice/default_file_splice_read.c1
-rwxr-xr-xtools/testing/selftests/splice/default_file_splice_read.sh1
-rwxr-xr-xtools/testing/selftests/static_keys/test_static_keys.sh1
-rw-r--r--tools/testing/selftests/sync/Makefile1
-rw-r--r--tools/testing/selftests/tc-testing/tc-tests/filters/tests.json23
-rwxr-xr-xtools/testing/selftests/tc-testing/tdc.py23
-rwxr-xr-xtools/testing/selftests/tc-testing/tdc_batch.py62
-rw-r--r--tools/testing/selftests/tc-testing/tdc_config.py3
-rw-r--r--tools/testing/selftests/tc-testing/tdc_helper.py1
-rw-r--r--tools/testing/selftests/timers/Makefile1
-rwxr-xr-xtools/testing/selftests/user/test_user_copy.sh1
-rw-r--r--tools/testing/selftests/vDSO/Makefile1
-rw-r--r--tools/testing/selftests/vm/Makefile1
-rw-r--r--tools/testing/selftests/vm/compaction_test.c1
-rw-r--r--tools/testing/selftests/vm/hugepage-mmap.c1
-rw-r--r--tools/testing/selftests/vm/hugepage-shm.c1
-rw-r--r--tools/testing/selftests/vm/map_hugetlb.c1
-rw-r--r--tools/testing/selftests/vm/mlock-random-test.c1
-rw-r--r--tools/testing/selftests/vm/mlock2-tests.c1
-rw-r--r--tools/testing/selftests/vm/mlock2.h1
-rw-r--r--tools/testing/selftests/vm/on-fault-limit.c1
-rwxr-xr-xtools/testing/selftests/vm/run_vmtests1
-rw-r--r--tools/testing/selftests/vm/thuge-gen.c1
-rw-r--r--tools/testing/selftests/watchdog/Makefile1
-rw-r--r--tools/testing/selftests/watchdog/watchdog-test.c1
-rw-r--r--tools/testing/selftests/x86/Makefile1
-rw-r--r--tools/testing/selftests/x86/ioperm.c1
-rw-r--r--tools/testing/selftests/x86/iopl.c1
-rw-r--r--tools/testing/selftests/x86/ldt_gdt.c1
-rw-r--r--tools/testing/selftests/x86/mpx-debug.h1
-rw-r--r--tools/testing/selftests/x86/mpx-dig.c1
-rw-r--r--tools/testing/selftests/x86/mpx-hw.h1
-rw-r--r--tools/testing/selftests/x86/mpx-mm.h1
-rw-r--r--tools/testing/selftests/x86/pkey-helpers.h1
-rw-r--r--tools/testing/selftests/x86/protection_keys.c1
-rw-r--r--tools/testing/selftests/x86/ptrace_syscall.c1
-rw-r--r--tools/testing/selftests/x86/raw_syscall_helper_32.S1
-rw-r--r--tools/testing/selftests/x86/test_FCMOV.c1
-rw-r--r--tools/testing/selftests/x86/test_FCOMI.c1
-rw-r--r--tools/testing/selftests/x86/test_FISTTP.c1
-rw-r--r--tools/testing/selftests/x86/test_vdso.c1
-rw-r--r--tools/testing/selftests/zram/Makefile1
-rwxr-xr-xtools/testing/selftests/zram/zram.sh1
-rw-r--r--tools/thermal/tmon/Makefile1
-rw-r--r--tools/thermal/tmon/tmon.81
-rw-r--r--tools/usb/Makefile1
-rw-r--r--tools/usb/ffs-aio-example/multibuff/host_app/Makefile1
-rw-r--r--tools/usb/hcd-tests.sh1
-rw-r--r--tools/usb/usbip/Makefile.am1
-rwxr-xr-xtools/usb/usbip/cleanup.sh1
-rw-r--r--tools/usb/usbip/libsrc/Makefile.am1
-rw-r--r--tools/usb/usbip/libsrc/list.h1
-rw-r--r--tools/usb/usbip/libsrc/sysfs_utils.c1
-rw-r--r--tools/usb/usbip/libsrc/sysfs_utils.h1
-rw-r--r--tools/usb/usbip/libsrc/usbip_common.c1
-rw-r--r--tools/usb/usbip/libsrc/usbip_common.h1
-rw-r--r--tools/usb/usbip/libsrc/vhci_driver.c1
-rw-r--r--tools/usb/usbip/libsrc/vhci_driver.h1
-rw-r--r--tools/usb/usbip/src/Makefile.am1
-rw-r--r--tools/usb/usbip/src/usbip_network.h1
-rw-r--r--tools/virtio/Makefile1
-rw-r--r--tools/virtio/asm/barrier.h1
-rw-r--r--tools/virtio/linux/bug.h1
-rw-r--r--tools/virtio/linux/compiler.h1
-rw-r--r--tools/virtio/linux/dma-mapping.h1
-rw-r--r--tools/virtio/linux/err.h1
-rw-r--r--tools/virtio/linux/kernel.h1
-rw-r--r--tools/virtio/linux/module.h1
-rw-r--r--tools/virtio/linux/scatterlist.h1
-rw-r--r--tools/virtio/linux/slab.h1
-rw-r--r--tools/virtio/linux/uaccess.h1
-rw-r--r--tools/virtio/linux/virtio.h1
-rw-r--r--tools/virtio/linux/virtio_byteorder.h1
-rw-r--r--tools/virtio/linux/virtio_config.h1
-rw-r--r--tools/virtio/ringtest/Makefile1
-rw-r--r--tools/virtio/ringtest/noring.c1
-rw-r--r--tools/virtio/ringtest/ptr_ring.c1
-rwxr-xr-xtools/virtio/ringtest/run-on-all.sh1
-rw-r--r--tools/virtio/uapi/linux/virtio_ring.h1
-rw-r--r--tools/virtio/virtio-trace/Makefile1
-rw-r--r--tools/virtio/virtio-trace/trace-agent.h1
-rw-r--r--tools/virtio/virtio_test.c1
-rw-r--r--tools/virtio/vringh_test.c1
-rw-r--r--tools/vm/Makefile1
-rw-r--r--tools/vm/page_owner_sort.c1
-rw-r--r--tools/vm/slabinfo.c1
993 files changed, 1257 insertions, 21 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 9dfede37c8ff8a..c4f41ef9a7a7c5 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Some of the tools (perf) use same make variables
# as in kernel build.
export srctree=
diff --git a/tools/accounting/Makefile b/tools/accounting/Makefile
index 647c94a219bf56..03687f19cbb174 100644
--- a/tools/accounting/Makefile
+++ b/tools/accounting/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC := $(CROSS_COMPILE)gcc
CFLAGS := -I../../usr/include
diff --git a/tools/accounting/getdelays.c b/tools/accounting/getdelays.c
index b5ca536e56a8b9..9f420d98b5fb3b 100644
--- a/tools/accounting/getdelays.c
+++ b/tools/accounting/getdelays.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* getdelays.c
*
* Utility to get per-pid and per-tgid delay accounting statistics
diff --git a/tools/arch/alpha/include/asm/barrier.h b/tools/arch/alpha/include/asm/barrier.h
index 95df19c9548234..da8d6457ed4f4b 100644
--- a/tools/arch/alpha/include/asm/barrier.h
+++ b/tools/arch/alpha/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_ASM_ALPHA_BARRIER_H
#define __TOOLS_LINUX_ASM_ALPHA_BARRIER_H
diff --git a/tools/arch/alpha/include/uapi/asm/bitsperlong.h b/tools/arch/alpha/include/uapi/asm/bitsperlong.h
index ad57f786820380..6c5bf7d03f4e3d 100644
--- a/tools/arch/alpha/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/alpha/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_ALPHA_BITSPERLONG_H
#define __ASM_ALPHA_BITSPERLONG_H
diff --git a/tools/arch/alpha/include/uapi/asm/mman.h b/tools/arch/alpha/include/uapi/asm/mman.h
index e38b64c82b976d..c317d3e6867a37 100644
--- a/tools/arch/alpha/include/uapi/asm/mman.h
+++ b/tools/arch/alpha/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_ALPHA_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_ALPHA_UAPI_ASM_MMAN_FIX_H
#define MADV_DODUMP 17
diff --git a/tools/arch/arc/include/uapi/asm/mman.h b/tools/arch/arc/include/uapi/asm/mman.h
index aa3acd2aa9af60..81f0f9bf0c25b2 100644
--- a/tools/arch/arc/include/uapi/asm/mman.h
+++ b/tools/arch/arc/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_ARC_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/arm/include/uapi/asm/kvm.h b/tools/arch/arm/include/uapi/asm/kvm.h
index 5db2d4c6a55faf..1f57bbe82b6fb8 100644
--- a/tools/arch/arm/include/uapi/asm/kvm.h
+++ b/tools/arch/arm/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (C) 2012 - Virtual Open Systems and Columbia University
* Author: Christoffer Dall <c.dall@virtualopensystems.com>
diff --git a/tools/arch/arm/include/uapi/asm/mman.h b/tools/arch/arm/include/uapi/asm/mman.h
index 478f699f56fd14..a6d46321e33078 100644
--- a/tools/arch/arm/include/uapi/asm/mman.h
+++ b/tools/arch/arm/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_ARM_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/arm/include/uapi/asm/perf_regs.h b/tools/arch/arm/include/uapi/asm/perf_regs.h
index ce59448458b22a..a3c046174e6b69 100644
--- a/tools/arch/arm/include/uapi/asm/perf_regs.h
+++ b/tools/arch/arm/include/uapi/asm/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_ARM_PERF_REGS_H
#define _ASM_ARM_PERF_REGS_H
diff --git a/tools/arch/arm64/include/asm/barrier.h b/tools/arch/arm64/include/asm/barrier.h
index a0483c8e01429c..40bde6b235013f 100644
--- a/tools/arch/arm64/include/asm/barrier.h
+++ b/tools/arch/arm64/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_AARCH64_BARRIER_H
#define _TOOLS_LINUX_ASM_AARCH64_BARRIER_H
diff --git a/tools/arch/arm64/include/uapi/asm/bitsperlong.h b/tools/arch/arm64/include/uapi/asm/bitsperlong.h
index fce9c2924fa346..485d60bee26ca3 100644
--- a/tools/arch/arm64/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/arm64/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (C) 2012 ARM Ltd.
*
diff --git a/tools/arch/arm64/include/uapi/asm/kvm.h b/tools/arch/arm64/include/uapi/asm/kvm.h
index 9f3ca24bbcc6c2..51149ec75fe480 100644
--- a/tools/arch/arm64/include/uapi/asm/kvm.h
+++ b/tools/arch/arm64/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (C) 2012,2013 - ARM Ltd
* Author: Marc Zyngier <marc.zyngier@arm.com>
diff --git a/tools/arch/arm64/include/uapi/asm/mman.h b/tools/arch/arm64/include/uapi/asm/mman.h
index 70fd3113710a45..2ee288e447ece6 100644
--- a/tools/arch/arm64/include/uapi/asm/mman.h
+++ b/tools/arch/arm64/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_ARM64_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/arm64/include/uapi/asm/perf_regs.h b/tools/arch/arm64/include/uapi/asm/perf_regs.h
index 172b8317ee49f8..d54daafa89e3ff 100644
--- a/tools/arch/arm64/include/uapi/asm/perf_regs.h
+++ b/tools/arch/arm64/include/uapi/asm/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_ARM64_PERF_REGS_H
#define _ASM_ARM64_PERF_REGS_H
diff --git a/tools/arch/frv/include/uapi/asm/bitsperlong.h b/tools/arch/frv/include/uapi/asm/bitsperlong.h
index 6dc0bb0c13b29d..76da34b10f5981 100644
--- a/tools/arch/frv/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/frv/include/uapi/asm/bitsperlong.h
@@ -1 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#include <asm-generic/bitsperlong.h>
diff --git a/tools/arch/frv/include/uapi/asm/mman.h b/tools/arch/frv/include/uapi/asm/mman.h
index 5be78ac1246400..5bc900b0bc7827 100644
--- a/tools/arch/frv/include/uapi/asm/mman.h
+++ b/tools/arch/frv/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_FRV_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/h8300/include/asm/bitsperlong.h b/tools/arch/h8300/include/asm/bitsperlong.h
index e140e46729ac99..fa1508337ffc1b 100644
--- a/tools/arch/h8300/include/asm/bitsperlong.h
+++ b/tools/arch/h8300/include/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_H8300_BITS_PER_LONG
#define __ASM_H8300_BITS_PER_LONG
diff --git a/tools/arch/h8300/include/uapi/asm/mman.h b/tools/arch/h8300/include/uapi/asm/mman.h
index 9d9ac54d3c5a4f..be7bbe0528d199 100644
--- a/tools/arch/h8300/include/uapi/asm/mman.h
+++ b/tools/arch/h8300/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_H8300_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/hexagon/include/uapi/asm/bitsperlong.h b/tools/arch/hexagon/include/uapi/asm/bitsperlong.h
index 4a658151383d25..5adca0d26913e0 100644
--- a/tools/arch/hexagon/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/hexagon/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*
diff --git a/tools/arch/hexagon/include/uapi/asm/mman.h b/tools/arch/hexagon/include/uapi/asm/mman.h
index 102f3fae6085d6..cd59ba932b3a70 100644
--- a/tools/arch/hexagon/include/uapi/asm/mman.h
+++ b/tools/arch/hexagon/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_HEXAGON_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/ia64/include/asm/barrier.h b/tools/arch/ia64/include/asm/barrier.h
index e4422b4b634e6b..d808ee0e77b58b 100644
--- a/tools/arch/ia64/include/asm/barrier.h
+++ b/tools/arch/ia64/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copied from the kernel sources to tools/:
*
diff --git a/tools/arch/ia64/include/uapi/asm/bitsperlong.h b/tools/arch/ia64/include/uapi/asm/bitsperlong.h
index ec4db3c970b770..1146d55563db37 100644
--- a/tools/arch/ia64/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/ia64/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_IA64_BITSPERLONG_H
#define __ASM_IA64_BITSPERLONG_H
diff --git a/tools/arch/ia64/include/uapi/asm/mman.h b/tools/arch/ia64/include/uapi/asm/mman.h
index 1d6e5ac6442d0d..2a19bb1db4ab60 100644
--- a/tools/arch/ia64/include/uapi/asm/mman.h
+++ b/tools/arch/ia64/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_IA64_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/m32r/include/uapi/asm/bitsperlong.h b/tools/arch/m32r/include/uapi/asm/bitsperlong.h
index 6dc0bb0c13b29d..76da34b10f5981 100644
--- a/tools/arch/m32r/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/m32r/include/uapi/asm/bitsperlong.h
@@ -1 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#include <asm-generic/bitsperlong.h>
diff --git a/tools/arch/m32r/include/uapi/asm/mman.h b/tools/arch/m32r/include/uapi/asm/mman.h
index 1c29635bb73bd8..d19b82c9c2908f 100644
--- a/tools/arch/m32r/include/uapi/asm/mman.h
+++ b/tools/arch/m32r/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_M32R_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/microblaze/include/uapi/asm/bitsperlong.h b/tools/arch/microblaze/include/uapi/asm/bitsperlong.h
index 6dc0bb0c13b29d..76da34b10f5981 100644
--- a/tools/arch/microblaze/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/microblaze/include/uapi/asm/bitsperlong.h
@@ -1 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#include <asm-generic/bitsperlong.h>
diff --git a/tools/arch/microblaze/include/uapi/asm/mman.h b/tools/arch/microblaze/include/uapi/asm/mman.h
index 005cd50b50e10c..f3f2103fd02cf4 100644
--- a/tools/arch/microblaze/include/uapi/asm/mman.h
+++ b/tools/arch/microblaze/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_MICROBLAZE_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/mips/include/asm/barrier.h b/tools/arch/mips/include/asm/barrier.h
index 80f96f7556e32e..0d1191523cd0d8 100644
--- a/tools/arch/mips/include/asm/barrier.h
+++ b/tools/arch/mips/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_MIPS_BARRIER_H
#define _TOOLS_LINUX_ASM_MIPS_BARRIER_H
/*
diff --git a/tools/arch/mips/include/uapi/asm/bitsperlong.h b/tools/arch/mips/include/uapi/asm/bitsperlong.h
index 3e4c10a8e78768..7268380d8d2875 100644
--- a/tools/arch/mips/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/mips/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_MIPS_BITSPERLONG_H
#define __ASM_MIPS_BITSPERLONG_H
diff --git a/tools/arch/mips/include/uapi/asm/kvm.h b/tools/arch/mips/include/uapi/asm/kvm.h
index 6985eb59b08534..d2714cc1cd93f0 100644
--- a/tools/arch/mips/include/uapi/asm/kvm.h
+++ b/tools/arch/mips/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
diff --git a/tools/arch/mips/include/uapi/asm/mman.h b/tools/arch/mips/include/uapi/asm/mman.h
index c02052965d50c5..de2206883abc0f 100644
--- a/tools/arch/mips/include/uapi/asm/mman.h
+++ b/tools/arch/mips/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_MIPS_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_MIPS_UAPI_ASM_MMAN_FIX_H
#define MADV_DODUMP 17
diff --git a/tools/arch/mn10300/include/uapi/asm/mman.h b/tools/arch/mn10300/include/uapi/asm/mman.h
index c1ea36d83acc07..b9360639974f93 100644
--- a/tools/arch/mn10300/include/uapi/asm/mman.h
+++ b/tools/arch/mn10300/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_MN10300_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/parisc/include/uapi/asm/bitsperlong.h b/tools/arch/parisc/include/uapi/asm/bitsperlong.h
index e0a23c7bdd432a..23ac7562927ab4 100644
--- a/tools/arch/parisc/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/parisc/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_PARISC_BITSPERLONG_H
#define __ASM_PARISC_BITSPERLONG_H
diff --git a/tools/arch/parisc/include/uapi/asm/mman.h b/tools/arch/parisc/include/uapi/asm/mman.h
index 286c0bd7457349..1bd78758bde981 100644
--- a/tools/arch/parisc/include/uapi/asm/mman.h
+++ b/tools/arch/parisc/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_PARISC_UAPI_ASM_MMAN_FIX_H
#define MADV_DODUMP 70
diff --git a/tools/arch/powerpc/include/asm/barrier.h b/tools/arch/powerpc/include/asm/barrier.h
index b23aee8e6d9083..a634da05bc9735 100644
--- a/tools/arch/powerpc/include/asm/barrier.h
+++ b/tools/arch/powerpc/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copied from the kernel sources:
*
diff --git a/tools/arch/powerpc/include/uapi/asm/bitsperlong.h b/tools/arch/powerpc/include/uapi/asm/bitsperlong.h
index 5f1659032c4080..46ece3ecff31c2 100644
--- a/tools/arch/powerpc/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/powerpc/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_POWERPC_BITSPERLONG_H
#define __ASM_POWERPC_BITSPERLONG_H
diff --git a/tools/arch/powerpc/include/uapi/asm/kvm.h b/tools/arch/powerpc/include/uapi/asm/kvm.h
index 8cf8f0c96906dc..61d6049f4c1ece 100644
--- a/tools/arch/powerpc/include/uapi/asm/kvm.h
+++ b/tools/arch/powerpc/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
diff --git a/tools/arch/powerpc/include/uapi/asm/mman.h b/tools/arch/powerpc/include/uapi/asm/mman.h
index 761db43172fea9..f33105bc5ca612 100644
--- a/tools/arch/powerpc/include/uapi/asm/mman.h
+++ b/tools/arch/powerpc/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_POWERPC_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_POWERPC_UAPI_ASM_MMAN_FIX_H
#define MAP_DENYWRITE 0x0800
diff --git a/tools/arch/powerpc/include/uapi/asm/perf_regs.h b/tools/arch/powerpc/include/uapi/asm/perf_regs.h
index 6a93209748a15d..9e52c86ccbd345 100644
--- a/tools/arch/powerpc/include/uapi/asm/perf_regs.h
+++ b/tools/arch/powerpc/include/uapi/asm/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_ASM_POWERPC_PERF_REGS_H
#define _UAPI_ASM_POWERPC_PERF_REGS_H
diff --git a/tools/arch/s390/include/asm/barrier.h b/tools/arch/s390/include/asm/barrier.h
index f85141266b92c5..5030c99f47d205 100644
--- a/tools/arch/s390/include/asm/barrier.h
+++ b/tools/arch/s390/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copied from the kernel sources:
*
diff --git a/tools/arch/s390/include/uapi/asm/bitsperlong.h b/tools/arch/s390/include/uapi/asm/bitsperlong.h
index e351ea2ad43e72..d2bb620119bf3c 100644
--- a/tools/arch/s390/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/s390/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_S390_BITSPERLONG_H
#define __ASM_S390_BITSPERLONG_H
diff --git a/tools/arch/s390/include/uapi/asm/kvm.h b/tools/arch/s390/include/uapi/asm/kvm.h
index cd7359e23d8694..9ad172dcd912d5 100644
--- a/tools/arch/s390/include/uapi/asm/kvm.h
+++ b/tools/arch/s390/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_KVM_S390_H
#define __LINUX_KVM_S390_H
/*
diff --git a/tools/arch/s390/include/uapi/asm/kvm_perf.h b/tools/arch/s390/include/uapi/asm/kvm_perf.h
index 397282727e2189..c36c97ffdc6fa2 100644
--- a/tools/arch/s390/include/uapi/asm/kvm_perf.h
+++ b/tools/arch/s390/include/uapi/asm/kvm_perf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Definitions for perf-kvm on s390
*
diff --git a/tools/arch/s390/include/uapi/asm/mman.h b/tools/arch/s390/include/uapi/asm/mman.h
index b03dea9e1f56dc..4ec32e4251a44d 100644
--- a/tools/arch/s390/include/uapi/asm/mman.h
+++ b/tools/arch/s390/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_S390_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/s390/include/uapi/asm/sie.h b/tools/arch/s390/include/uapi/asm/sie.h
index 3ac6343689394d..6ca1e68d710313 100644
--- a/tools/arch/s390/include/uapi/asm/sie.h
+++ b/tools/arch/s390/include/uapi/asm/sie.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_ASM_S390_SIE_H
#define _UAPI_ASM_S390_SIE_H
diff --git a/tools/arch/score/include/uapi/asm/bitsperlong.h b/tools/arch/score/include/uapi/asm/bitsperlong.h
index 86ff337aa45972..df48f2717da29d 100644
--- a/tools/arch/score/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/score/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_SCORE_BITSPERLONG_H
#define _ASM_SCORE_BITSPERLONG_H
diff --git a/tools/arch/score/include/uapi/asm/mman.h b/tools/arch/score/include/uapi/asm/mman.h
index 2f8fb89944fd95..b4bd195a858654 100644
--- a/tools/arch/score/include/uapi/asm/mman.h
+++ b/tools/arch/score/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_SCORE_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/sh/include/asm/barrier.h b/tools/arch/sh/include/asm/barrier.h
index c18fd7599b9719..bde5221af28244 100644
--- a/tools/arch/sh/include/asm/barrier.h
+++ b/tools/arch/sh/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copied from the kernel sources:
*
diff --git a/tools/arch/sh/include/uapi/asm/mman.h b/tools/arch/sh/include/uapi/asm/mman.h
index 26504f6f060e94..88c0e2930c478f 100644
--- a/tools/arch/sh/include/uapi/asm/mman.h
+++ b/tools/arch/sh/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_SH_UAPI_ASM_MMAN_FIX_H
#include <uapi/asm-generic/mman.h>
diff --git a/tools/arch/sparc/include/asm/barrier.h b/tools/arch/sparc/include/asm/barrier.h
index 8c017b3b13911a..95d1618465a65f 100644
--- a/tools/arch/sparc/include/asm/barrier.h
+++ b/tools/arch/sparc/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ___TOOLS_LINUX_ASM_SPARC_BARRIER_H
#define ___TOOLS_LINUX_ASM_SPARC_BARRIER_H
#if defined(__sparc__) && defined(__arch64__)
diff --git a/tools/arch/sparc/include/asm/barrier_32.h b/tools/arch/sparc/include/asm/barrier_32.h
index c5eadd0a7233a8..cc19ed1dde0b2f 100644
--- a/tools/arch/sparc/include/asm/barrier_32.h
+++ b/tools/arch/sparc/include/asm/barrier_32.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_PERF_SPARC_BARRIER_H
#define __TOOLS_PERF_SPARC_BARRIER_H
diff --git a/tools/arch/sparc/include/asm/barrier_64.h b/tools/arch/sparc/include/asm/barrier_64.h
index 9a7d7322c3f785..ba61344287d507 100644
--- a/tools/arch/sparc/include/asm/barrier_64.h
+++ b/tools/arch/sparc/include/asm/barrier_64.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_SPARC64_BARRIER_H
#define __TOOLS_LINUX_SPARC64_BARRIER_H
diff --git a/tools/arch/sparc/include/uapi/asm/bitsperlong.h b/tools/arch/sparc/include/uapi/asm/bitsperlong.h
index b62dd907d7c35f..3b4e61740b759f 100644
--- a/tools/arch/sparc/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/sparc/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_ALPHA_BITSPERLONG_H
#define __ASM_ALPHA_BITSPERLONG_H
diff --git a/tools/arch/sparc/include/uapi/asm/mman.h b/tools/arch/sparc/include/uapi/asm/mman.h
index 8640525de99195..38920eed8cbf11 100644
--- a/tools/arch/sparc/include/uapi/asm/mman.h
+++ b/tools/arch/sparc/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_SPARC_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_SPARC_UAPI_ASM_MMAN_FIX_H
#define MAP_DENYWRITE 0x0800
diff --git a/tools/arch/tile/include/asm/barrier.h b/tools/arch/tile/include/asm/barrier.h
index 7d3692c3d4ac2b..7ad02a591b4372 100644
--- a/tools/arch/tile/include/asm/barrier.h
+++ b/tools/arch/tile/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_TILE_BARRIER_H
#define _TOOLS_LINUX_ASM_TILE_BARRIER_H
/*
diff --git a/tools/arch/tile/include/uapi/asm/bitsperlong.h b/tools/arch/tile/include/uapi/asm/bitsperlong.h
index 58c771f2af2f59..57cca78c0fbb47 100644
--- a/tools/arch/tile/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/tile/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Copyright 2010 Tilera Corporation. All Rights Reserved.
*
diff --git a/tools/arch/tile/include/uapi/asm/mman.h b/tools/arch/tile/include/uapi/asm/mman.h
index 7116c4b928b303..65ec92925c6c2f 100644
--- a/tools/arch/tile/include/uapi/asm/mman.h
+++ b/tools/arch/tile/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_TILE_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_TILE_UAPI_ASM_MMAN_FIX_H
#define MAP_DENYWRITE 0x0800
diff --git a/tools/arch/x86/include/asm/atomic.h b/tools/arch/x86/include/asm/atomic.h
index 328eeceec70980..7d8c3261a50d0d 100644
--- a/tools/arch/x86/include/asm/atomic.h
+++ b/tools/arch/x86/include/asm/atomic.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_X86_ATOMIC_H
#define _TOOLS_LINUX_ASM_X86_ATOMIC_H
diff --git a/tools/arch/x86/include/asm/barrier.h b/tools/arch/x86/include/asm/barrier.h
index f366d8e550e4ae..8774dee27471e5 100644
--- a/tools/arch/x86/include/asm/barrier.h
+++ b/tools/arch/x86/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_X86_BARRIER_H
#define _TOOLS_LINUX_ASM_X86_BARRIER_H
diff --git a/tools/arch/x86/include/asm/cmpxchg.h b/tools/arch/x86/include/asm/cmpxchg.h
index f5253260f3cc1e..0ed9ca2766ad6c 100644
--- a/tools/arch/x86/include/asm/cmpxchg.h
+++ b/tools/arch/x86/include/asm/cmpxchg.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef TOOLS_ASM_X86_CMPXCHG_H
#define TOOLS_ASM_X86_CMPXCHG_H
diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index 2519c6c801c917..793690fbda3625 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_X86_CPUFEATURES_H
#define _ASM_X86_CPUFEATURES_H
diff --git a/tools/arch/x86/include/asm/rmwcc.h b/tools/arch/x86/include/asm/rmwcc.h
index a6669bc069395c..dc90c0c2fae352 100644
--- a/tools/arch/x86/include/asm/rmwcc.h
+++ b/tools/arch/x86/include/asm/rmwcc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_X86_RMWcc
#define _TOOLS_LINUX_ASM_X86_RMWcc
diff --git a/tools/arch/x86/include/asm/unistd_32.h b/tools/arch/x86/include/asm/unistd_32.h
index 0e4312ffc945e3..60a89dba01b658 100644
--- a/tools/arch/x86/include/asm/unistd_32.h
+++ b/tools/arch/x86/include/asm/unistd_32.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NR_perf_event_open
# define __NR_perf_event_open 336
#endif
diff --git a/tools/arch/x86/include/asm/unistd_64.h b/tools/arch/x86/include/asm/unistd_64.h
index dd56bb36132a58..cb52a3a8b8fcdb 100644
--- a/tools/arch/x86/include/asm/unistd_64.h
+++ b/tools/arch/x86/include/asm/unistd_64.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NR_perf_event_open
# define __NR_perf_event_open 298
#endif
diff --git a/tools/arch/x86/include/uapi/asm/bitsperlong.h b/tools/arch/x86/include/uapi/asm/bitsperlong.h
index 6e23c543cd80b8..f8a92e0009d6ce 100644
--- a/tools/arch/x86/include/uapi/asm/bitsperlong.h
+++ b/tools/arch/x86/include/uapi/asm/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_X86_BITSPERLONG_H
#define __ASM_X86_BITSPERLONG_H
diff --git a/tools/arch/x86/include/uapi/asm/kvm.h b/tools/arch/x86/include/uapi/asm/kvm.h
index c2824d02ba3762..f3a960488eae0f 100644
--- a/tools/arch/x86/include/uapi/asm/kvm.h
+++ b/tools/arch/x86/include/uapi/asm/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_X86_KVM_H
#define _ASM_X86_KVM_H
diff --git a/tools/arch/x86/include/uapi/asm/kvm_perf.h b/tools/arch/x86/include/uapi/asm/kvm_perf.h
index 3bb964f88aa14c..125cf5cdf6c5f6 100644
--- a/tools/arch/x86/include/uapi/asm/kvm_perf.h
+++ b/tools/arch/x86/include/uapi/asm/kvm_perf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_X86_KVM_PERF_H
#define _ASM_X86_KVM_PERF_H
diff --git a/tools/arch/x86/include/uapi/asm/mman.h b/tools/arch/x86/include/uapi/asm/mman.h
index b73c1af8b1dd7c..8449778de2ed7c 100644
--- a/tools/arch/x86/include/uapi/asm/mman.h
+++ b/tools/arch/x86/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_X86_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_X86_UAPI_ASM_MMAN_FIX_H
#define MAP_32BIT 0x40
diff --git a/tools/arch/x86/include/uapi/asm/perf_regs.h b/tools/arch/x86/include/uapi/asm/perf_regs.h
index 3f2207bfd17b0e..f3329cabce5c6d 100644
--- a/tools/arch/x86/include/uapi/asm/perf_regs.h
+++ b/tools/arch/x86/include/uapi/asm/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_X86_PERF_REGS_H
#define _ASM_X86_PERF_REGS_H
diff --git a/tools/arch/x86/include/uapi/asm/svm.h b/tools/arch/x86/include/uapi/asm/svm.h
index 3725e145aa58c2..a9731f8a480f3b 100644
--- a/tools/arch/x86/include/uapi/asm/svm.h
+++ b/tools/arch/x86/include/uapi/asm/svm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI__SVM_H
#define _UAPI__SVM_H
diff --git a/tools/arch/x86/include/uapi/asm/unistd.h b/tools/arch/x86/include/uapi/asm/unistd.h
index a26df0d75cd059..30d7d04d72d6ba 100644
--- a/tools/arch/x86/include/uapi/asm/unistd.h
+++ b/tools/arch/x86/include/uapi/asm/unistd.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_ASM_X86_UNISTD_H
#define _UAPI_ASM_X86_UNISTD_H
diff --git a/tools/arch/x86/include/uapi/asm/vmx.h b/tools/arch/x86/include/uapi/asm/vmx.h
index 690a2dcf407860..f0b0c90dd39824 100644
--- a/tools/arch/x86/include/uapi/asm/vmx.h
+++ b/tools/arch/x86/include/uapi/asm/vmx.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* vmx.h: VMX Architecture related definitions
* Copyright (c) 2004, Intel Corporation.
diff --git a/tools/arch/x86/lib/memcpy_64.S b/tools/arch/x86/lib/memcpy_64.S
index 98dcc112b36349..9a53a06e5a3efc 100644
--- a/tools/arch/x86/lib/memcpy_64.S
+++ b/tools/arch/x86/lib/memcpy_64.S
@@ -4,6 +4,7 @@
#include <asm/errno.h>
#include <asm/cpufeatures.h>
#include <asm/alternative-asm.h>
+#include <asm/export.h>
/*
* We build a jump to memcpy_orig by default which gets NOPped out on
@@ -40,6 +41,8 @@ ENTRY(memcpy)
ret
ENDPROC(memcpy)
ENDPROC(__memcpy)
+EXPORT_SYMBOL(memcpy)
+EXPORT_SYMBOL(__memcpy)
/*
* memcpy_erms() - enhanced fast string memcpy. This is faster and
@@ -274,6 +277,7 @@ ENTRY(memcpy_mcsafe_unrolled)
xorq %rax, %rax
ret
ENDPROC(memcpy_mcsafe_unrolled)
+EXPORT_SYMBOL_GPL(memcpy_mcsafe_unrolled)
.section .fixup, "ax"
/* Return -EFAULT for any failure */
diff --git a/tools/arch/x86/lib/memset_64.S b/tools/arch/x86/lib/memset_64.S
index e1229ecd2a8205..f8f3dc0a6690e9 100644
--- a/tools/arch/x86/lib/memset_64.S
+++ b/tools/arch/x86/lib/memset_64.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright 2002 Andi Kleen, SuSE Labs */
#include <linux/linkage.h>
diff --git a/tools/arch/xtensa/include/uapi/asm/mman.h b/tools/arch/xtensa/include/uapi/asm/mman.h
index 4453195c450c1c..34dde6f44dae51 100644
--- a/tools/arch/xtensa/include/uapi/asm/mman.h
+++ b/tools/arch/xtensa/include/uapi/asm/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H
#define TOOLS_ARCH_XTENSA_UAPI_ASM_MMAN_FIX_H
#define MADV_DODUMP 17
diff --git a/tools/build/Makefile b/tools/build/Makefile
index 477f00eda59184..5eb4b5ad79cb77 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifeq ($(srctree),)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index c46b20e4ad87eb..cd72016c3cfa71 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
###
# Main build makefile.
#
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index ee2546ddf02831..96982640fbf880 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
FILES= \
test-all.bin \
test-backtrace.bin \
diff --git a/tools/build/feature/test-all.c b/tools/build/feature/test-all.c
index b5cfc64457716f..4112702e4aed2e 100644
--- a/tools/build/feature/test-all.c
+++ b/tools/build/feature/test-all.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* test-all.c: Try to build all the main testcases at once.
*
diff --git a/tools/build/feature/test-backtrace.c b/tools/build/feature/test-backtrace.c
index 7124aa1dc8fb77..e9ddd27c69c35e 100644
--- a/tools/build/feature/test-backtrace.c
+++ b/tools/build/feature/test-backtrace.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <execinfo.h>
#include <stdio.h>
diff --git a/tools/build/feature/test-bionic.c b/tools/build/feature/test-bionic.c
index eac24e9513ebc0..4bcc9776504cb3 100644
--- a/tools/build/feature/test-bionic.c
+++ b/tools/build/feature/test-bionic.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <android/api-level.h>
int main(void)
diff --git a/tools/build/feature/test-bpf.c b/tools/build/feature/test-bpf.c
index da2172ff9662d0..82070eadfc070f 100644
--- a/tools/build/feature/test-bpf.c
+++ b/tools/build/feature/test-bpf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <asm/unistd.h>
#include <linux/bpf.h>
#include <unistd.h>
diff --git a/tools/build/feature/test-clang.cpp b/tools/build/feature/test-clang.cpp
index e23c1b1f1b9121..a2b3f092d2f022 100644
--- a/tools/build/feature/test-clang.cpp
+++ b/tools/build/feature/test-clang.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Driver/Driver.h"
#include "clang/Frontend/TextDiagnosticPrinter.h"
diff --git a/tools/build/feature/test-compile.c b/tools/build/feature/test-compile.c
index c54e6551ae4c54..9821b8271deed9 100644
--- a/tools/build/feature/test-compile.c
+++ b/tools/build/feature/test-compile.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
int main(void)
{
diff --git a/tools/build/feature/test-cplus-demangle.c b/tools/build/feature/test-cplus-demangle.c
index 610c686e0009a5..2ba56474ab7182 100644
--- a/tools/build/feature/test-cplus-demangle.c
+++ b/tools/build/feature/test-cplus-demangle.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
extern int printf(const char *format, ...);
extern char *cplus_demangle(const char *, int);
diff --git a/tools/build/feature/test-cxx.cpp b/tools/build/feature/test-cxx.cpp
index b1dee9a31d6cb1..396aaedd2418dd 100644
--- a/tools/build/feature/test-cxx.cpp
+++ b/tools/build/feature/test-cxx.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <iostream>
#include <memory>
diff --git a/tools/build/feature/test-dwarf.c b/tools/build/feature/test-dwarf.c
index 3fc1801ce4a976..8d474bd7371b21 100644
--- a/tools/build/feature/test-dwarf.c
+++ b/tools/build/feature/test-dwarf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dwarf.h>
#include <elfutils/libdw.h>
#include <elfutils/version.h>
diff --git a/tools/build/feature/test-dwarf_getlocations.c b/tools/build/feature/test-dwarf_getlocations.c
index 70162699dd4345..78fb4a1fa68c3f 100644
--- a/tools/build/feature/test-dwarf_getlocations.c
+++ b/tools/build/feature/test-dwarf_getlocations.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <elfutils/libdw.h>
diff --git a/tools/build/feature/test-get_cpuid.c b/tools/build/feature/test-get_cpuid.c
index d7a2c407130de0..bb4f065f28a6bb 100644
--- a/tools/build/feature/test-get_cpuid.c
+++ b/tools/build/feature/test-get_cpuid.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <cpuid.h>
int main(void)
diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
index 9367f7586676b8..9ab8e90e7b88af 100644
--- a/tools/build/feature/test-glibc.c
+++ b/tools/build/feature/test-glibc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#if !defined(__UCLIBC__)
diff --git a/tools/build/feature/test-gtk2-infobar.c b/tools/build/feature/test-gtk2-infobar.c
index 397b4646d06614..b1b716dd57330c 100644
--- a/tools/build/feature/test-gtk2-infobar.c
+++ b/tools/build/feature/test-gtk2-infobar.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#include <gtk/gtk.h>
#pragma GCC diagnostic error "-Wstrict-prototypes"
diff --git a/tools/build/feature/test-gtk2.c b/tools/build/feature/test-gtk2.c
index 6bd80e5094391f..2aaf4bfc20556a 100644
--- a/tools/build/feature/test-gtk2.c
+++ b/tools/build/feature/test-gtk2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
#include <gtk/gtk.h>
#pragma GCC diagnostic error "-Wstrict-prototypes"
diff --git a/tools/build/feature/test-jvmti.c b/tools/build/feature/test-jvmti.c
index 1c665f09b9d65f..5cf31192f204af 100644
--- a/tools/build/feature/test-jvmti.c
+++ b/tools/build/feature/test-jvmti.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <jvmti.h>
#include <jvmticmlr.h>
diff --git a/tools/build/feature/test-libaudit.c b/tools/build/feature/test-libaudit.c
index afc019f08641c5..f5b0863fa1ec24 100644
--- a/tools/build/feature/test-libaudit.c
+++ b/tools/build/feature/test-libaudit.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libaudit.h>
extern int printf(const char *format, ...);
diff --git a/tools/build/feature/test-libbabeltrace.c b/tools/build/feature/test-libbabeltrace.c
index 9cf802a04885cb..10bb69d55694c5 100644
--- a/tools/build/feature/test-libbabeltrace.c
+++ b/tools/build/feature/test-libbabeltrace.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <babeltrace/ctf-writer/writer.h>
#include <babeltrace/ctf-ir/stream-class.h>
diff --git a/tools/build/feature/test-libbfd.c b/tools/build/feature/test-libbfd.c
index 24059907e990da..afa46b0465cd13 100644
--- a/tools/build/feature/test-libbfd.c
+++ b/tools/build/feature/test-libbfd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <bfd.h>
extern int printf(const char *format, ...);
diff --git a/tools/build/feature/test-libcrypto.c b/tools/build/feature/test-libcrypto.c
index bd79dc7f28d368..a98174e0569c87 100644
--- a/tools/build/feature/test-libcrypto.c
+++ b/tools/build/feature/test-libcrypto.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <openssl/sha.h>
#include <openssl/md5.h>
diff --git a/tools/build/feature/test-libdw-dwarf-unwind.c b/tools/build/feature/test-libdw-dwarf-unwind.c
index f676a3ff442a43..ed03d95056090c 100644
--- a/tools/build/feature/test-libdw-dwarf-unwind.c
+++ b/tools/build/feature/test-libdw-dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elfutils/libdwfl.h>
diff --git a/tools/build/feature/test-libelf-gelf_getnote.c b/tools/build/feature/test-libelf-gelf_getnote.c
index d78cf4d5271f14..075d062fe8419c 100644
--- a/tools/build/feature/test-libelf-gelf_getnote.c
+++ b/tools/build/feature/test-libelf-gelf_getnote.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <gelf.h>
diff --git a/tools/build/feature/test-libelf-getphdrnum.c b/tools/build/feature/test-libelf-getphdrnum.c
index d710459306c3aa..96a7f8d30a595e 100644
--- a/tools/build/feature/test-libelf-getphdrnum.c
+++ b/tools/build/feature/test-libelf-getphdrnum.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libelf.h>
int main(void)
diff --git a/tools/build/feature/test-libelf-getshdrstrndx.c b/tools/build/feature/test-libelf-getshdrstrndx.c
index f0c3b47cce281b..ae9f2fff5af073 100644
--- a/tools/build/feature/test-libelf-getshdrstrndx.c
+++ b/tools/build/feature/test-libelf-getshdrstrndx.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libelf.h>
int main(void)
diff --git a/tools/build/feature/test-libelf-mmap.c b/tools/build/feature/test-libelf-mmap.c
index 564427d7ef18d0..2c3ef81affe254 100644
--- a/tools/build/feature/test-libelf-mmap.c
+++ b/tools/build/feature/test-libelf-mmap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libelf.h>
int main(void)
diff --git a/tools/build/feature/test-libelf.c b/tools/build/feature/test-libelf.c
index 08db322d89576c..905044127d5646 100644
--- a/tools/build/feature/test-libelf.c
+++ b/tools/build/feature/test-libelf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libelf.h>
int main(void)
diff --git a/tools/build/feature/test-libnuma.c b/tools/build/feature/test-libnuma.c
index 4763d9cd587d51..b3aa59f8b3cb09 100644
--- a/tools/build/feature/test-libnuma.c
+++ b/tools/build/feature/test-libnuma.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <numa.h>
#include <numaif.h>
diff --git a/tools/build/feature/test-libperl.c b/tools/build/feature/test-libperl.c
index 8871f6a0fdb481..0415f437eb3180 100644
--- a/tools/build/feature/test-libperl.c
+++ b/tools/build/feature/test-libperl.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <EXTERN.h>
#include <perl.h>
diff --git a/tools/build/feature/test-libpython-version.c b/tools/build/feature/test-libpython-version.c
index facea122d812eb..47714b942d4d35 100644
--- a/tools/build/feature/test-libpython-version.c
+++ b/tools/build/feature/test-libpython-version.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <Python.h>
#if PY_VERSION_HEX >= 0x03000000
diff --git a/tools/build/feature/test-libpython.c b/tools/build/feature/test-libpython.c
index b24b28ad6324ec..0c1641b0d9a748 100644
--- a/tools/build/feature/test-libpython.c
+++ b/tools/build/feature/test-libpython.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <Python.h>
int main(void)
diff --git a/tools/build/feature/test-libslang.c b/tools/build/feature/test-libslang.c
index 22ff22ed94d1fe..9cbff8d1df53c7 100644
--- a/tools/build/feature/test-libslang.c
+++ b/tools/build/feature/test-libslang.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <slang.h>
int main(void)
diff --git a/tools/build/feature/test-libunwind-aarch64.c b/tools/build/feature/test-libunwind-aarch64.c
index fc03fb64e8c1d0..323803f49212aa 100644
--- a/tools/build/feature/test-libunwind-aarch64.c
+++ b/tools/build/feature/test-libunwind-aarch64.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-aarch64.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-arm.c b/tools/build/feature/test-libunwind-arm.c
index 632d95ec641f21..cb378b7d686694 100644
--- a/tools/build/feature/test-libunwind-arm.c
+++ b/tools/build/feature/test-libunwind-arm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-arm.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-debug-frame-aarch64.c b/tools/build/feature/test-libunwind-debug-frame-aarch64.c
index 22844673fc26d8..36d6646c185e15 100644
--- a/tools/build/feature/test-libunwind-debug-frame-aarch64.c
+++ b/tools/build/feature/test-libunwind-debug-frame-aarch64.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-aarch64.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-debug-frame-arm.c b/tools/build/feature/test-libunwind-debug-frame-arm.c
index f98859684feea0..8696e48e126843 100644
--- a/tools/build/feature/test-libunwind-debug-frame-arm.c
+++ b/tools/build/feature/test-libunwind-debug-frame-arm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-arm.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-debug-frame.c b/tools/build/feature/test-libunwind-debug-frame.c
index 0ef8087a104a7c..efb55cdd8d019d 100644
--- a/tools/build/feature/test-libunwind-debug-frame.c
+++ b/tools/build/feature/test-libunwind-debug-frame.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-x86.c b/tools/build/feature/test-libunwind-x86.c
index 3561edce305ea6..e5e0f6c896374b 100644
--- a/tools/build/feature/test-libunwind-x86.c
+++ b/tools/build/feature/test-libunwind-x86.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-x86.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind-x86_64.c b/tools/build/feature/test-libunwind-x86_64.c
index 5add2517b2a18a..62ae4db597dcaa 100644
--- a/tools/build/feature/test-libunwind-x86_64.c
+++ b/tools/build/feature/test-libunwind-x86_64.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind-x86_64.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-libunwind.c b/tools/build/feature/test-libunwind.c
index 43b9369bcab7d0..53fd26614ff0fc 100644
--- a/tools/build/feature/test-libunwind.c
+++ b/tools/build/feature/test-libunwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <libunwind.h>
#include <stdlib.h>
diff --git a/tools/build/feature/test-llvm-version.cpp b/tools/build/feature/test-llvm-version.cpp
index 896d317245685d..8a091625446af9 100644
--- a/tools/build/feature/test-llvm-version.cpp
+++ b/tools/build/feature/test-llvm-version.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <cstdio>
#include "llvm/Config/llvm-config.h"
diff --git a/tools/build/feature/test-llvm.cpp b/tools/build/feature/test-llvm.cpp
index 455a332dc8a8f6..88a3d1bdd9f697 100644
--- a/tools/build/feature/test-llvm.cpp
+++ b/tools/build/feature/test-llvm.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
#define NUM_VERSION (((LLVM_VERSION_MAJOR) << 16) + (LLVM_VERSION_MINOR << 8) + LLVM_VERSION_PATCH)
diff --git a/tools/build/feature/test-lzma.c b/tools/build/feature/test-lzma.c
index 95adc8ced3dd0c..78682bb01d5761 100644
--- a/tools/build/feature/test-lzma.c
+++ b/tools/build/feature/test-lzma.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <lzma.h>
int main(void)
diff --git a/tools/build/feature/test-numa_num_possible_cpus.c b/tools/build/feature/test-numa_num_possible_cpus.c
index 2606e94b065988..573d07b9c5703d 100644
--- a/tools/build/feature/test-numa_num_possible_cpus.c
+++ b/tools/build/feature/test-numa_num_possible_cpus.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <numa.h>
int main(void)
diff --git a/tools/build/feature/test-pthread-attr-setaffinity-np.c b/tools/build/feature/test-pthread-attr-setaffinity-np.c
index fdada5e8d454c5..38c71131c452e8 100644
--- a/tools/build/feature/test-pthread-attr-setaffinity-np.c
+++ b/tools/build/feature/test-pthread-attr-setaffinity-np.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdint.h>
#include <pthread.h>
#include <sched.h>
diff --git a/tools/build/feature/test-sched_getcpu.c b/tools/build/feature/test-sched_getcpu.c
index 9c6b4cbffb1cae..e448deb4124c1e 100644
--- a/tools/build/feature/test-sched_getcpu.c
+++ b/tools/build/feature/test-sched_getcpu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
diff --git a/tools/build/feature/test-sdt.c b/tools/build/feature/test-sdt.c
index e4531a6e80eaf9..22737b0dadc870 100644
--- a/tools/build/feature/test-sdt.c
+++ b/tools/build/feature/test-sdt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/sdt.h>
int main(void)
diff --git a/tools/build/feature/test-stackprotector-all.c b/tools/build/feature/test-stackprotector-all.c
index c9f398d8786820..c8a57194f9f29b 100644
--- a/tools/build/feature/test-stackprotector-all.c
+++ b/tools/build/feature/test-stackprotector-all.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
int main(void)
diff --git a/tools/build/feature/test-sync-compare-and-swap.c b/tools/build/feature/test-sync-compare-and-swap.c
index c34d4ca4af56eb..1e38d1930a972a 100644
--- a/tools/build/feature/test-sync-compare-and-swap.c
+++ b/tools/build/feature/test-sync-compare-and-swap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdint.h>
volatile uint64_t x;
diff --git a/tools/build/feature/test-timerfd.c b/tools/build/feature/test-timerfd.c
index 8c5c083b4d3caa..9c72c697a9df18 100644
--- a/tools/build/feature/test-timerfd.c
+++ b/tools/build/feature/test-timerfd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* test for timerfd functions used by perf-kvm-stat-live
*/
diff --git a/tools/build/feature/test-zlib.c b/tools/build/feature/test-zlib.c
index e111fff6240e06..da6c35794b93f9 100644
--- a/tools/build/feature/test-zlib.c
+++ b/tools/build/feature/test-zlib.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <zlib.h>
int main(void)
diff --git a/tools/build/fixdep.c b/tools/build/fixdep.c
index 734d1547cbaed6..2501fea7aa3e94 100644
--- a/tools/build/fixdep.c
+++ b/tools/build/fixdep.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* "Optimize" a list of dependencies as spit out by gcc -MD
* for the build framework.
diff --git a/tools/build/tests/ex/Makefile b/tools/build/tests/ex/Makefile
index 027d6c8a58a740..fee032e06a856a 100644
--- a/tools/build/tests/ex/Makefile
+++ b/tools/build/tests/ex/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
export srctree := $(abspath ../../../..)
export CC := gcc
export LD := ld
diff --git a/tools/build/tests/ex/a.c b/tools/build/tests/ex/a.c
index 851762798c8357..66017a9f40b6cd 100644
--- a/tools/build/tests/ex/a.c
+++ b/tools/build/tests/ex/a.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int a(void)
{
diff --git a/tools/build/tests/ex/arch/e.c b/tools/build/tests/ex/arch/e.c
index beaa4a1d7ba899..f6ef585b570cf5 100644
--- a/tools/build/tests/ex/arch/e.c
+++ b/tools/build/tests/ex/arch/e.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int e(void)
{
diff --git a/tools/build/tests/ex/arch/f.c b/tools/build/tests/ex/arch/f.c
index 7c3e9e9da5b76b..bffd9c67e9af4d 100644
--- a/tools/build/tests/ex/arch/f.c
+++ b/tools/build/tests/ex/arch/f.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int f(void)
{
diff --git a/tools/build/tests/ex/b.c b/tools/build/tests/ex/b.c
index c24ff9ca9a9725..2b29fb4d3c2013 100644
--- a/tools/build/tests/ex/b.c
+++ b/tools/build/tests/ex/b.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int b(void)
{
diff --git a/tools/build/tests/ex/c.c b/tools/build/tests/ex/c.c
index e216d02174997b..a63b20ab83d5ef 100644
--- a/tools/build/tests/ex/c.c
+++ b/tools/build/tests/ex/c.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int c(void)
{
diff --git a/tools/build/tests/ex/d.c b/tools/build/tests/ex/d.c
index 80dc0f06151b8e..e114e8dca0b6ca 100644
--- a/tools/build/tests/ex/d.c
+++ b/tools/build/tests/ex/d.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int d(void)
{
diff --git a/tools/build/tests/ex/ex.c b/tools/build/tests/ex/ex.c
index 57de6074d25285..3c02756ef912d9 100644
--- a/tools/build/tests/ex/ex.c
+++ b/tools/build/tests/ex/ex.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
int a(void);
int b(void);
diff --git a/tools/build/tests/ex/inc.c b/tools/build/tests/ex/inc.c
index c20f1e9033a365..3636ab5bf3392c 100644
--- a/tools/build/tests/ex/inc.c
+++ b/tools/build/tests/ex/inc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifdef INCLUDE
#include "krava.h"
#endif
diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
index 44d2a0fade677b..2c54e4d4354647 100755
--- a/tools/build/tests/run.sh
+++ b/tools/build/tests/run.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
function test_ex {
make -C ex V=1 clean > ex.out 2>&1
diff --git a/tools/cgroup/Makefile b/tools/cgroup/Makefile
index b4286196b763e6..860fa151640abd 100644
--- a/tools/cgroup/Makefile
+++ b/tools/cgroup/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for cgroup tools
CC = $(CROSS_COMPILE)gcc
diff --git a/tools/cgroup/cgroup_event_listener.c b/tools/cgroup/cgroup_event_listener.c
index 4eb5507205c981..3d70dc831a7667 100644
--- a/tools/cgroup/cgroup_event_listener.c
+++ b/tools/cgroup/cgroup_event_listener.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* cgroup_event_listener.c - Simple listener of cgroup events
*
diff --git a/tools/firewire/Makefile b/tools/firewire/Makefile
index 81767adaae7d15..67b6e9fca83cc8 100644
--- a/tools/firewire/Makefile
+++ b/tools/firewire/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
prefix = /usr
nosy-dump-version = 0.4
diff --git a/tools/firewire/decode-fcp.c b/tools/firewire/decode-fcp.c
index e41223b6a4c853..b67ebc88434d91 100644
--- a/tools/firewire/decode-fcp.c
+++ b/tools/firewire/decode-fcp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/firewire-constants.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tools/firewire/list.h b/tools/firewire/list.h
index 41f4bdadf6344e..6278d08e99e3d3 100644
--- a/tools/firewire/list.h
+++ b/tools/firewire/list.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
struct list {
struct list *next, *prev;
};
diff --git a/tools/firewire/nosy-dump.h b/tools/firewire/nosy-dump.h
index 3a4b5b33ba5d3a..69e5e594f28491 100644
--- a/tools/firewire/nosy-dump.h
+++ b/tools/firewire/nosy-dump.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __nosy_dump_h__
#define __nosy_dump_h__
diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index b4401536cfa90f..805a2c0cf4cd37 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../scripts/Makefile.include
bindir ?= /usr/bin
diff --git a/tools/hv/Makefile b/tools/hv/Makefile
index 0d1e61b818440e..31503819454d8d 100644
--- a/tools/hv/Makefile
+++ b/tools/hv/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for Hyper-V tools
CC = $(CROSS_COMPILE)gcc
diff --git a/tools/hv/hv_get_dhcp_info.sh b/tools/hv/hv_get_dhcp_info.sh
index ccd3e9532764e5..c38686c4465646 100755
--- a/tools/hv/hv_get_dhcp_info.sh
+++ b/tools/hv/hv_get_dhcp_info.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
# This example script retrieves the DHCP state of a given interface.
# In the interest of keeping the KVP daemon code free of distro specific
diff --git a/tools/hv/hv_set_ifconfig.sh b/tools/hv/hv_set_ifconfig.sh
index 735aafd64a3f2f..7ed9f85ef90851 100755
--- a/tools/hv/hv_set_ifconfig.sh
+++ b/tools/hv/hv_set_ifconfig.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
# This example script activates an interface based on the specified
# configuration.
diff --git a/tools/hv/lsvmbus b/tools/hv/lsvmbus
index e8fecd61871f46..353e56768df856 100644
--- a/tools/hv/lsvmbus
+++ b/tools/hv/lsvmbus
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# SPDX-License-Identifier: GPL-2.0
import os
from optparse import OptionParser
diff --git a/tools/iio/Makefile b/tools/iio/Makefile
index d4d956020adf5e..a08e7a47d6a32e 100644
--- a/tools/iio/Makefile
+++ b/tools/iio/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../scripts/Makefile.include
bindir ?= /usr/bin
diff --git a/tools/include/asm-generic/atomic-gcc.h b/tools/include/asm-generic/atomic-gcc.h
index 5e9738f97bf38f..40b231fb95bd28 100644
--- a/tools/include/asm-generic/atomic-gcc.h
+++ b/tools/include/asm-generic/atomic-gcc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_ASM_GENERIC_ATOMIC_H
#define __TOOLS_ASM_GENERIC_ATOMIC_H
diff --git a/tools/include/asm-generic/bitops.h b/tools/include/asm-generic/bitops.h
index 0304600121daa9..9bce3b56b5e74c 100644
--- a/tools/include/asm-generic/bitops.h
+++ b/tools/include/asm-generic/bitops.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_ASM_GENERIC_BITOPS_H
#define __TOOLS_ASM_GENERIC_BITOPS_H
diff --git a/tools/include/asm-generic/bitops/__ffs.h b/tools/include/asm-generic/bitops/__ffs.h
index b3accfdf24b9b2..9d131051949709 100644
--- a/tools/include/asm-generic/bitops/__ffs.h
+++ b/tools/include/asm-generic/bitops/__ffs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS___FFS_H_
#define _TOOLS_LINUX_ASM_GENERIC_BITOPS___FFS_H_
diff --git a/tools/include/asm-generic/bitops/__fls.h b/tools/include/asm-generic/bitops/__fls.h
index a60a7ccb6782d8..03f721a8a2b199 100644
--- a/tools/include/asm-generic/bitops/__fls.h
+++ b/tools/include/asm-generic/bitops/__fls.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS___FLS_H_
#define _ASM_GENERIC_BITOPS___FLS_H_
diff --git a/tools/include/asm-generic/bitops/arch_hweight.h b/tools/include/asm-generic/bitops/arch_hweight.h
index 6a211f40665c02..c2705e1d220d15 100644
--- a/tools/include/asm-generic/bitops/arch_hweight.h
+++ b/tools/include/asm-generic/bitops/arch_hweight.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_
#define _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_
diff --git a/tools/include/asm-generic/bitops/atomic.h b/tools/include/asm-generic/bitops/atomic.h
index 68b8c1516c5a71..21c41ccd126667 100644
--- a/tools/include/asm-generic/bitops/atomic.h
+++ b/tools/include/asm-generic/bitops/atomic.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_
#define _TOOLS_LINUX_ASM_GENERIC_BITOPS_ATOMIC_H_
diff --git a/tools/include/asm-generic/bitops/const_hweight.h b/tools/include/asm-generic/bitops/const_hweight.h
index 0a7e0662347058..149faeeeeaf2cc 100644
--- a/tools/include/asm-generic/bitops/const_hweight.h
+++ b/tools/include/asm-generic/bitops/const_hweight.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_
#define _ASM_GENERIC_BITOPS_CONST_HWEIGHT_H_
diff --git a/tools/include/asm-generic/bitops/find.h b/tools/include/asm-generic/bitops/find.h
index 5538ecdc964a2f..9311fadaaab20f 100644
--- a/tools/include/asm-generic/bitops/find.h
+++ b/tools/include/asm-generic/bitops/find.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_
#define _TOOLS_LINUX_ASM_GENERIC_BITOPS_FIND_H_
diff --git a/tools/include/asm-generic/bitops/fls.h b/tools/include/asm-generic/bitops/fls.h
index 0576d1f42f43fc..753aecaab641a8 100644
--- a/tools/include/asm-generic/bitops/fls.h
+++ b/tools/include/asm-generic/bitops/fls.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS_FLS_H_
#define _ASM_GENERIC_BITOPS_FLS_H_
diff --git a/tools/include/asm-generic/bitops/fls64.h b/tools/include/asm-generic/bitops/fls64.h
index b097cf8444e3f9..866f2b2304ff63 100644
--- a/tools/include/asm-generic/bitops/fls64.h
+++ b/tools/include/asm-generic/bitops/fls64.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_GENERIC_BITOPS_FLS64_H_
#define _ASM_GENERIC_BITOPS_FLS64_H_
diff --git a/tools/include/asm-generic/bitops/hweight.h b/tools/include/asm-generic/bitops/hweight.h
index 290120c01a8e77..3e681982bcd102 100644
--- a/tools/include/asm-generic/bitops/hweight.h
+++ b/tools/include/asm-generic/bitops/hweight.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_
#define _TOOLS_LINUX_ASM_GENERIC_BITOPS_HWEIGHT_H_
diff --git a/tools/include/asm-generic/bitsperlong.h b/tools/include/asm-generic/bitsperlong.h
index 45eca517efb321..8f2283052333e0 100644
--- a/tools/include/asm-generic/bitsperlong.h
+++ b/tools/include/asm-generic/bitsperlong.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_GENERIC_BITS_PER_LONG
#define __ASM_GENERIC_BITS_PER_LONG
diff --git a/tools/include/asm/alternative-asm.h b/tools/include/asm/alternative-asm.h
index 2a4d1bfa298848..b54bd860dff6ff 100644
--- a/tools/include/asm/alternative-asm.h
+++ b/tools/include/asm/alternative-asm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_ASM_ALTERNATIVE_ASM_H
#define _TOOLS_ASM_ALTERNATIVE_ASM_H
diff --git a/tools/include/asm/atomic.h b/tools/include/asm/atomic.h
index 70794f538a8601..8c9bfffd4191d4 100644
--- a/tools/include/asm/atomic.h
+++ b/tools/include/asm/atomic.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_ASM_ATOMIC_H
#define __TOOLS_LINUX_ASM_ATOMIC_H
diff --git a/tools/include/asm/barrier.h b/tools/include/asm/barrier.h
index ac66ac5946852d..391d942536e53e 100644
--- a/tools/include/asm/barrier.h
+++ b/tools/include/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#if defined(__i386__) || defined(__x86_64__)
#include "../../arch/x86/include/asm/barrier.h"
#elif defined(__arm__)
diff --git a/tools/include/asm/bug.h b/tools/include/asm/bug.h
index 4790f047a89c47..bbd75ac8b20292 100644
--- a/tools/include/asm/bug.h
+++ b/tools/include/asm/bug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_ASM_BUG_H
#define _TOOLS_ASM_BUG_H
diff --git a/tools/include/asm/export.h b/tools/include/asm/export.h
new file mode 100644
index 00000000000000..2cb1a0d8303550
--- /dev/null
+++ b/tools/include/asm/export.h
@@ -0,0 +1,7 @@
+#ifndef _TOOLS_ASM_EXPORT_H
+#define _TOOLS_ASM_EXPORT_H
+
+#define EXPORT_SYMBOL(x)
+#define EXPORT_SYMBOL_GPL(x)
+
+#endif /* _TOOLS_ASM_EXPORT_H */
diff --git a/tools/include/linux/atomic.h b/tools/include/linux/atomic.h
index 9f21fc2b092b83..00a6c4ca562b93 100644
--- a/tools/include/linux/atomic.h
+++ b/tools/include/linux/atomic.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_ATOMIC_H
#define __TOOLS_LINUX_ATOMIC_H
diff --git a/tools/include/linux/bitmap.h b/tools/include/linux/bitmap.h
index e8b9f518e36b2c..ca160270fdfafb 100644
--- a/tools/include/linux/bitmap.h
+++ b/tools/include/linux/bitmap.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_BITOPS_H
#define _PERF_BITOPS_H
diff --git a/tools/include/linux/bitops.h b/tools/include/linux/bitops.h
index 969db1981868cc..acc704bd3998cf 100644
--- a/tools/include/linux/bitops.h
+++ b/tools/include/linux/bitops.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_BITOPS_H_
#define _TOOLS_LINUX_BITOPS_H_
diff --git a/tools/include/linux/bug.h b/tools/include/linux/bug.h
index 8e4a4f49135d40..85f80258a15f6c 100644
--- a/tools/include/linux/bug.h
+++ b/tools/include/linux/bug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_PERF_LINUX_BUG_H
#define _TOOLS_PERF_LINUX_BUG_H
diff --git a/tools/include/linux/compiler-gcc.h b/tools/include/linux/compiler-gcc.h
index 3723b9f8f96436..a3a4427441bfe9 100644
--- a/tools/include/linux/compiler-gcc.h
+++ b/tools/include/linux/compiler-gcc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_COMPILER_H_
#error "Please don't include <linux/compiler-gcc.h> directly, include <linux/compiler.h> instead."
#endif
diff --git a/tools/include/linux/compiler.h b/tools/include/linux/compiler.h
index d7a5604c38d790..07fd03c74a775a 100644
--- a/tools/include/linux/compiler.h
+++ b/tools/include/linux/compiler.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_COMPILER_H_
#define _TOOLS_LINUX_COMPILER_H_
diff --git a/tools/include/linux/debug_locks.h b/tools/include/linux/debug_locks.h
index 61cc7f501168b3..72d595ce764ae9 100644
--- a/tools/include/linux/debug_locks.h
+++ b/tools/include/linux/debug_locks.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_DEBUG_LOCKS_H_
#define _LIBLOCKDEP_DEBUG_LOCKS_H_
diff --git a/tools/include/linux/err.h b/tools/include/linux/err.h
index abf0478a8fb28f..7a8b61ad44cbe0 100644
--- a/tools/include/linux/err.h
+++ b/tools/include/linux/err.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_ERR_H
#define __TOOLS_LINUX_ERR_H
diff --git a/tools/include/linux/filter.h b/tools/include/linux/filter.h
index 4ce25d43e8e305..c5e512da8d8aa0 100644
--- a/tools/include/linux/filter.h
+++ b/tools/include/linux/filter.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Linux Socket Filter Data Structures
*/
diff --git a/tools/include/linux/hardirq.h b/tools/include/linux/hardirq.h
index c8f3f8f58729b1..b25580b6a9be40 100644
--- a/tools/include/linux/hardirq.h
+++ b/tools/include/linux/hardirq.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_HARDIRQ_H_
#define _LIBLOCKDEP_LINUX_HARDIRQ_H_
diff --git a/tools/include/linux/hashtable.h b/tools/include/linux/hashtable.h
index 251eabf2a05e91..434dd5ac6d712e 100644
--- a/tools/include/linux/hashtable.h
+++ b/tools/include/linux/hashtable.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Statically sized hash table implementation
* (C) 2012 Sasha Levin <levinsasha928@gmail.com>
diff --git a/tools/include/linux/irqflags.h b/tools/include/linux/irqflags.h
index df77669cfe1c1d..e734da3e5b332c 100644
--- a/tools/include/linux/irqflags.h
+++ b/tools/include/linux/irqflags.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_TRACE_IRQFLAGS_H_
#define _LIBLOCKDEP_LINUX_TRACE_IRQFLAGS_H_
diff --git a/tools/include/linux/kallsyms.h b/tools/include/linux/kallsyms.h
index 582cc1e5f3a4ee..89ca6fe257ccb9 100644
--- a/tools/include/linux/kallsyms.h
+++ b/tools/include/linux/kallsyms.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_KALLSYMS_H_
#define _LIBLOCKDEP_LINUX_KALLSYMS_H_
diff --git a/tools/include/linux/kern_levels.h b/tools/include/linux/kern_levels.h
index 3b9bade286988f..778ecb98448058 100644
--- a/tools/include/linux/kern_levels.h
+++ b/tools/include/linux/kern_levels.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __KERN_LEVELS_H__
#define __KERN_LEVELS_H__
diff --git a/tools/include/linux/kernel.h b/tools/include/linux/kernel.h
index 77d2e94ca5dfbe..0ad884452c5cee 100644
--- a/tools/include/linux/kernel.h
+++ b/tools/include/linux/kernel.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_KERNEL_H
#define __TOOLS_LINUX_KERNEL_H
diff --git a/tools/include/linux/kmemcheck.h b/tools/include/linux/kmemcheck.h
index 94d598bc6abe95..2bccd2c7b8974e 100644
--- a/tools/include/linux/kmemcheck.h
+++ b/tools/include/linux/kmemcheck.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_KMEMCHECK_H_
#define _LIBLOCKDEP_LINUX_KMEMCHECK_H_
diff --git a/tools/include/linux/list.h b/tools/include/linux/list.h
index 1da423820ad4fb..b2fc48d5478c74 100644
--- a/tools/include/linux/list.h
+++ b/tools/include/linux/list.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_LINUX_LIST_H
#define __TOOLS_LINUX_LIST_H
diff --git a/tools/include/linux/lockdep.h b/tools/include/linux/lockdep.h
index 8da3e8effafa72..940c1b0756591e 100644
--- a/tools/include/linux/lockdep.h
+++ b/tools/include/linux/lockdep.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LOCKDEP_H_
#define _LIBLOCKDEP_LOCKDEP_H_
diff --git a/tools/include/linux/module.h b/tools/include/linux/module.h
index 07055db296f30a..2c999abf68e7ac 100644
--- a/tools/include/linux/module.h
+++ b/tools/include/linux/module.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_MODULE_H_
#define _LIBLOCKDEP_LINUX_MODULE_H_
diff --git a/tools/include/linux/poison.h b/tools/include/linux/poison.h
index f306a764250982..9fdcd3eaac3b3b 100644
--- a/tools/include/linux/poison.h
+++ b/tools/include/linux/poison.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_POISON_H
#define _LINUX_POISON_H
diff --git a/tools/include/linux/rcu.h b/tools/include/linux/rcu.h
index 5080649dad0498..7d02527e5bcea4 100644
--- a/tools/include/linux/rcu.h
+++ b/tools/include/linux/rcu.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_RCU_H_
#define _LIBLOCKDEP_RCU_H_
diff --git a/tools/include/linux/refcount.h b/tools/include/linux/refcount.h
index a0177c1f55b14c..36cb29bc57c2db 100644
--- a/tools/include/linux/refcount.h
+++ b/tools/include/linux/refcount.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_REFCOUNT_H
#define _TOOLS_LINUX_REFCOUNT_H
diff --git a/tools/include/linux/spinlock.h b/tools/include/linux/spinlock.h
index 417cda4f793fc8..4ed569fcb1390c 100644
--- a/tools/include/linux/spinlock.h
+++ b/tools/include/linux/spinlock.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_SPINLOCK_H_
#define __LINUX_SPINLOCK_H_
diff --git a/tools/include/linux/stacktrace.h b/tools/include/linux/stacktrace.h
index 39aecc6b19d1ab..ae343ac35bfa7e 100644
--- a/tools/include/linux/stacktrace.h
+++ b/tools/include/linux/stacktrace.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_LINUX_STACKTRACE_H_
#define _LIBLOCKDEP_LINUX_STACKTRACE_H_
diff --git a/tools/include/linux/string.h b/tools/include/linux/string.h
index a30fad536f5208..6c3e2cc274c554 100644
--- a/tools/include/linux/string.h
+++ b/tools/include/linux/string.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_STRING_H_
#define _TOOLS_LINUX_STRING_H_
diff --git a/tools/include/linux/stringify.h b/tools/include/linux/stringify.h
index 841cec8ed525e3..60e2c187da2cd5 100644
--- a/tools/include/linux/stringify.h
+++ b/tools/include/linux/stringify.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_STRINGIFY_H
#define __LINUX_STRINGIFY_H
diff --git a/tools/include/linux/time64.h b/tools/include/linux/time64.h
index df9265483d65ce..55fa644b95fd50 100644
--- a/tools/include/linux/time64.h
+++ b/tools/include/linux/time64.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_TIME64_H
#define _TOOLS_LINUX_TIME64_H
diff --git a/tools/include/linux/types.h b/tools/include/linux/types.h
index 77a28a26a6709f..154eb4e3ca7c2b 100644
--- a/tools/include/linux/types.h
+++ b/tools/include/linux/types.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LINUX_TYPES_H_
#define _TOOLS_LINUX_TYPES_H_
diff --git a/tools/include/linux/unaligned/packed_struct.h b/tools/include/linux/unaligned/packed_struct.h
index c0d817de4df24e..dbd93c7df2e1da 100644
--- a/tools/include/linux/unaligned/packed_struct.h
+++ b/tools/include/linux/unaligned/packed_struct.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_UNALIGNED_PACKED_STRUCT_H
#define _LINUX_UNALIGNED_PACKED_STRUCT_H
diff --git a/tools/include/tools/be_byteshift.h b/tools/include/tools/be_byteshift.h
index 84c17d836578a0..f7d1d169893853 100644
--- a/tools/include/tools/be_byteshift.h
+++ b/tools/include/tools/be_byteshift.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_BE_BYTESHIFT_H
#define _TOOLS_BE_BYTESHIFT_H
diff --git a/tools/include/tools/endian.h b/tools/include/tools/endian.h
index 8001194008da05..c67888fd427ec8 100644
--- a/tools/include/tools/endian.h
+++ b/tools/include/tools/endian.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_ENDIAN_H
#define _TOOLS_ENDIAN_H
diff --git a/tools/include/tools/le_byteshift.h b/tools/include/tools/le_byteshift.h
index 8fe9f2488ec707..dc8565f3971768 100644
--- a/tools/include/tools/le_byteshift.h
+++ b/tools/include/tools/le_byteshift.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TOOLS_LE_BYTESHIFT_H
#define _TOOLS_LE_BYTESHIFT_H
diff --git a/tools/include/uapi/asm-generic/ioctls.h b/tools/include/uapi/asm-generic/ioctls.h
index 14baf9f23a14b9..04065173566298 100644
--- a/tools/include/uapi/asm-generic/ioctls.h
+++ b/tools/include/uapi/asm-generic/ioctls.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_GENERIC_IOCTLS_H
#define __ASM_GENERIC_IOCTLS_H
diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h
index 203268f9231e15..6d319c46fd9034 100644
--- a/tools/include/uapi/asm-generic/mman-common.h
+++ b/tools/include/uapi/asm-generic/mman-common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_GENERIC_MMAN_COMMON_H
#define __ASM_GENERIC_MMAN_COMMON_H
diff --git a/tools/include/uapi/asm-generic/mman.h b/tools/include/uapi/asm-generic/mman.h
index 10fa7857777fa2..2dffcbf705b378 100644
--- a/tools/include/uapi/asm-generic/mman.h
+++ b/tools/include/uapi/asm-generic/mman.h
@@ -1,7 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __ASM_GENERIC_MMAN_H
#define __ASM_GENERIC_MMAN_H
-#include <uapi/asm-generic/mman-common.h>
+#include <asm-generic/mman-common.h>
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 24b35a1fd4d67e..30f2ce76b5170c 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/* Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
*
* This program is free software; you can redistribute it and/or
@@ -569,14 +570,13 @@ union bpf_attr {
* @flags: reserved for future use
* Return: 0 on success or negative error code
*
- * int bpf_sk_redirect_map(skb, map, key, flags)
+ * int bpf_sk_redirect_map(map, key, flags)
* Redirect skb to a sock in map using key as a lookup key for the
* sock in map.
- * @skb: pointer to skb
* @map: pointer to sockmap
* @key: key to lookup sock in map
* @flags: reserved for future use
- * Return: SK_REDIRECT
+ * Return: SK_PASS
*
* int bpf_sock_map_update(skops, map, key, flags)
* @skops: pointer to bpf_sock_ops
@@ -787,9 +787,8 @@ struct xdp_md {
};
enum sk_action {
- SK_ABORTED = 0,
- SK_DROP,
- SK_REDIRECT,
+ SK_DROP = 0,
+ SK_PASS,
};
#define BPF_TAG_SIZE 8
diff --git a/tools/include/uapi/linux/bpf_common.h b/tools/include/uapi/linux/bpf_common.h
index a5c220e0828f32..18be90725ab04a 100644
--- a/tools/include/uapi/linux/bpf_common.h
+++ b/tools/include/uapi/linux/bpf_common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI__LINUX_BPF_COMMON_H__
#define _UAPI__LINUX_BPF_COMMON_H__
diff --git a/tools/include/uapi/linux/fcntl.h b/tools/include/uapi/linux/fcntl.h
index ec69d55bcec739..6448cdd9a350d3 100644
--- a/tools/include/uapi/linux/fcntl.h
+++ b/tools/include/uapi/linux/fcntl.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_FCNTL_H
#define _UAPI_LINUX_FCNTL_H
diff --git a/tools/include/uapi/linux/hw_breakpoint.h b/tools/include/uapi/linux/hw_breakpoint.h
index 2b65efd19a4698..965e4d8606d81a 100644
--- a/tools/include/uapi/linux/hw_breakpoint.h
+++ b/tools/include/uapi/linux/hw_breakpoint.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_HW_BREAKPOINT_H
#define _UAPI_LINUX_HW_BREAKPOINT_H
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 83888758741184..7e99999d6236fa 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef __LINUX_KVM_H
#define __LINUX_KVM_H
diff --git a/tools/include/uapi/linux/mman.h b/tools/include/uapi/linux/mman.h
index a937480d7cd345..bfd5938fede6c1 100644
--- a/tools/include/uapi/linux/mman.h
+++ b/tools/include/uapi/linux/mman.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_MMAN_H
#define _UAPI_LINUX_MMAN_H
diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index 140ae638cfd618..362493a2f950b3 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
/*
* Performance events:
*
diff --git a/tools/include/uapi/linux/sched.h b/tools/include/uapi/linux/sched.h
index e2a6c7b3510b4a..30a9e51bbb1e58 100644
--- a/tools/include/uapi/linux/sched.h
+++ b/tools/include/uapi/linux/sched.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_SCHED_H
#define _UAPI_LINUX_SCHED_H
diff --git a/tools/include/uapi/linux/stat.h b/tools/include/uapi/linux/stat.h
index 17b10304c39335..7b35e98d3c58b1 100644
--- a/tools/include/uapi/linux/stat.h
+++ b/tools/include/uapi/linux/stat.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_STAT_H
#define _UAPI_LINUX_STAT_H
diff --git a/tools/include/uapi/linux/vhost.h b/tools/include/uapi/linux/vhost.h
index 60180c0b5dc6a5..c51f8e5cc6080c 100644
--- a/tools/include/uapi/linux/vhost.h
+++ b/tools/include/uapi/linux/vhost.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _LINUX_VHOST_H
#define _LINUX_VHOST_H
/* Userspace interface for in-kernel virtio accelerators. */
diff --git a/tools/include/uapi/sound/asound.h b/tools/include/uapi/sound/asound.h
index 87bf30b182dfd0..c227ccba60aee2 100644
--- a/tools/include/uapi/sound/asound.h
+++ b/tools/include/uapi/sound/asound.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
/*
* Advanced Linux Sound Architecture - ALSA - Driver
* Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
diff --git a/tools/kvm/kvm_stat/Makefile b/tools/kvm/kvm_stat/Makefile
index 5b1cba57e3b3a2..c3e36c60d47783 100644
--- a/tools/kvm/kvm_stat/Makefile
+++ b/tools/kvm/kvm_stat/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../../scripts/Makefile.include
include ../../scripts/utilities.mak
BINDIR=usr/bin
diff --git a/tools/laptop/dslm/Makefile b/tools/laptop/dslm/Makefile
index ff613b31730b34..90f512c4e2bba0 100644
--- a/tools/laptop/dslm/Makefile
+++ b/tools/laptop/dslm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC := $(CROSS_COMPILE)gcc
CFLAGS := -I../../usr/include
diff --git a/tools/laptop/freefall/Makefile b/tools/laptop/freefall/Makefile
index 48c6c93284194a..5f758c489a208c 100644
--- a/tools/laptop/freefall/Makefile
+++ b/tools/laptop/freefall/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
PREFIX ?= /usr
SBINDIR ?= sbin
INSTALL ?= install
diff --git a/tools/leds/Makefile b/tools/leds/Makefile
index 078b666fd78b8a..c379af003807ad 100644
--- a/tools/leds/Makefile
+++ b/tools/leds/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for LEDs tools
CC = $(CROSS_COMPILE)gcc
diff --git a/tools/leds/led_hw_brightness_mon.c b/tools/leds/led_hw_brightness_mon.c
index 64642ccfe442c4..eb65ae988839f9 100644
--- a/tools/leds/led_hw_brightness_mon.c
+++ b/tools/leds/led_hw_brightness_mon.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* led_hw_brightness_mon.c
*
diff --git a/tools/leds/uledmon.c b/tools/leds/uledmon.c
index 25cbc7acf50a04..c15a39c1f27141 100644
--- a/tools/leds/uledmon.c
+++ b/tools/leds/uledmon.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* uledmon.c
*
diff --git a/tools/lib/api/Makefile b/tools/lib/api/Makefile
index 1e83e3c0744845..a13e9c7f1fc500 100644
--- a/tools/lib/api/Makefile
+++ b/tools/lib/api/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN
diff --git a/tools/lib/api/cpu.c b/tools/lib/api/cpu.c
index 8c6489356e3ac7..4af6d4b7aa0751 100644
--- a/tools/lib/api/cpu.c
+++ b/tools/lib/api/cpu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include "cpu.h"
diff --git a/tools/lib/api/cpu.h b/tools/lib/api/cpu.h
index 81e9d3955961ef..90a102fb20dedd 100644
--- a/tools/lib/api/cpu.h
+++ b/tools/lib/api/cpu.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_CPU__
#define __API_CPU__
diff --git a/tools/lib/api/debug-internal.h b/tools/lib/api/debug-internal.h
index 188f7880eafe67..80c783497d25bc 100644
--- a/tools/lib/api/debug-internal.h
+++ b/tools/lib/api/debug-internal.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_DEBUG_INTERNAL_H__
#define __API_DEBUG_INTERNAL_H__
diff --git a/tools/lib/api/debug.c b/tools/lib/api/debug.c
index 5fa5cf500a1f96..69b1ba3d1ee380 100644
--- a/tools/lib/api/debug.c
+++ b/tools/lib/api/debug.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdarg.h>
#include "debug.h"
diff --git a/tools/lib/api/debug.h b/tools/lib/api/debug.h
index a0872f68fc56bb..3684dd6e0c02d5 100644
--- a/tools/lib/api/debug.h
+++ b/tools/lib/api/debug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_DEBUG_H__
#define __API_DEBUG_H__
diff --git a/tools/lib/api/fd/array.h b/tools/lib/api/fd/array.h
index 71287dddc05fbf..b39557d1a88f93 100644
--- a/tools/lib/api/fd/array.h
+++ b/tools/lib/api/fd/array.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_FD_ARRAY__
#define __API_FD_ARRAY__
diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index a7ecf8f469f479..b24afc0e6e81c4 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <ctype.h>
#include <errno.h>
#include <limits.h>
diff --git a/tools/lib/api/fs/fs.h b/tools/lib/api/fs/fs.h
index 45605348461e2f..dda49deefb5212 100644
--- a/tools/lib/api/fs/fs.h
+++ b/tools/lib/api/fs/fs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_FS__
#define __API_FS__
diff --git a/tools/lib/api/fs/tracing_path.c b/tools/lib/api/fs/tracing_path.c
index 3e606b9c443efb..7b7fd0b1855105 100644
--- a/tools/lib/api/fs/tracing_path.c
+++ b/tools/lib/api/fs/tracing_path.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
diff --git a/tools/lib/api/fs/tracing_path.h b/tools/lib/api/fs/tracing_path.h
index 3f233ac70b6f77..0066f06cc3817c 100644
--- a/tools/lib/api/fs/tracing_path.h
+++ b/tools/lib/api/fs/tracing_path.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __API_FS_TRACING_PATH_H
#define __API_FS_TRACING_PATH_H
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index d2441db34740df..4555304dc18e6a 100644
--- a/tools/lib/bpf/Makefile
+++ b/tools/lib/bpf/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Most of this file is copied from tools/lib/traceevent/Makefile
BPF_VERSION = 0
diff --git a/tools/lib/hweight.c b/tools/lib/hweight.c
index 0b859b8843390f..a16ebf51541707 100644
--- a/tools/lib/hweight.c
+++ b/tools/lib/hweight.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/bitops.h>
#include <asm/types.h>
diff --git a/tools/lib/lockdep/Makefile b/tools/lib/lockdep/Makefile
index ed9ace59d11206..9b0ca3ad1ef386 100644
--- a/tools/lib/lockdep/Makefile
+++ b/tools/lib/lockdep/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# file format version
FILE_VERSION = 1
diff --git a/tools/lib/lockdep/common.c b/tools/lib/lockdep/common.c
index d1c89cc06f5f67..5c3b58cce8a9b9 100644
--- a/tools/lib/lockdep/common.c
+++ b/tools/lib/lockdep/common.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stddef.h>
#include <stdbool.h>
#include <linux/compiler.h>
diff --git a/tools/lib/lockdep/include/liblockdep/common.h b/tools/lib/lockdep/include/liblockdep/common.h
index 6e66277ec4375c..8862da80995a8f 100644
--- a/tools/lib/lockdep/include/liblockdep/common.h
+++ b/tools/lib/lockdep/include/liblockdep/common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_COMMON_H
#define _LIBLOCKDEP_COMMON_H
diff --git a/tools/lib/lockdep/include/liblockdep/mutex.h b/tools/lib/lockdep/include/liblockdep/mutex.h
index ee53a42818caee..a80ac39f966ed3 100644
--- a/tools/lib/lockdep/include/liblockdep/mutex.h
+++ b/tools/lib/lockdep/include/liblockdep/mutex.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_MUTEX_H
#define _LIBLOCKDEP_MUTEX_H
diff --git a/tools/lib/lockdep/include/liblockdep/rwlock.h b/tools/lib/lockdep/include/liblockdep/rwlock.h
index 4ec03f86155163..a96c3bf0fef121 100644
--- a/tools/lib/lockdep/include/liblockdep/rwlock.h
+++ b/tools/lib/lockdep/include/liblockdep/rwlock.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_RWLOCK_H
#define _LIBLOCKDEP_RWLOCK_H
diff --git a/tools/lib/lockdep/lockdep.c b/tools/lib/lockdep/lockdep.c
index ced6d7443cea2e..6002fcf2f9bc3e 100644
--- a/tools/lib/lockdep/lockdep.c
+++ b/tools/lib/lockdep/lockdep.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/lockdep.h>
#include <stdlib.h>
diff --git a/tools/lib/lockdep/preload.c b/tools/lib/lockdep/preload.c
index 6a2d3c5d4e92b9..76245d16196deb 100644
--- a/tools/lib/lockdep/preload.c
+++ b/tools/lib/lockdep/preload.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh
index f9b94098fc98e1..2e570a188f1675 100755
--- a/tools/lib/lockdep/run_tests.sh
+++ b/tools/lib/lockdep/run_tests.sh
@@ -1,4 +1,5 @@
#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
make &> /dev/null
diff --git a/tools/lib/lockdep/tests/AA.c b/tools/lib/lockdep/tests/AA.c
index 18211a5f354fe5..63c7ce97bda3a9 100644
--- a/tools/lib/lockdep/tests/AA.c
+++ b/tools/lib/lockdep/tests/AA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
int main(void)
diff --git a/tools/lib/lockdep/tests/ABA.c b/tools/lib/lockdep/tests/ABA.c
index 0f782ff404ac65..efa39b23f05d0c 100644
--- a/tools/lib/lockdep/tests/ABA.c
+++ b/tools/lib/lockdep/tests/ABA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
void main(void)
diff --git a/tools/lib/lockdep/tests/ABBA.c b/tools/lib/lockdep/tests/ABBA.c
index 07f0e29d548595..1460afd33d712c 100644
--- a/tools/lib/lockdep/tests/ABBA.c
+++ b/tools/lib/lockdep/tests/ABBA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/ABBA_2threads.c b/tools/lib/lockdep/tests/ABBA_2threads.c
index cd807d7363611f..39325ef8a2ac17 100644
--- a/tools/lib/lockdep/tests/ABBA_2threads.c
+++ b/tools/lib/lockdep/tests/ABBA_2threads.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <pthread.h>
diff --git a/tools/lib/lockdep/tests/ABBCCA.c b/tools/lib/lockdep/tests/ABBCCA.c
index 843db09ac666c1..a54c1b2af11824 100644
--- a/tools/lib/lockdep/tests/ABBCCA.c
+++ b/tools/lib/lockdep/tests/ABBCCA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/ABBCCDDA.c b/tools/lib/lockdep/tests/ABBCCDDA.c
index 33620e268f85f3..aa5d194e88694e 100644
--- a/tools/lib/lockdep/tests/ABBCCDDA.c
+++ b/tools/lib/lockdep/tests/ABBCCDDA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/ABCABC.c b/tools/lib/lockdep/tests/ABCABC.c
index 3fee51e3a68a5b..b54a08e60416f0 100644
--- a/tools/lib/lockdep/tests/ABCABC.c
+++ b/tools/lib/lockdep/tests/ABCABC.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/ABCDBCDA.c b/tools/lib/lockdep/tests/ABCDBCDA.c
index 427ba562c75b0d..a56742250d86f1 100644
--- a/tools/lib/lockdep/tests/ABCDBCDA.c
+++ b/tools/lib/lockdep/tests/ABCDBCDA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/ABCDBDDA.c b/tools/lib/lockdep/tests/ABCDBDDA.c
index 680c6cf3e919c9..238a3353f3c353 100644
--- a/tools/lib/lockdep/tests/ABCDBDDA.c
+++ b/tools/lib/lockdep/tests/ABCDBDDA.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
#include "common.h"
diff --git a/tools/lib/lockdep/tests/WW.c b/tools/lib/lockdep/tests/WW.c
index d44f77d710298c..eee88df7fc41b9 100644
--- a/tools/lib/lockdep/tests/WW.c
+++ b/tools/lib/lockdep/tests/WW.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/rwlock.h>
void main(void)
diff --git a/tools/lib/lockdep/tests/common.h b/tools/lib/lockdep/tests/common.h
index d89e94d47d86c6..3026c29ccb5c36 100644
--- a/tools/lib/lockdep/tests/common.h
+++ b/tools/lib/lockdep/tests/common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIBLOCKDEP_TEST_COMMON_H
#define _LIBLOCKDEP_TEST_COMMON_H
diff --git a/tools/lib/lockdep/tests/unlock_balance.c b/tools/lib/lockdep/tests/unlock_balance.c
index 0bc62de686f7b4..34cf32f689de00 100644
--- a/tools/lib/lockdep/tests/unlock_balance.c
+++ b/tools/lib/lockdep/tests/unlock_balance.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <liblockdep/mutex.h>
void main(void)
diff --git a/tools/lib/str_error_r.c b/tools/lib/str_error_r.c
index 503ae072244cb2..d6d65537b0d9ba 100644
--- a/tools/lib/str_error_r.c
+++ b/tools/lib/str_error_r.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#undef _GNU_SOURCE
#include <string.h>
#include <stdio.h>
diff --git a/tools/lib/string.c b/tools/lib/string.c
index a4246f14ded101..93b3d4b6feac37 100644
--- a/tools/lib/string.c
+++ b/tools/lib/string.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* linux/tools/lib/string.c
*
diff --git a/tools/lib/subcmd/Makefile b/tools/lib/subcmd/Makefile
index 7e9f03c97e4c60..95563b8e1ad743 100644
--- a/tools/lib/subcmd/Makefile
+++ b/tools/lib/subcmd/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../../scripts/Makefile.include
include ../../scripts/utilities.mak # QUIET_CLEAN
diff --git a/tools/lib/subcmd/exec-cmd.c b/tools/lib/subcmd/exec-cmd.c
index 1ae833af1a4af4..33e94fb8398677 100644
--- a/tools/lib/subcmd/exec-cmd.c
+++ b/tools/lib/subcmd/exec-cmd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/string.h>
#include <sys/types.h>
diff --git a/tools/lib/subcmd/exec-cmd.h b/tools/lib/subcmd/exec-cmd.h
index 5d08bda31d90f5..aba591b8d25480 100644
--- a/tools/lib/subcmd/exec-cmd.h
+++ b/tools/lib/subcmd/exec-cmd.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_EXEC_CMD_H
#define __SUBCMD_EXEC_CMD_H
diff --git a/tools/lib/subcmd/help.c b/tools/lib/subcmd/help.c
index 0310520f918e45..2859f107abc802 100644
--- a/tools/lib/subcmd/help.c
+++ b/tools/lib/subcmd/help.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/lib/subcmd/help.h b/tools/lib/subcmd/help.h
index 9bd4223dc72201..355c066c8d49cf 100644
--- a/tools/lib/subcmd/help.h
+++ b/tools/lib/subcmd/help.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_HELP_H
#define __SUBCMD_HELP_H
diff --git a/tools/lib/subcmd/pager.c b/tools/lib/subcmd/pager.c
index 6518bea926d6fd..5ba754d179520a 100644
--- a/tools/lib/subcmd/pager.c
+++ b/tools/lib/subcmd/pager.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/select.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/tools/lib/subcmd/pager.h b/tools/lib/subcmd/pager.h
index 623f5542d05dea..f1a53cf2988045 100644
--- a/tools/lib/subcmd/pager.h
+++ b/tools/lib/subcmd/pager.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_PAGER_H
#define __SUBCMD_PAGER_H
diff --git a/tools/lib/subcmd/parse-options.c b/tools/lib/subcmd/parse-options.c
index 2bd6fd0c1d40d4..f6a1babcbac416 100644
--- a/tools/lib/subcmd/parse-options.c
+++ b/tools/lib/subcmd/parse-options.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/string.h>
#include <linux/types.h>
diff --git a/tools/lib/subcmd/parse-options.h b/tools/lib/subcmd/parse-options.h
index f054ca1b899df5..92fdbe1519f6d8 100644
--- a/tools/lib/subcmd/parse-options.h
+++ b/tools/lib/subcmd/parse-options.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_PARSE_OPTIONS_H
#define __SUBCMD_PARSE_OPTIONS_H
diff --git a/tools/lib/subcmd/run-command.c b/tools/lib/subcmd/run-command.c
index 911f83942723ac..5cdac21625322b 100644
--- a/tools/lib/subcmd/run-command.c
+++ b/tools/lib/subcmd/run-command.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/tools/lib/subcmd/run-command.h b/tools/lib/subcmd/run-command.h
index fe2befea1e730a..17d969c6add3bb 100644
--- a/tools/lib/subcmd/run-command.h
+++ b/tools/lib/subcmd/run-command.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_RUN_COMMAND_H
#define __SUBCMD_RUN_COMMAND_H
diff --git a/tools/lib/subcmd/sigchain.c b/tools/lib/subcmd/sigchain.c
index 3537c348a18ef0..f0fe3dbef7f7f3 100644
--- a/tools/lib/subcmd/sigchain.c
+++ b/tools/lib/subcmd/sigchain.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <signal.h>
#include "subcmd-util.h"
#include "sigchain.h"
diff --git a/tools/lib/subcmd/sigchain.h b/tools/lib/subcmd/sigchain.h
index 0c919f2874ca37..1ec663af43eaf8 100644
--- a/tools/lib/subcmd/sigchain.h
+++ b/tools/lib/subcmd/sigchain.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_SIGCHAIN_H
#define __SUBCMD_SIGCHAIN_H
diff --git a/tools/lib/subcmd/subcmd-config.c b/tools/lib/subcmd/subcmd-config.c
index d017c728bd1b32..84a7cf6c7878a1 100644
--- a/tools/lib/subcmd/subcmd-config.c
+++ b/tools/lib/subcmd/subcmd-config.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "subcmd-config.h"
#define UNDEFINED "SUBCMD_HAS_NOT_BEEN_INITIALIZED"
diff --git a/tools/lib/subcmd/subcmd-config.h b/tools/lib/subcmd/subcmd-config.h
index cc8514030b5c3c..9024dc17d10010 100644
--- a/tools/lib/subcmd/subcmd-config.h
+++ b/tools/lib/subcmd/subcmd-config.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SUBCMD_CONFIG_H
#define __PERF_SUBCMD_CONFIG_H
diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h
index 8fa5f036eff080..794a375dad3601 100644
--- a/tools/lib/subcmd/subcmd-util.h
+++ b/tools/lib/subcmd/subcmd-util.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SUBCMD_UTIL_H
#define __SUBCMD_UTIL_H
diff --git a/tools/lib/symbol/kallsyms.c b/tools/lib/symbol/kallsyms.c
index d270ac00613d60..914cb8e3d40b7e 100644
--- a/tools/lib/symbol/kallsyms.c
+++ b/tools/lib/symbol/kallsyms.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <ctype.h>
#include "symbol/kallsyms.h"
#include <stdio.h>
diff --git a/tools/lib/symbol/kallsyms.h b/tools/lib/symbol/kallsyms.h
index 4071316a766ef9..bc40101d72c189 100644
--- a/tools/lib/symbol/kallsyms.h
+++ b/tools/lib/symbol/kallsyms.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TOOLS_KALLSYMS_H_
#define __TOOLS_KALLSYMS_H_ 1
diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
index 9b8555ea3459c8..46cd5f871ad76d 100644
--- a/tools/lib/traceevent/Makefile
+++ b/tools/lib/traceevent/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# trace-cmd version
EP_VERSION = 1
EP_PATCHLEVEL = 1
diff --git a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c
index ec57d0c1fbc2b6..8f8586912da7ba 100644
--- a/tools/lib/traceevent/plugin_cfg80211.c
+++ b/tools/lib/traceevent/plugin_cfg80211.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
diff --git a/tools/lib/traceevent/plugin_scsi.c b/tools/lib/traceevent/plugin_scsi.c
index 3727de48c8d502..5e750af2b461f7 100644
--- a/tools/lib/traceevent/plugin_scsi.c
+++ b/tools/lib/traceevent/plugin_scsi.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
diff --git a/tools/lib/traceevent/plugin_xen.c b/tools/lib/traceevent/plugin_xen.c
index 3a413eaada6843..690173bfa13edb 100644
--- a/tools/lib/traceevent/plugin_xen.c
+++ b/tools/lib/traceevent/plugin_xen.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/lib/vsprintf.c b/tools/lib/vsprintf.c
index 45f9a06daa5602..e08ee147eab434 100644
--- a/tools/lib/vsprintf.c
+++ b/tools/lib/vsprintf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <linux/kernel.h>
#include <stdio.h>
diff --git a/tools/net/Makefile b/tools/net/Makefile
index ddf8880106524c..5830670feae1ee 100644
--- a/tools/net/Makefile
+++ b/tools/net/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
prefix = /usr
CC = gcc
diff --git a/tools/nfsd/inject_fault.sh b/tools/nfsd/inject_fault.sh
index 06a399ac8b2f0c..10ceee64a09a8c 100755
--- a/tools/nfsd/inject_fault.sh
+++ b/tools/nfsd/inject_fault.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# Copyright (c) 2011 Bryan Schumaker <bjschuma@netapp.com>
#
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 6976c73e60c444..424b1965d06f2f 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
include ../scripts/Makefile.include
include ../scripts/Makefile.arch
diff --git a/tools/objtool/arch/x86/insn/gen-insn-attr-x86.awk b/tools/objtool/arch/x86/insn/gen-insn-attr-x86.awk
index a3d2c62fd80577..b02a36b2c14fb2 100644
--- a/tools/objtool/arch/x86/insn/gen-insn-attr-x86.awk
+++ b/tools/objtool/arch/x86/insn/gen-insn-attr-x86.awk
@@ -1,4 +1,5 @@
#!/bin/awk -f
+# SPDX-License-Identifier: GPL-2.0
# gen-insn-attr-x86.awk: Instruction attribute table generator
# Written by Masami Hiramatsu <mhiramat@redhat.com>
#
diff --git a/tools/pci/pcitest.sh b/tools/pci/pcitest.sh
index 5442bbea4c229f..77e8c85ef74445 100644
--- a/tools/pci/pcitest.sh
+++ b/tools/pci/pcitest.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
echo "BAR tests"
echo
diff --git a/tools/pcmcia/Makefile b/tools/pcmcia/Makefile
index 81a7498c5cd9ef..eae24df1dbf556 100644
--- a/tools/pcmcia/Makefile
+++ b/tools/pcmcia/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC := $(CROSS_COMPILE)gcc
CFLAGS := -I../../usr/include
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 32a64e6190288e..225454416ed54b 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# This is a simple wrapper Makefile that calls the main Makefile.perf
# with a -j option to do parallel builds
diff --git a/tools/perf/arch/arm/annotate/instructions.c b/tools/perf/arch/arm/annotate/instructions.c
index 6dfec7c2369681..f64516d5b23eb6 100644
--- a/tools/perf/arch/arm/annotate/instructions.c
+++ b/tools/perf/arch/arm/annotate/instructions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <sys/types.h>
#include <regex.h>
diff --git a/tools/perf/arch/arm/include/dwarf-regs-table.h b/tools/perf/arch/arm/include/dwarf-regs-table.h
index f298d034c37b1a..5a45046fab72a4 100644
--- a/tools/perf/arch/arm/include/dwarf-regs-table.h
+++ b/tools/perf/arch/arm/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/arm/include/perf_regs.h b/tools/perf/arch/arm/include/perf_regs.h
index f619c9c5a4bff4..ed20e0253e25d4 100644
--- a/tools/perf/arch/arm/include/perf_regs.h
+++ b/tools/perf/arch/arm/include/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_REGS_H
#define ARCH_PERF_REGS_H
diff --git a/tools/perf/arch/arm/tests/dwarf-unwind.c b/tools/perf/arch/arm/tests/dwarf-unwind.c
index 62eff847f91c4e..8cb3477602339e 100644
--- a/tools/perf/arch/arm/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm/tests/dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "perf_regs.h"
#include "thread.h"
diff --git a/tools/perf/arch/arm/tests/regs_load.S b/tools/perf/arch/arm/tests/regs_load.S
index e09e983946fec7..6e2495cc451719 100644
--- a/tools/perf/arch/arm/tests/regs_load.S
+++ b/tools/perf/arch/arm/tests/regs_load.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#define R0 0x00
diff --git a/tools/perf/arch/arm/util/unwind-libdw.c b/tools/perf/arch/arm/util/unwind-libdw.c
index bacfa00fca398e..36ba4c69c3c55c 100644
--- a/tools/perf/arch/arm/util/unwind-libdw.c
+++ b/tools/perf/arch/arm/util/unwind-libdw.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elfutils/libdwfl.h>
#include "../../util/unwind-libdw.h"
#include "../../util/perf_regs.h"
diff --git a/tools/perf/arch/arm/util/unwind-libunwind.c b/tools/perf/arch/arm/util/unwind-libunwind.c
index 62c397ed3d9786..3a550225dfafd3 100644
--- a/tools/perf/arch/arm/util/unwind-libunwind.c
+++ b/tools/perf/arch/arm/util/unwind-libunwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <libunwind.h>
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile
index eebe1ec9d2ee70..91de4860faadfe 100644
--- a/tools/perf/arch/arm64/Makefile
+++ b/tools/perf/arch/arm64/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
diff --git a/tools/perf/arch/arm64/annotate/instructions.c b/tools/perf/arch/arm64/annotate/instructions.c
index a2c32be4132a5e..6688977e4ac774 100644
--- a/tools/perf/arch/arm64/annotate/instructions.c
+++ b/tools/perf/arch/arm64/annotate/instructions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <sys/types.h>
#include <regex.h>
diff --git a/tools/perf/arch/arm64/include/dwarf-regs-table.h b/tools/perf/arch/arm64/include/dwarf-regs-table.h
index 36e375f5a211f2..177b2855f797a2 100644
--- a/tools/perf/arch/arm64/include/dwarf-regs-table.h
+++ b/tools/perf/arch/arm64/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/arm64/include/perf_regs.h b/tools/perf/arch/arm64/include/perf_regs.h
index 4e5af27e3fbfa5..baaa5e64a3fb0d 100644
--- a/tools/perf/arch/arm64/include/perf_regs.h
+++ b/tools/perf/arch/arm64/include/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_REGS_H
#define ARCH_PERF_REGS_H
diff --git a/tools/perf/arch/arm64/tests/dwarf-unwind.c b/tools/perf/arch/arm64/tests/dwarf-unwind.c
index cf04a4c91c596e..e907f0f4c20c0c 100644
--- a/tools/perf/arch/arm64/tests/dwarf-unwind.c
+++ b/tools/perf/arch/arm64/tests/dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "perf_regs.h"
#include "thread.h"
diff --git a/tools/perf/arch/arm64/tests/regs_load.S b/tools/perf/arch/arm64/tests/regs_load.S
index 025b46e579a6fa..07042511dca925 100644
--- a/tools/perf/arch/arm64/tests/regs_load.S
+++ b/tools/perf/arch/arm64/tests/regs_load.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
.text
diff --git a/tools/perf/arch/arm64/util/unwind-libunwind.c b/tools/perf/arch/arm64/util/unwind-libunwind.c
index b415dfdbcccaba..002520d4036b88 100644
--- a/tools/perf/arch/arm64/util/unwind-libunwind.c
+++ b/tools/perf/arch/arm64/util/unwind-libunwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#ifndef REMOTE_UNWIND_LIBUNWIND
diff --git a/tools/perf/arch/common.c b/tools/perf/arch/common.c
index 6b40e9f017404f..8c0cfeb55f8e54 100644
--- a/tools/perf/arch/common.c
+++ b/tools/perf/arch/common.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <sys/utsname.h>
#include "common.h"
diff --git a/tools/perf/arch/common.h b/tools/perf/arch/common.h
index 6b01c736b7d9aa..a1546509ad245b 100644
--- a/tools/perf/arch/common.h
+++ b/tools/perf/arch/common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_COMMON_H
#define ARCH_PERF_COMMON_H
diff --git a/tools/perf/arch/powerpc/Makefile b/tools/perf/arch/powerpc/Makefile
index cc3930904d6895..42dab7c8f50882 100644
--- a/tools/perf/arch/powerpc/Makefile
+++ b/tools/perf/arch/powerpc/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
diff --git a/tools/perf/arch/powerpc/annotate/instructions.c b/tools/perf/arch/powerpc/annotate/instructions.c
index b6b0ef5952d016..a3f423c27caea4 100644
--- a/tools/perf/arch/powerpc/annotate/instructions.c
+++ b/tools/perf/arch/powerpc/annotate/instructions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
static struct ins_ops *powerpc__associate_instruction_ops(struct arch *arch, const char *name)
diff --git a/tools/perf/arch/powerpc/include/arch-tests.h b/tools/perf/arch/powerpc/include/arch-tests.h
index 84d8dedef2ed99..1c7be75cbc789f 100644
--- a/tools/perf/arch/powerpc/include/arch-tests.h
+++ b/tools/perf/arch/powerpc/include/arch-tests.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_TESTS_H
#define ARCH_TESTS_H
diff --git a/tools/perf/arch/powerpc/include/dwarf-regs-table.h b/tools/perf/arch/powerpc/include/dwarf-regs-table.h
index db4730f5585c72..66dc015a733d6a 100644
--- a/tools/perf/arch/powerpc/include/dwarf-regs-table.h
+++ b/tools/perf/arch/powerpc/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/powerpc/include/perf_regs.h b/tools/perf/arch/powerpc/include/perf_regs.h
index c12f4e804f6679..00e37b10691382 100644
--- a/tools/perf/arch/powerpc/include/perf_regs.h
+++ b/tools/perf/arch/powerpc/include/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_REGS_H
#define ARCH_PERF_REGS_H
diff --git a/tools/perf/arch/powerpc/tests/arch-tests.c b/tools/perf/arch/powerpc/tests/arch-tests.c
index e24f46241f407c..8c3fbd4af8171c 100644
--- a/tools/perf/arch/powerpc/tests/arch-tests.c
+++ b/tools/perf/arch/powerpc/tests/arch-tests.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "tests/tests.h"
#include "arch-tests.h"
diff --git a/tools/perf/arch/powerpc/tests/dwarf-unwind.c b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
index 0bac3137ccbd67..30cbbd6d5be0c9 100644
--- a/tools/perf/arch/powerpc/tests/dwarf-unwind.c
+++ b/tools/perf/arch/powerpc/tests/dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "perf_regs.h"
#include "thread.h"
diff --git a/tools/perf/arch/powerpc/tests/regs_load.S b/tools/perf/arch/powerpc/tests/regs_load.S
index d76c9a32f327a7..36a20b0033f97c 100644
--- a/tools/perf/arch/powerpc/tests/regs_load.S
+++ b/tools/perf/arch/powerpc/tests/regs_load.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
/* Offset is based on macros from arch/powerpc/include/uapi/asm/ptrace.h. */
diff --git a/tools/perf/arch/powerpc/util/book3s_hcalls.h b/tools/perf/arch/powerpc/util/book3s_hcalls.h
index 0dd6b7f2d44f12..54cfa0530e86d4 100644
--- a/tools/perf/arch/powerpc/util/book3s_hcalls.h
+++ b/tools/perf/arch/powerpc/util/book3s_hcalls.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_BOOK3S_HV_HCALLS_H
#define ARCH_PERF_BOOK3S_HV_HCALLS_H
diff --git a/tools/perf/arch/powerpc/util/book3s_hv_exits.h b/tools/perf/arch/powerpc/util/book3s_hv_exits.h
index e68ba2da8970cd..853b95d1e13925 100644
--- a/tools/perf/arch/powerpc/util/book3s_hv_exits.h
+++ b/tools/perf/arch/powerpc/util/book3s_hv_exits.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_BOOK3S_HV_EXITS_H
#define ARCH_PERF_BOOK3S_HV_EXITS_H
diff --git a/tools/perf/arch/powerpc/util/header.c b/tools/perf/arch/powerpc/util/header.c
index 9aaa6f5a93479f..7a4cf80c207a0b 100644
--- a/tools/perf/arch/powerpc/util/header.c
+++ b/tools/perf/arch/powerpc/util/header.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/perf/arch/powerpc/util/kvm-stat.c b/tools/perf/arch/powerpc/util/kvm-stat.c
index 249723f0e6a9e4..596ad6aedaace8 100644
--- a/tools/perf/arch/powerpc/util/kvm-stat.c
+++ b/tools/perf/arch/powerpc/util/kvm-stat.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include "util/kvm-stat.h"
#include "util/parse-events.h"
diff --git a/tools/perf/arch/powerpc/util/perf_regs.c b/tools/perf/arch/powerpc/util/perf_regs.c
index f860dc411f69a9..ec50939b0418a7 100644
--- a/tools/perf/arch/powerpc/util/perf_regs.c
+++ b/tools/perf/arch/powerpc/util/perf_regs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <string.h>
#include <regex.h>
diff --git a/tools/perf/arch/powerpc/util/unwind-libdw.c b/tools/perf/arch/powerpc/util/unwind-libdw.c
index 3a24b3c4327386..7a1f05ef2fc031 100644
--- a/tools/perf/arch/powerpc/util/unwind-libdw.c
+++ b/tools/perf/arch/powerpc/util/unwind-libdw.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elfutils/libdwfl.h>
#include "../../util/unwind-libdw.h"
#include "../../util/perf_regs.h"
diff --git a/tools/perf/arch/s390/annotate/instructions.c b/tools/perf/arch/s390/annotate/instructions.c
index b8676ccbed76d0..e0e466c650dfad 100644
--- a/tools/perf/arch/s390/annotate/instructions.c
+++ b/tools/perf/arch/s390/annotate/instructions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
static struct ins_ops *s390__associate_ins_ops(struct arch *arch, const char *name)
diff --git a/tools/perf/arch/s390/include/dwarf-regs-table.h b/tools/perf/arch/s390/include/dwarf-regs-table.h
index 9da74a933bd6a7..792d4c2772250c 100644
--- a/tools/perf/arch/s390/include/dwarf-regs-table.h
+++ b/tools/perf/arch/s390/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/s390/util/dwarf-regs.c b/tools/perf/arch/s390/util/dwarf-regs.c
index 0469df02ee6272..0dff5b2ed1e509 100644
--- a/tools/perf/arch/s390/util/dwarf-regs.c
+++ b/tools/perf/arch/s390/util/dwarf-regs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Mapping of DWARF debug register numbers into register names.
*
diff --git a/tools/perf/arch/s390/util/machine.c b/tools/perf/arch/s390/util/machine.c
index b9a95a1a8e6909..0b205400731444 100644
--- a/tools/perf/arch/s390/util/machine.c
+++ b/tools/perf/arch/s390/util/machine.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <unistd.h>
#include <stdio.h>
#include <string.h>
diff --git a/tools/perf/arch/sh/include/dwarf-regs-table.h b/tools/perf/arch/sh/include/dwarf-regs-table.h
index 3a2deaf3dab43a..900e6961997091 100644
--- a/tools/perf/arch/sh/include/dwarf-regs-table.h
+++ b/tools/perf/arch/sh/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/sparc/include/dwarf-regs-table.h b/tools/perf/arch/sparc/include/dwarf-regs-table.h
index 12c07619002c9f..35ede84a6b0d1e 100644
--- a/tools/perf/arch/sparc/include/dwarf-regs-table.h
+++ b/tools/perf/arch/sparc/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 9a628a24c5c920..d74eaa7aa927d5 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifndef NO_DWARF
PERF_HAVE_DWARF_REGS := 1
endif
diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c
index 563cd456404146..5bd1ba8c02829e 100644
--- a/tools/perf/arch/x86/annotate/instructions.c
+++ b/tools/perf/arch/x86/annotate/instructions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
static struct ins x86__instructions[] = {
{ .name = "add", .ops = &mov_ops, },
{ .name = "addl", .ops = &mov_ops, },
diff --git a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
index 49a18b9ad9cf36..029a72c20b1970 100755
--- a/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
+++ b/tools/perf/arch/x86/entry/syscalls/syscalltbl.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
in="$1"
arch="$2"
diff --git a/tools/perf/arch/x86/include/arch-tests.h b/tools/perf/arch/x86/include/arch-tests.h
index 01ad4208bcdf2b..c1bd979b957be7 100644
--- a/tools/perf/arch/x86/include/arch-tests.h
+++ b/tools/perf/arch/x86/include/arch-tests.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_TESTS_H
#define ARCH_TESTS_H
diff --git a/tools/perf/arch/x86/include/dwarf-regs-table.h b/tools/perf/arch/x86/include/dwarf-regs-table.h
index 9b5e5cbb4209ae..b9bd5dc9d4c079 100644
--- a/tools/perf/arch/x86/include/dwarf-regs-table.h
+++ b/tools/perf/arch/x86/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/arch/x86/include/perf_regs.h b/tools/perf/arch/x86/include/perf_regs.h
index 7df517acfef856..7f6d538f8a8953 100644
--- a/tools/perf/arch/x86/include/perf_regs.h
+++ b/tools/perf/arch/x86/include/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ARCH_PERF_REGS_H
#define ARCH_PERF_REGS_H
diff --git a/tools/perf/arch/x86/tests/arch-tests.c b/tools/perf/arch/x86/tests/arch-tests.c
index 271c0a0f95d732..cc1802ff54109e 100644
--- a/tools/perf/arch/x86/tests/arch-tests.c
+++ b/tools/perf/arch/x86/tests/arch-tests.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "tests/tests.h"
#include "arch-tests.h"
diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c
index 7f209ce827bf5a..95036c7a59e8f5 100644
--- a/tools/perf/arch/x86/tests/dwarf-unwind.c
+++ b/tools/perf/arch/x86/tests/dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "perf_regs.h"
#include "thread.h"
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-32.c b/tools/perf/arch/x86/tests/insn-x86-dat-32.c
index 3cbf6fad169f88..fab3c6de73fad1 100644
--- a/tools/perf/arch/x86/tests/insn-x86-dat-32.c
+++ b/tools/perf/arch/x86/tests/insn-x86-dat-32.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk
* from insn-x86-dat-src.c for inclusion by insn-x86.c
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-64.c b/tools/perf/arch/x86/tests/insn-x86-dat-64.c
index aa512fa944dd0d..c57f34603b9bd6 100644
--- a/tools/perf/arch/x86/tests/insn-x86-dat-64.c
+++ b/tools/perf/arch/x86/tests/insn-x86-dat-64.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Generated by gen-insn-x86-dat.sh and gen-insn-x86-dat.awk
* from insn-x86-dat-src.c for inclusion by insn-x86.c
diff --git a/tools/perf/arch/x86/tests/insn-x86-dat-src.c b/tools/perf/arch/x86/tests/insn-x86-dat-src.c
index 6cdb65d25b790f..891415b109843c 100644
--- a/tools/perf/arch/x86/tests/insn-x86-dat-src.c
+++ b/tools/perf/arch/x86/tests/insn-x86-dat-src.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file contains instructions for testing by the test titled:
*
diff --git a/tools/perf/arch/x86/tests/insn-x86.c b/tools/perf/arch/x86/tests/insn-x86.c
index b3860586a0c2d9..a5d24ae5810d6e 100644
--- a/tools/perf/arch/x86/tests/insn-x86.c
+++ b/tools/perf/arch/x86/tests/insn-x86.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include "debug.h"
diff --git a/tools/perf/arch/x86/tests/intel-cqm.c b/tools/perf/arch/x86/tests/intel-cqm.c
new file mode 100644
index 00000000000000..90a4a8c58a62b8
--- /dev/null
+++ b/tools/perf/arch/x86/tests/intel-cqm.c
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "tests/tests.h"
+#include "perf.h"
+#include "cloexec.h"
+#include "debug.h"
+#include "evlist.h"
+#include "evsel.h"
+#include "arch-tests.h"
+
+#include <signal.h>
+#include <sys/mman.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <string.h>
+
+static pid_t spawn(void)
+{
+ pid_t pid;
+
+ pid = fork();
+ if (pid)
+ return pid;
+
+ while(1)
+ sleep(5);
+ return 0;
+}
+
+/*
+ * Create an event group that contains both a sampled hardware
+ * (cpu-cycles) and software (intel_cqm/llc_occupancy/) event. We then
+ * wait for the hardware perf counter to overflow and generate a PMI,
+ * which triggers an event read for both of the events in the group.
+ *
+ * Since reading Intel CQM event counters requires sending SMP IPIs, the
+ * CQM pmu needs to handle the above situation gracefully, and return
+ * the last read counter value to avoid triggering a WARN_ON_ONCE() in
+ * smp_call_function_many() caused by sending IPIs from NMI context.
+ */
+int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subtest __maybe_unused)
+{
+ struct perf_evlist *evlist = NULL;
+ struct perf_evsel *evsel = NULL;
+ struct perf_event_attr pe;
+ int i, fd[2], flag, ret;
+ size_t mmap_len;
+ void *event;
+ pid_t pid;
+ int err = TEST_FAIL;
+
+ flag = perf_event_open_cloexec_flag();
+
+ evlist = perf_evlist__new();
+ if (!evlist) {
+ pr_debug("perf_evlist__new failed\n");
+ return TEST_FAIL;
+ }
+
+ ret = parse_events(evlist, "intel_cqm/llc_occupancy/", NULL);
+ if (ret) {
+ pr_debug("parse_events failed, is \"intel_cqm/llc_occupancy/\" available?\n");
+ err = TEST_SKIP;
+ goto out;
+ }
+
+ evsel = perf_evlist__first(evlist);
+ if (!evsel) {
+ pr_debug("perf_evlist__first failed\n");
+ goto out;
+ }
+
+ memset(&pe, 0, sizeof(pe));
+ pe.size = sizeof(pe);
+
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_CPU_CYCLES;
+ pe.read_format = PERF_FORMAT_GROUP;
+
+ pe.sample_period = 128;
+ pe.sample_type = PERF_SAMPLE_IP | PERF_SAMPLE_READ;
+
+ pid = spawn();
+
+ fd[0] = sys_perf_event_open(&pe, pid, -1, -1, flag);
+ if (fd[0] < 0) {
+ pr_debug("failed to open event\n");
+ goto out;
+ }
+
+ memset(&pe, 0, sizeof(pe));
+ pe.size = sizeof(pe);
+
+ pe.type = evsel->attr.type;
+ pe.config = evsel->attr.config;
+
+ fd[1] = sys_perf_event_open(&pe, pid, -1, fd[0], flag);
+ if (fd[1] < 0) {
+ pr_debug("failed to open event\n");
+ goto out;
+ }
+
+ /*
+ * Pick a power-of-two number of pages + 1 for the meta-data
+ * page (struct perf_event_mmap_page). See tools/perf/design.txt.
+ */
+ mmap_len = page_size * 65;
+
+ event = mmap(NULL, mmap_len, PROT_READ, MAP_SHARED, fd[0], 0);
+ if (event == (void *)(-1)) {
+ pr_debug("failed to mmap %d\n", errno);
+ goto out;
+ }
+
+ sleep(1);
+
+ err = TEST_OK;
+
+ munmap(event, mmap_len);
+
+ for (i = 0; i < 2; i++)
+ close(fd[i]);
+
+ kill(pid, SIGKILL);
+ wait(NULL);
+out:
+ perf_evlist__delete(evlist);
+ return err;
+}
diff --git a/tools/perf/arch/x86/tests/perf-time-to-tsc.c b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
index 5dd7efb192ce96..b59678e8c1e284 100644
--- a/tools/perf/arch/x86/tests/perf-time-to-tsc.c
+++ b/tools/perf/arch/x86/tests/perf-time-to-tsc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/tools/perf/arch/x86/tests/rdpmc.c b/tools/perf/arch/x86/tests/rdpmc.c
index 17fec30a0b31af..7a11f02d6c6c78 100644
--- a/tools/perf/arch/x86/tests/rdpmc.c
+++ b/tools/perf/arch/x86/tests/rdpmc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/tools/perf/arch/x86/tests/regs_load.S b/tools/perf/arch/x86/tests/regs_load.S
index 60875d5c556c21..bbe5a0d16e5108 100644
--- a/tools/perf/arch/x86/tests/regs_load.S
+++ b/tools/perf/arch/x86/tests/regs_load.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/linkage.h>
#define AX 0
diff --git a/tools/perf/arch/x86/util/group.c b/tools/perf/arch/x86/util/group.c
index 37f92aa39a5dee..e2f8034b897332 100644
--- a/tools/perf/arch/x86/util/group.c
+++ b/tools/perf/arch/x86/util/group.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include "api/fs/fs.h"
#include "util/group.h"
diff --git a/tools/perf/arch/x86/util/header.c b/tools/perf/arch/x86/util/header.c
index a74a48db26f5e5..33027c5e6f920b 100644
--- a/tools/perf/arch/x86/util/header.c
+++ b/tools/perf/arch/x86/util/header.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/perf/arch/x86/util/kvm-stat.c b/tools/perf/arch/x86/util/kvm-stat.c
index bf817beca0a822..b32409a0e546dc 100644
--- a/tools/perf/arch/x86/util/kvm-stat.c
+++ b/tools/perf/arch/x86/util/kvm-stat.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include "../../util/kvm-stat.h"
#include <asm/svm.h>
diff --git a/tools/perf/arch/x86/util/perf_regs.c b/tools/perf/arch/x86/util/perf_regs.c
index f95edebfb7162d..4b2caf6d48e794 100644
--- a/tools/perf/arch/x86/util/perf_regs.c
+++ b/tools/perf/arch/x86/util/perf_regs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <string.h>
#include <regex.h>
diff --git a/tools/perf/arch/x86/util/pmu.c b/tools/perf/arch/x86/util/pmu.c
index 79fe07158d0092..63a74c32ddc5d4 100644
--- a/tools/perf/arch/x86/util/pmu.c
+++ b/tools/perf/arch/x86/util/pmu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include <linux/perf_event.h>
diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c
index 2e5567c94e0943..06bae7023a5103 100644
--- a/tools/perf/arch/x86/util/tsc.c
+++ b/tools/perf/arch/x86/util/tsc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
#include <errno.h>
diff --git a/tools/perf/arch/x86/util/unwind-libdw.c b/tools/perf/arch/x86/util/unwind-libdw.c
index 38dc9bb2a7c90a..fda8f4206ee41f 100644
--- a/tools/perf/arch/x86/util/unwind-libdw.c
+++ b/tools/perf/arch/x86/util/unwind-libdw.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elfutils/libdwfl.h>
#include "../../util/unwind-libdw.h"
#include "../../util/perf_regs.h"
diff --git a/tools/perf/arch/x86/util/unwind-libunwind.c b/tools/perf/arch/x86/util/unwind-libunwind.c
index 4f16661cbdbb50..9c917f80c90653 100644
--- a/tools/perf/arch/x86/util/unwind-libunwind.c
+++ b/tools/perf/arch/x86/util/unwind-libunwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef REMOTE_UNWIND_LIBUNWIND
#include <errno.h>
diff --git a/tools/perf/arch/xtensa/include/dwarf-regs-table.h b/tools/perf/arch/xtensa/include/dwarf-regs-table.h
index aa0444a33fe607..d7c9f1fb444480 100644
--- a/tools/perf/arch/xtensa/include/dwarf-regs-table.h
+++ b/tools/perf/arch/xtensa/include/dwarf-regs-table.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef DEFINE_DWARF_REGSTR_TABLE
/* This is included in perf/util/dwarf-regs.c */
diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h
index 842ab2781cdc51..6c9fcd757f3106 100644
--- a/tools/perf/bench/bench.h
+++ b/tools/perf/bench/bench.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BENCH_H
#define BENCH_H
diff --git a/tools/perf/bench/futex-hash.c b/tools/perf/bench/futex-hash.c
index fe16b310097f50..58ae6ed8f38b20 100644
--- a/tools/perf/bench/futex-hash.c
+++ b/tools/perf/bench/futex-hash.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com>
*
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index 73a1c44ea63c9c..08653ae8a8c4fb 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2015 Davidlohr Bueso.
*/
diff --git a/tools/perf/bench/futex-requeue.c b/tools/perf/bench/futex-requeue.c
index 41786cbea24c64..1058c194608a72 100644
--- a/tools/perf/bench/futex-requeue.c
+++ b/tools/perf/bench/futex-requeue.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com>
*
diff --git a/tools/perf/bench/futex-wake-parallel.c b/tools/perf/bench/futex-wake-parallel.c
index 4ab12c8e016a7d..b4732dad9f891f 100644
--- a/tools/perf/bench/futex-wake-parallel.c
+++ b/tools/perf/bench/futex-wake-parallel.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2015 Davidlohr Bueso.
*
diff --git a/tools/perf/bench/futex-wake.c b/tools/perf/bench/futex-wake.c
index 2fa49222ef8dee..8c5c0b6b5c974c 100644
--- a/tools/perf/bench/futex-wake.c
+++ b/tools/perf/bench/futex-wake.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2013 Davidlohr Bueso <davidlohr@hp.com>
*
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index e44fd32395305c..db4853f209c766 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Glibc independent futex library for testing kernel functionality.
* Shamelessly stolen from Darren Hart <dvhltc@us.ibm.com>
diff --git a/tools/perf/bench/mem-functions.c b/tools/perf/bench/mem-functions.c
index fbd732b5404797..0251dd348124af 100644
--- a/tools/perf/bench/mem-functions.c
+++ b/tools/perf/bench/mem-functions.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* mem-memcpy.c
*
diff --git a/tools/perf/bench/mem-memcpy-arch.h b/tools/perf/bench/mem-memcpy-arch.h
index 5aad2a9408b060..5bcaec5601a81b 100644
--- a/tools/perf/bench/mem-memcpy-arch.h
+++ b/tools/perf/bench/mem-memcpy-arch.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef HAVE_ARCH_X86_64_SUPPORT
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm-def.h b/tools/perf/bench/mem-memcpy-x86-64-asm-def.h
index 8c0c1a2770c8fe..50ae8bd58296ec 100644
--- a/tools/perf/bench/mem-memcpy-x86-64-asm-def.h
+++ b/tools/perf/bench/mem-memcpy-x86-64-asm-def.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
MEMCPY_FN(memcpy_orig,
"x86-64-unrolled",
diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S
index f700369bb0f6ed..b43f8d2a34ec10 100644
--- a/tools/perf/bench/mem-memcpy-x86-64-asm.S
+++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/* Various wrappers to make the kernel .S file build in user-space: */
diff --git a/tools/perf/bench/mem-memset-arch.h b/tools/perf/bench/mem-memset-arch.h
index 0d15786d9ae307..53f45482663fe3 100644
--- a/tools/perf/bench/mem-memset-arch.h
+++ b/tools/perf/bench/mem-memset-arch.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef HAVE_ARCH_X86_64_SUPPORT
diff --git a/tools/perf/bench/mem-memset-x86-64-asm-def.h b/tools/perf/bench/mem-memset-x86-64-asm-def.h
index f02d028771d970..dac6d2b7c39b2d 100644
--- a/tools/perf/bench/mem-memset-x86-64-asm-def.h
+++ b/tools/perf/bench/mem-memset-x86-64-asm-def.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
MEMSET_FN(memset_orig,
"x86-64-unrolled",
diff --git a/tools/perf/bench/mem-memset-x86-64-asm.S b/tools/perf/bench/mem-memset-x86-64-asm.S
index 58407aa24c1bfd..d550bd5261629a 100644
--- a/tools/perf/bench/mem-memset-x86-64-asm.S
+++ b/tools/perf/bench/mem-memset-x86-64-asm.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#define memset MEMSET /* don't hide glibc's memset() */
#define altinstr_replacement text
#define globl p2align 4; .globl
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 469d65b2112285..d95fdcc26f4b6f 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* numa.c
*
diff --git a/tools/perf/bench/sched-messaging.c b/tools/perf/bench/sched-messaging.c
index 4f961e74535b9c..f9d7641ae83387 100644
--- a/tools/perf/bench/sched-messaging.c
+++ b/tools/perf/bench/sched-messaging.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
*
* sched-messaging.c
diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c
index a152737370c593..0591be008f2aeb 100644
--- a/tools/perf/bench/sched-pipe.c
+++ b/tools/perf/bench/sched-pipe.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
*
* sched-pipe.c
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 2d5c87578f83c0..f15731a3d438f4 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-annotate.c
*
diff --git a/tools/perf/builtin-bench.c b/tools/perf/builtin-bench.c
index 445e6288125443..17a6bcd01aa678 100644
--- a/tools/perf/builtin-bench.c
+++ b/tools/perf/builtin-bench.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-bench.c
*
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index cb2453b293656e..3d354ba6e9c598 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-buildid-cache.c
*
diff --git a/tools/perf/builtin-buildid-list.c b/tools/perf/builtin-buildid-list.c
index 00099a830b0de3..78abbe8d9d5ff0 100644
--- a/tools/perf/builtin-buildid-list.c
+++ b/tools/perf/builtin-buildid-list.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-buildid-list.c
*
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 9590fdcc648448..17855c4626a08b 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This is rewrite of original c2c tool introduced in here:
* http://lwn.net/Articles/588866/
diff --git a/tools/perf/builtin-config.c b/tools/perf/builtin-config.c
index b89417d9305eff..514f70f95b5788 100644
--- a/tools/perf/builtin-config.c
+++ b/tools/perf/builtin-config.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-config.c
*
diff --git a/tools/perf/builtin-data.c b/tools/perf/builtin-data.c
index 46cd8490baf452..dde25d4ca56d62 100644
--- a/tools/perf/builtin-data.c
+++ b/tools/perf/builtin-data.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 67570e6417e597..d660cb7b222b23 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-diff.c
*
diff --git a/tools/perf/builtin-evlist.c b/tools/perf/builtin-evlist.c
index 93b85dc857b675..e06e822ce63487 100644
--- a/tools/perf/builtin-evlist.c
+++ b/tools/perf/builtin-evlist.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Builtin evlist command: Show the list of event selectors present
* in a perf.data file.
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index dbe4e4153bcfb6..bd1fedef3d1c5d 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-help.c
*
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index 91e65093d3c2fd..16a28547ca8686 100644
--- a/tools/perf/builtin-inject.c
+++ b/tools/perf/builtin-inject.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-inject.c
*
diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
index abcab75cc5b9dd..557d391f564a1d 100644
--- a/tools/perf/builtin-kmem.c
+++ b/tools/perf/builtin-kmem.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0af4c092b4711f..0c36f2ac6a0e04 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
index b2d2ad3dd478e9..ead221e49f003e 100644
--- a/tools/perf/builtin-list.c
+++ b/tools/perf/builtin-list.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-list.c
*
diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 81af29400b6448..6e0189df2b3baf 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include "builtin.h"
diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index f09fd1a1b81316..506564651cda98 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f4d9fc54b3822a..3d7f33e19df28d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-record.c
*
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 3c2d9d4932f3fd..1394cd8d96f7bb 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-report.c
*
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 47e54348b5ed5e..83283fedb00f3e 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 89975e30c0ba5b..68f36dc0344f2b 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "builtin.h"
#include "perf.h"
diff --git a/tools/perf/builtin-version.c b/tools/perf/builtin-version.c
index d25149456a2fc3..37019c5d675f2a 100644
--- a/tools/perf/builtin-version.c
+++ b/tools/perf/builtin-version.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "builtin.h"
#include "perf.h"
#include <linux/compiler.h>
diff --git a/tools/perf/builtin.h b/tools/perf/builtin.h
index d4d19fe3d050a8..05745f3ce912da 100644
--- a/tools/perf/builtin.h
+++ b/tools/perf/builtin.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BUILTIN_H
#define BUILTIN_H
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index a3a041b0d35ea4..77406d25e52180 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
HEADERS='
include/uapi/drm/drm.h
diff --git a/tools/perf/jvmti/jvmti_agent.h b/tools/perf/jvmti/jvmti_agent.h
index c53a41f48b6341..fe32d8344a823f 100644
--- a/tools/perf/jvmti/jvmti_agent.h
+++ b/tools/perf/jvmti/jvmti_agent.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __JVMTI_AGENT_H__
#define __JVMTI_AGENT_H__
diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c
index 6d710904c8379c..c62c9fc9a52599 100644
--- a/tools/perf/jvmti/libjvmti.c
+++ b/tools/perf/jvmti/libjvmti.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <sys/types.h>
#include <stdio.h>
diff --git a/tools/perf/perf-archive.sh b/tools/perf/perf-archive.sh
index e919306202699c..0cfb3e2cefef48 100644
--- a/tools/perf/perf-archive.sh
+++ b/tools/perf/perf-archive.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
# perf archive
# Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
index 3ba80b2359cc8c..345f5d6e9ed516 100644
--- a/tools/perf/perf-completion.sh
+++ b/tools/perf/perf-completion.sh
@@ -1,4 +1,5 @@
# perf bash and zsh completion
+# SPDX-License-Identifier: GPL-2.0
# Taken from git.git's completion script.
__my_reassemble_comp_words_by_ref()
diff --git a/tools/perf/perf-read-vdso.c b/tools/perf/perf-read-vdso.c
index 764e2547c25abf..8c0ca0cc428f47 100644
--- a/tools/perf/perf-read-vdso.c
+++ b/tools/perf/perf-read-vdso.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index c11f0c76e90c78..36673f98d66baa 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_SYS_H
#define _PERF_SYS_H
diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index 2f19e03c5c40d1..62b13518bc6e50 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* perf.c
*
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index fbb0a9cd0ac602..2357f4ccc9c79d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_PERF_H
#define _PERF_PERF_H
diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h
index 557994754410c4..4684c673c44579 100644
--- a/tools/perf/pmu-events/jevents.h
+++ b/tools/perf/pmu-events/jevents.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef JEVENTS_H
#define JEVENTS_H 1
diff --git a/tools/perf/pmu-events/jsmn.h b/tools/perf/pmu-events/jsmn.h
index d666b10cf25b88..c7b0f6ea2a31d8 100644
--- a/tools/perf/pmu-events/jsmn.h
+++ b/tools/perf/pmu-events/jsmn.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __JSMN_H_
#define __JSMN_H_
diff --git a/tools/perf/pmu-events/json.h b/tools/perf/pmu-events/json.h
index 278ebd32cfb6f4..fbcd5a0590ad5d 100644
--- a/tools/perf/pmu-events/json.h
+++ b/tools/perf/pmu-events/json.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef JSON_H
#define JSON_H 1
diff --git a/tools/perf/pmu-events/pmu-events.h b/tools/perf/pmu-events/pmu-events.h
index 94fa1720f6fdc7..92a4d15ee0b9d8 100644
--- a/tools/perf/pmu-events/pmu-events.h
+++ b/tools/perf/pmu-events/pmu-events.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PMU_EVENTS_H
#define PMU_EVENTS_H
diff --git a/tools/perf/python/tracepoint.py b/tools/perf/python/tracepoint.py
index eb4dbed57de7ea..eb76f6516247e1 100755
--- a/tools/perf/python/tracepoint.py
+++ b/tools/perf/python/tracepoint.py
@@ -1,4 +1,5 @@
#! /usr/bin/python
+# SPDX-License-Identifier: GPL-2.0
# -*- python -*-
# -*- coding: utf-8 -*-
diff --git a/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL
index decdeb0f6789fb..e8994332d7dc13 100644
--- a/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL
+++ b/tools/perf/scripts/perl/Perf-Trace-Util/Makefile.PL
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
use 5.010000;
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
index 9e0985794e20e5..81a56cd2b3c166 100755
--- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
+++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
@@ -1,4 +1,5 @@
# EventClass.py
+# SPDX-License-Identifier: GPL-2.0
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
diff --git a/tools/perf/scripts/python/event_analyzing_sample.py b/tools/perf/scripts/python/event_analyzing_sample.py
index 163c39fa12d92b..4e843b9864ecd3 100644
--- a/tools/perf/scripts/python/event_analyzing_sample.py
+++ b/tools/perf/scripts/python/event_analyzing_sample.py
@@ -1,4 +1,5 @@
# event_analyzing_sample.py: general event handler in python
+# SPDX-License-Identifier: GPL-2.0
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py
index 0b6ce8c253e8a9..a150164b44a3fa 100755
--- a/tools/perf/scripts/python/net_dropmonitor.py
+++ b/tools/perf/scripts/python/net_dropmonitor.py
@@ -1,4 +1,5 @@
# Monitor the system for dropped packets and proudce a report of drop locations and counts
+# SPDX-License-Identifier: GPL-2.0
import os
import sys
diff --git a/tools/perf/scripts/python/netdev-times.py b/tools/perf/scripts/python/netdev-times.py
index 4c6f09ac7d129e..9b2050f778f10e 100644
--- a/tools/perf/scripts/python/netdev-times.py
+++ b/tools/perf/scripts/python/netdev-times.py
@@ -1,4 +1,5 @@
# Display a process of packets and processed time.
+# SPDX-License-Identifier: GPL-2.0
# It helps us to investigate networking or network device.
#
# options
diff --git a/tools/perf/scripts/python/stackcollapse.py b/tools/perf/scripts/python/stackcollapse.py
index 5a605f70ef3226..1697b5e18c9622 100755
--- a/tools/perf/scripts/python/stackcollapse.py
+++ b/tools/perf/scripts/python/stackcollapse.py
@@ -1,4 +1,5 @@
# stackcollapse.py - format perf samples with one line per distinct call stack
+# SPDX-License-Identifier: GPL-2.0
#
# This script's output has two space-separated fields. The first is a semicolon
# separated stack including the program name (from the "comm" field) and the
diff --git a/tools/perf/scripts/python/stat-cpi.py b/tools/perf/scripts/python/stat-cpi.py
index 8b60f343dd07c4..8410672efb8b53 100644
--- a/tools/perf/scripts/python/stat-cpi.py
+++ b/tools/perf/scripts/python/stat-cpi.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# SPDX-License-Identifier: GPL-2.0
data = {}
times = []
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 25ede4472465b5..0e1367f90af535 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* The struct perf_event_attr test support.
*
diff --git a/tools/perf/tests/attr.py b/tools/perf/tests/attr.py
index a13cd780148ea5..ff9b60b99f52a9 100644
--- a/tools/perf/tests/attr.py
+++ b/tools/perf/tests/attr.py
@@ -1,4 +1,5 @@
#! /usr/bin/python
+# SPDX-License-Identifier: GPL-2.0
import os
import sys
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index d233ad33646319..71b9a0b613d2b2 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Test backward bit in event attribute, read ring buffer from end to
* beginning
diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c
index 0d7c06584905fb..47bedf25ba6960 100644
--- a/tools/perf/tests/bitmap.c
+++ b/tools/perf/tests/bitmap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/bitmap.h>
#include "tests.h"
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index 97937e1bc53a0c..335b695f497085 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Inspired by breakpoint overflow test done by
* Vince Weaver <vincent.weaver@maine.edu> for perf_event_tests
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c
index 61ecd8021f4924..ca962559e845e0 100644
--- a/tools/perf/tests/bp_signal_overflow.c
+++ b/tools/perf/tests/bp_signal_overflow.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Originally done by Vince Weaver <vincent.weaver@maine.edu> for
* perf_event_tests (git://github.com/deater/perf_event_tests)
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index d0fee35db0e7d2..766573e236e458 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* builtin-test.c
*
diff --git a/tools/perf/tests/clang.c b/tools/perf/tests/clang.c
index c60ec916f0f29c..f45fe11dcf5095 100644
--- a/tools/perf/tests/clang.c
+++ b/tools/perf/tests/clang.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "tests.h"
#include "debug.h"
#include "util.h"
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 466a462b26d129..fcc8984bc329de 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <linux/kernel.h>
#include <linux/types.h>
diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c
index 199702252270f1..e78b897677bd44 100644
--- a/tools/perf/tests/cpumap.c
+++ b/tools/perf/tests/cpumap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "tests.h"
#include <stdio.h>
#include "cpumap.h"
diff --git a/tools/perf/tests/dso-data.c b/tools/perf/tests/dso-data.c
index 30aead42d13613..7f6c52021e411c 100644
--- a/tools/perf/tests/dso-data.c
+++ b/tools/perf/tests/dso-data.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <stdlib.h>
#include <linux/kernel.h>
diff --git a/tools/perf/tests/dwarf-unwind.c b/tools/perf/tests/dwarf-unwind.c
index 9ba1d216a89fb4..ac40e05bcab429 100644
--- a/tools/perf/tests/dwarf-unwind.c
+++ b/tools/perf/tests/dwarf-unwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/types.h>
#include <inttypes.h>
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
index b82b981c32594a..1a2686f1fcf0f7 100644
--- a/tools/perf/tests/event-times.c
+++ b/tools/perf/tests/event-times.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <errno.h>
#include <inttypes.h>
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
index 9484da2ec6b421..f14dcd6134389b 100644
--- a/tools/perf/tests/event_update.c
+++ b/tools/perf/tests/event_update.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "evlist.h"
#include "evsel.h"
diff --git a/tools/perf/tests/evsel-roundtrip-name.c b/tools/perf/tests/evsel-roundtrip-name.c
index d32759b6e38a53..a104728ebf2526 100644
--- a/tools/perf/tests/evsel-roundtrip-name.c
+++ b/tools/perf/tests/evsel-roundtrip-name.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "evlist.h"
#include "evsel.h"
#include "parse-events.h"
diff --git a/tools/perf/tests/evsel-tp-sched.c b/tools/perf/tests/evsel-tp-sched.c
index 5fc906d26c5ccd..699561fa512c29 100644
--- a/tools/perf/tests/evsel-tp-sched.c
+++ b/tools/perf/tests/evsel-tp-sched.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
#include <traceevent/event-parse.h>
#include "evsel.h"
diff --git a/tools/perf/tests/expr.c b/tools/perf/tests/expr.c
index cb251bf523e7ba..01f0706995a973 100644
--- a/tools/perf/tests/expr.c
+++ b/tools/perf/tests/expr.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util/debug.h"
#include "util/expr.h"
#include "tests.h"
diff --git a/tools/perf/tests/fdarray.c b/tools/perf/tests/fdarray.c
index 7d3a9e2ff89771..c7c81c4a5b2b59 100644
--- a/tools/perf/tests/fdarray.c
+++ b/tools/perf/tests/fdarray.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <api/fd/array.h>
#include <poll.h>
#include "util/debug.h"
diff --git a/tools/perf/tests/hists_common.c b/tools/perf/tests/hists_common.c
index 00b8dc50f3dba8..f7c5b613d6670f 100644
--- a/tools/perf/tests/hists_common.c
+++ b/tools/perf/tests/hists_common.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include "perf.h"
#include "util/debug.h"
diff --git a/tools/perf/tests/hists_common.h b/tools/perf/tests/hists_common.h
index 888254e8665c41..a2de0ff0ce3a63 100644
--- a/tools/perf/tests/hists_common.h
+++ b/tools/perf/tests/hists_common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TESTS__HISTS_COMMON_H__
#define __PERF_TESTS__HISTS_COMMON_H__
diff --git a/tools/perf/tests/hists_cumulate.c b/tools/perf/tests/hists_cumulate.c
index 8d19c0200cb74c..65fe02bebbeea4 100644
--- a/tools/perf/tests/hists_cumulate.c
+++ b/tools/perf/tests/hists_cumulate.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "util/debug.h"
#include "util/event.h"
diff --git a/tools/perf/tests/hists_filter.c b/tools/perf/tests/hists_filter.c
index 755ca551b810ca..1c5bedab3c2c15 100644
--- a/tools/perf/tests/hists_filter.c
+++ b/tools/perf/tests/hists_filter.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "util/debug.h"
#include "util/symbol.h"
diff --git a/tools/perf/tests/hists_link.c b/tools/perf/tests/hists_link.c
index 073c9c2856bc4d..9a9d06cb022225 100644
--- a/tools/perf/tests/hists_link.c
+++ b/tools/perf/tests/hists_link.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "tests.h"
#include "debug.h"
diff --git a/tools/perf/tests/hists_output.c b/tools/perf/tests/hists_output.c
index 282d62eaebe251..faacb4f4146050 100644
--- a/tools/perf/tests/hists_output.c
+++ b/tools/perf/tests/hists_output.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "util/debug.h"
#include "util/event.h"
diff --git a/tools/perf/tests/is_printable_array.c b/tools/perf/tests/is_printable_array.c
index 38f765767587ae..9c7b3baca4fed6 100644
--- a/tools/perf/tests/is_printable_array.c
+++ b/tools/perf/tests/is_printable_array.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/kernel.h>
#include "tests.h"
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
index 739428603b7129..842d33637a18fb 100644
--- a/tools/perf/tests/keep-tracking.c
+++ b/tools/perf/tests/keep-tracking.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <unistd.h>
#include <sys/prctl.h>
diff --git a/tools/perf/tests/kmod-path.c b/tools/perf/tests/kmod-path.c
index 8b9d4ba06c0e11..8e57d46109def0 100644
--- a/tools/perf/tests/kmod-path.c
+++ b/tools/perf/tests/kmod-path.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
#include <stdlib.h>
#include "tests.h"
diff --git a/tools/perf/tests/llvm.c b/tools/perf/tests/llvm.c
index 5187b50dbafe55..a039f93199e56c 100644
--- a/tools/perf/tests/llvm.c
+++ b/tools/perf/tests/llvm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <bpf/libbpf.h>
#include <util/llvm-utils.h>
diff --git a/tools/perf/tests/llvm.h b/tools/perf/tests/llvm.h
index b83571758d8392..f68b0d9b8ae285 100644
--- a/tools/perf/tests/llvm.h
+++ b/tools/perf/tests/llvm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_TEST_LLVM_H
#define PERF_TEST_LLVM_H
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
index bc8a70ee46d8b6..5a8bf318f8a7ed 100644
--- a/tools/perf/tests/mmap-basic.c
+++ b/tools/perf/tests/mmap-basic.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */
diff --git a/tools/perf/tests/mmap-thread-lookup.c b/tools/perf/tests/mmap-thread-lookup.c
index 2a0068afe3bfab..868d82b501f424 100644
--- a/tools/perf/tests/mmap-thread-lookup.c
+++ b/tools/perf/tests/mmap-thread-lookup.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <unistd.h>
#include <sys/syscall.h>
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
index 9cf1c35f2ad0c0..c531e6deb10479 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
/* For the CPU_* macros */
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c
index b6ee1c41f45d67..d9619d26531492 100644
--- a/tools/perf/tests/openat-syscall-tp-fields.c
+++ b/tools/perf/tests/openat-syscall-tp-fields.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/err.h>
#include "perf.h"
#include "evlist.h"
diff --git a/tools/perf/tests/openat-syscall.c b/tools/perf/tests/openat-syscall.c
index 9dc5c5d375531f..00cd63f90b92a5 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <api/fs/tracing_path.h>
diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c
index 0f0b025faa4b47..f0679613bd1878 100644
--- a/tools/perf/tests/parse-events.c
+++ b/tools/perf/tests/parse-events.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "parse-events.h"
#include "evsel.h"
#include "evlist.h"
diff --git a/tools/perf/tests/parse-no-sample-id-all.c b/tools/perf/tests/parse-no-sample-id-all.c
index 91867dcc39f014..2196d1497c0c49 100644
--- a/tools/perf/tests/parse-no-sample-id-all.c
+++ b/tools/perf/tests/parse-no-sample-id-all.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include <linux/types.h>
#include <stddef.h>
diff --git a/tools/perf/tests/perf-hooks.c b/tools/perf/tests/perf-hooks.c
index bf2517d6de7079..a693bcf017ea2c 100644
--- a/tools/perf/tests/perf-hooks.c
+++ b/tools/perf/tests/perf-hooks.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <signal.h>
#include <stdlib.h>
diff --git a/tools/perf/tests/perf-record.c b/tools/perf/tests/perf-record.c
index 19b650064b703b..c34904d3770550 100644
--- a/tools/perf/tests/perf-record.c
+++ b/tools/perf/tests/perf-record.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
/* For the CLR_() macros */
diff --git a/tools/perf/tests/perf-targz-src-pkg b/tools/perf/tests/perf-targz-src-pkg
index f2d9c5fe58e09f..fae26b1cf08f50 100755
--- a/tools/perf/tests/perf-targz-src-pkg
+++ b/tools/perf/tests/perf-targz-src-pkg
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Test one of the main kernel Makefile targets to generate a perf sources tarball
# suitable for build outside the full kernel sources.
#
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c
index 9f7f589f9c548b..9abca267afa91d 100644
--- a/tools/perf/tests/pmu.c
+++ b/tools/perf/tests/pmu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "parse-events.h"
#include "pmu.h"
#include "util.h"
diff --git a/tools/perf/tests/python-use.c b/tools/perf/tests/python-use.c
index 598a7e058ad4f1..5d2df65ada6a74 100644
--- a/tools/perf/tests/python-use.c
+++ b/tools/perf/tests/python-use.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Just test if we can load the python binding.
*/
diff --git a/tools/perf/tests/sample-parsing.c b/tools/perf/tests/sample-parsing.c
index c3858487159d79..3ec6302b6498c2 100644
--- a/tools/perf/tests/sample-parsing.c
+++ b/tools/perf/tests/sample-parsing.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdbool.h>
#include <inttypes.h>
#include <linux/kernel.h>
diff --git a/tools/perf/tests/sdt.c b/tools/perf/tests/sdt.c
index a9903d9b8bc2fb..5059452d27ddf7 100644
--- a/tools/perf/tests/sdt.c
+++ b/tools/perf/tests/sdt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <stdio.h>
#include <sys/epoll.h>
diff --git a/tools/perf/tests/stat.c b/tools/perf/tests/stat.c
index 7f988a9390361f..94250024684a7b 100644
--- a/tools/perf/tests/stat.c
+++ b/tools/perf/tests/stat.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "event.h"
#include "tests.h"
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
index d88511f6072c24..725a196991a884 100644
--- a/tools/perf/tests/sw-clock.c
+++ b/tools/perf/tests/sw-clock.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <unistd.h>
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 2acd78555192d1..7d3f4bf9534f4e 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/time.h>
#include <sys/prctl.h>
#include <errno.h>
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
index f0881d0dd9c9f6..bc4a7344e27425 100644
--- a/tools/perf/tests/task-exit.c
+++ b/tools/perf/tests/task-exit.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "evlist.h"
#include "evsel.h"
#include "thread_map.h"
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 921412a6a88081..2862b80bc288c0 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef TESTS_H
#define TESTS_H
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
index b3423c744f4625..dbcb6a19b3751c 100644
--- a/tools/perf/tests/thread-map.c
+++ b/tools/perf/tests/thread-map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/tools/perf/tests/thread-mg-share.c b/tools/perf/tests/thread-mg-share.c
index b9c7f58db6c416..b1d1bbafe7ae1e 100644
--- a/tools/perf/tests/thread-mg-share.c
+++ b/tools/perf/tests/thread-mg-share.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "tests.h"
#include "machine.h"
#include "thread.h"
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
index 9bbfed51f1d615..17cb1bb3448c84 100644
--- a/tools/perf/tests/topology.c
+++ b/tools/perf/tests/topology.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/tools/perf/tests/unit_number__scnprintf.c b/tools/perf/tests/unit_number__scnprintf.c
index 15cd1cf8c129d7..2bb8cb0039c184 100644
--- a/tools/perf/tests/unit_number__scnprintf.c
+++ b/tools/perf/tests/unit_number__scnprintf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <linux/compiler.h>
#include <linux/types.h>
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 86cb8868f67f11..f6789fb029d688 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/rbtree.h>
#include <inttypes.h>
diff --git a/tools/perf/trace/beauty/beauty.h b/tools/perf/trace/beauty/beauty.h
index 3f067bdab84f83..a6dfd04beaee11 100644
--- a/tools/perf/trace/beauty/beauty.h
+++ b/tools/perf/trace/beauty/beauty.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_TRACE_BEAUTY_H
#define _PERF_TRACE_BEAUTY_H
diff --git a/tools/perf/trace/beauty/eventfd.c b/tools/perf/trace/beauty/eventfd.c
index b08f21eb6f4df4..5d6a477a64002e 100644
--- a/tools/perf/trace/beauty/eventfd.c
+++ b/tools/perf/trace/beauty/eventfd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef EFD_SEMAPHORE
#define EFD_SEMAPHORE 1
#endif
diff --git a/tools/perf/trace/beauty/flock.c b/tools/perf/trace/beauty/flock.c
index 74613703a14eba..f9707f57566c5c 100644
--- a/tools/perf/trace/beauty/flock.c
+++ b/tools/perf/trace/beauty/flock.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <fcntl.h>
#ifndef LOCK_MAND
diff --git a/tools/perf/trace/beauty/futex_op.c b/tools/perf/trace/beauty/futex_op.c
index bfd3359b09b66b..61850fbc85ff33 100644
--- a/tools/perf/trace/beauty/futex_op.c
+++ b/tools/perf/trace/beauty/futex_op.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/futex.h>
#ifndef FUTEX_WAIT_BITSET
diff --git a/tools/perf/trace/beauty/mmap.c b/tools/perf/trace/beauty/mmap.c
index 45b1e0c0018fe7..9e1668b2c5d7cf 100644
--- a/tools/perf/trace/beauty/mmap.c
+++ b/tools/perf/trace/beauty/mmap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <uapi/linux/mman.h>
static size_t syscall_arg__scnprintf_mmap_prot(char *bf, size_t size,
diff --git a/tools/perf/trace/beauty/mode_t.c b/tools/perf/trace/beauty/mode_t.c
index 930d8fef240082..d929ad7dd97be9 100644
--- a/tools/perf/trace/beauty/mode_t.c
+++ b/tools/perf/trace/beauty/mode_t.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/tools/perf/trace/beauty/msg_flags.c b/tools/perf/trace/beauty/msg_flags.c
index 1106c8960cc4b2..c064d6aae65970 100644
--- a/tools/perf/trace/beauty/msg_flags.c
+++ b/tools/perf/trace/beauty/msg_flags.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/tools/perf/trace/beauty/open_flags.c b/tools/perf/trace/beauty/open_flags.c
index e359e041dc0e77..6aec6178a99dcd 100644
--- a/tools/perf/trace/beauty/open_flags.c
+++ b/tools/perf/trace/beauty/open_flags.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/tools/perf/trace/beauty/perf_event_open.c b/tools/perf/trace/beauty/perf_event_open.c
index 311f09dd718d0c..2bafd7c995ffff 100644
--- a/tools/perf/trace/beauty/perf_event_open.c
+++ b/tools/perf/trace/beauty/perf_event_open.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef PERF_FLAG_FD_NO_GROUP
# define PERF_FLAG_FD_NO_GROUP (1UL << 0)
#endif
diff --git a/tools/perf/trace/beauty/pid.c b/tools/perf/trace/beauty/pid.c
index b6d419e16dcf07..0313df34283040 100644
--- a/tools/perf/trace/beauty/pid.c
+++ b/tools/perf/trace/beauty/pid.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
size_t syscall_arg__scnprintf_pid(char *bf, size_t size, struct syscall_arg *arg)
{
int pid = arg->val;
diff --git a/tools/perf/trace/beauty/sched_policy.c b/tools/perf/trace/beauty/sched_policy.c
index 34775295b9b37a..ba5096ae76b609 100644
--- a/tools/perf/trace/beauty/sched_policy.c
+++ b/tools/perf/trace/beauty/sched_policy.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sched.h>
/*
diff --git a/tools/perf/trace/beauty/seccomp.c b/tools/perf/trace/beauty/seccomp.c
index 356441bce27dab..b7097fd5fed9ee 100644
--- a/tools/perf/trace/beauty/seccomp.c
+++ b/tools/perf/trace/beauty/seccomp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#ifndef SECCOMP_SET_MODE_STRICT
#define SECCOMP_SET_MODE_STRICT 0
#endif
diff --git a/tools/perf/trace/beauty/signum.c b/tools/perf/trace/beauty/signum.c
index fde8f2fc65589d..bde18a53f09094 100644
--- a/tools/perf/trace/beauty/signum.c
+++ b/tools/perf/trace/beauty/signum.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <signal.h>
static size_t syscall_arg__scnprintf_signum(char *bf, size_t size, struct syscall_arg *arg)
diff --git a/tools/perf/trace/beauty/socket_type.c b/tools/perf/trace/beauty/socket_type.c
index 0a5ce818131ca8..bca26aef4a77a8 100644
--- a/tools/perf/trace/beauty/socket_type.c
+++ b/tools/perf/trace/beauty/socket_type.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/socket.h>
diff --git a/tools/perf/trace/beauty/waitid_options.c b/tools/perf/trace/beauty/waitid_options.c
index 7942724adec8b7..8465281a093de0 100644
--- a/tools/perf/trace/beauty/waitid_options.c
+++ b/tools/perf/trace/beauty/waitid_options.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/wait.h>
diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index d0c2007c307bba..63399af3049f82 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../util.h"
#include "../string2.h"
#include "../config.h"
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index a12eff75638b39..03e1734412b95f 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_BROWSER_H_
#define _PERF_UI_BROWSER_H_ 1
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 786fecaf578ef7..8f7f59d1a2b591 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../../util/util.h"
#include "../browser.h"
#include "../helpline.h"
diff --git a/tools/perf/ui/browsers/header.c b/tools/perf/ui/browsers/header.c
index e2c9390ff4c524..d75492189acb83 100644
--- a/tools/perf/ui/browsers/header.c
+++ b/tools/perf/ui/browsers/header.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util/cache.h"
#include "util/debug.h"
#include "ui/browser.h"
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 3a433f370e7fd0..68146f4620a573 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <errno.h>
#include <inttypes.h>
diff --git a/tools/perf/ui/browsers/hists.h b/tools/perf/ui/browsers/hists.h
index 23d6acb84800e6..ba431777f55908 100644
--- a/tools/perf/ui/browsers/hists.h
+++ b/tools/perf/ui/browsers/hists.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_BROWSER_HISTS_H_
#define _PERF_UI_BROWSER_HISTS_H_ 1
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c
index ffa5addf631d95..e03fa75f108a8b 100644
--- a/tools/perf/ui/browsers/map.c
+++ b/tools/perf/ui/browsers/map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elf.h>
#include <inttypes.h>
#include <sys/ttydefaults.h>
diff --git a/tools/perf/ui/browsers/map.h b/tools/perf/ui/browsers/map.h
index 2d58e4b3eb6ffb..0ed7dbb3a373b1 100644
--- a/tools/perf/ui/browsers/map.h
+++ b/tools/perf/ui/browsers/map.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_MAP_BROWSER_H_
#define _PERF_UI_MAP_BROWSER_H_ 1
struct map;
diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
index ad6b6ee3770e43..90a32ac69e76c9 100644
--- a/tools/perf/ui/browsers/scripts.c
+++ b/tools/perf/ui/browsers/scripts.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elf.h>
#include <inttypes.h>
#include <sys/ttydefaults.h>
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c
index 02176193f427a3..fc7a2e105bfdff 100644
--- a/tools/perf/ui/gtk/annotate.c
+++ b/tools/perf/ui/gtk/annotate.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "gtk.h"
#include "util/debug.h"
#include "util/annotate.h"
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c
index c24d91221290e0..4820e25ac68d9a 100644
--- a/tools/perf/ui/gtk/browser.c
+++ b/tools/perf/ui/gtk/browser.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../evlist.h"
#include "../cache.h"
#include "../evsel.h"
diff --git a/tools/perf/ui/gtk/gtk.h b/tools/perf/ui/gtk/gtk.h
index 0a9173ff9a61d1..9846ea5c831b61 100644
--- a/tools/perf/ui/gtk/gtk.h
+++ b/tools/perf/ui/gtk/gtk.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_GTK_H_
#define _PERF_GTK_H_ 1
diff --git a/tools/perf/ui/gtk/helpline.c b/tools/perf/ui/gtk/helpline.c
index 3388cbd12186ac..fbf1ea9ce9a227 100644
--- a/tools/perf/ui/gtk/helpline.c
+++ b/tools/perf/ui/gtk/helpline.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <string.h>
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index e24f8395770552..24e1ec201ffd23 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../evlist.h"
#include "../cache.h"
#include "../evsel.h"
diff --git a/tools/perf/ui/gtk/progress.c b/tools/perf/ui/gtk/progress.c
index b656655fbc39e6..b6ad8857da78f2 100644
--- a/tools/perf/ui/gtk/progress.c
+++ b/tools/perf/ui/gtk/progress.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include "gtk.h"
diff --git a/tools/perf/ui/gtk/setup.c b/tools/perf/ui/gtk/setup.c
index 1d57676f82124d..506e73b3834c0e 100644
--- a/tools/perf/ui/gtk/setup.c
+++ b/tools/perf/ui/gtk/setup.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "gtk.h"
#include "../../util/cache.h"
#include "../../util/debug.h"
diff --git a/tools/perf/ui/gtk/util.c b/tools/perf/ui/gtk/util.c
index 00b91921edb1ff..7250d8101c8fee 100644
--- a/tools/perf/ui/gtk/util.c
+++ b/tools/perf/ui/gtk/util.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../util.h"
#include "../../util/util.h"
#include "../../util/debug.h"
diff --git a/tools/perf/ui/helpline.c b/tools/perf/ui/helpline.c
index 379039ab00d82d..b3c421429ed440 100644
--- a/tools/perf/ui/helpline.c
+++ b/tools/perf/ui/helpline.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/ui/helpline.h b/tools/perf/ui/helpline.h
index d52d0a1a881b88..8f775a053ca33e 100644
--- a/tools/perf/ui/helpline.h
+++ b/tools/perf/ui/helpline.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_HELPLINE_H_
#define _PERF_UI_HELPLINE_H_ 1
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index db79017a6e56fc..706f6f1e9c7d65 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <math.h>
#include <linux/compiler.h>
diff --git a/tools/perf/ui/keysyms.h b/tools/perf/ui/keysyms.h
index 65092d576b4e25..fbfac29077f2d0 100644
--- a/tools/perf/ui/keysyms.h
+++ b/tools/perf/ui/keysyms.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_KEYSYMS_H_
#define _PERF_KEYSYMS_H_ 1
diff --git a/tools/perf/ui/libslang.h b/tools/perf/ui/libslang.h
index db816695ad970a..c0686cda39a56b 100644
--- a/tools/perf/ui/libslang.h
+++ b/tools/perf/ui/libslang.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_SLANG_H_
#define _PERF_UI_SLANG_H_ 1
/*
diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c
index 7ade387d511c2f..bbfbc91a0fa468 100644
--- a/tools/perf/ui/progress.c
+++ b/tools/perf/ui/progress.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include "../cache.h"
#include "progress.h"
diff --git a/tools/perf/ui/progress.h b/tools/perf/ui/progress.h
index fbaa1507ebfe82..4f52c37b2f099a 100644
--- a/tools/perf/ui/progress.h
+++ b/tools/perf/ui/progress.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_PROGRESS_H_
#define _PERF_UI_PROGRESS_H_ 1
diff --git a/tools/perf/ui/setup.c b/tools/perf/ui/setup.c
index caf1ce6f51527b..44fe824e96cd01 100644
--- a/tools/perf/ui/setup.c
+++ b/tools/perf/ui/setup.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <pthread.h>
#include <dlfcn.h>
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index b6b9baac0e3b53..25dd1e0ecc5818 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <linux/string.h>
diff --git a/tools/perf/ui/tui/helpline.c b/tools/perf/ui/tui/helpline.c
index 88f5143a598115..4ca799aadb4e8c 100644
--- a/tools/perf/ui/tui/helpline.c
+++ b/tools/perf/ui/tui/helpline.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/ui/tui/progress.c b/tools/perf/ui/tui/progress.c
index 68f6144ea60325..bc134b82829d64 100644
--- a/tools/perf/ui/tui/progress.c
+++ b/tools/perf/ui/tui/progress.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include "../cache.h"
#include "../progress.h"
diff --git a/tools/perf/ui/tui/setup.c b/tools/perf/ui/tui/setup.c
index d9350a1da48b46..d4ac41679721bf 100644
--- a/tools/perf/ui/tui/setup.c
+++ b/tools/perf/ui/tui/setup.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <signal.h>
#include <stdbool.h>
diff --git a/tools/perf/ui/tui/tui.h b/tools/perf/ui/tui/tui.h
index 18961c7b6ec5da..8de06f634c5691 100644
--- a/tools/perf/ui/tui/tui.h
+++ b/tools/perf/ui/tui/tui.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_TUI_H_
#define _PERF_TUI_H_ 1
diff --git a/tools/perf/ui/tui/util.c b/tools/perf/ui/tui/util.c
index d96ad7c8325d7c..b9794d6185afb5 100644
--- a/tools/perf/ui/tui/util.c
+++ b/tools/perf/ui/tui/util.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../../util/util.h"
#include <signal.h>
#include <stdbool.h>
diff --git a/tools/perf/ui/ui.h b/tools/perf/ui/ui.h
index 4b6fb6c7a542c5..9b6fdf06e1d2f9 100644
--- a/tools/perf/ui/ui.h
+++ b/tools/perf/ui/ui.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_H_
#define _PERF_UI_H_ 1
diff --git a/tools/perf/ui/util.c b/tools/perf/ui/util.c
index e3e0a963d03aa3..63bf06e80ab9db 100644
--- a/tools/perf/ui/util.c
+++ b/tools/perf/ui/util.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include "../debug.h"
diff --git a/tools/perf/ui/util.h b/tools/perf/ui/util.h
index 361f08c52d37cb..5e44223b56faa0 100644
--- a/tools/perf/ui/util.h
+++ b/tools/perf/ui/util.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UI_UTIL_H_
#define _PERF_UI_UTIL_H_ 1
diff --git a/tools/perf/util/PERF-VERSION-GEN b/tools/perf/util/PERF-VERSION-GEN
index 39f17507578dae..3802cee5e1887f 100755
--- a/tools/perf/util/PERF-VERSION-GEN
+++ b/tools/perf/util/PERF-VERSION-GEN
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
if [ $# -eq 1 ] ; then
OUTPUT=$1
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 08164162c34564..da1c4c4a0dd842 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -605,9 +605,19 @@ static struct arch *arch__find(const char *name)
int symbol__alloc_hist(struct symbol *sym)
{
struct annotation *notes = symbol__annotation(sym);
- const size_t size = symbol__size(sym);
+ size_t size = symbol__size(sym);
size_t sizeof_sym_hist;
+ /*
+ * Add buffer of one element for zero length symbol.
+ * When sample is taken from first instruction of
+ * zero length symbol, perf still resolves it and
+ * shows symbol name in perf report and allows to
+ * annotate it.
+ */
+ if (size == 0)
+ size = 1;
+
/* Check for overflow when calculating sizeof_sym_hist */
if (size > (SIZE_MAX - sizeof(struct sym_hist)) / sizeof(struct sym_hist_entry))
return -1;
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 9ce575c25fd9bd..f6ba3560de5ea5 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_ANNOTATE_H
#define __PERF_ANNOTATE_H
diff --git a/tools/perf/util/block-range.c b/tools/perf/util/block-range.c
index 7b3e1d75d80361..f1451c987eec8e 100644
--- a/tools/perf/util/block-range.c
+++ b/tools/perf/util/block-range.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "block-range.h"
#include "annotate.h"
diff --git a/tools/perf/util/block-range.h b/tools/perf/util/block-range.h
index a8c84138113156..a5ba719d69fb1f 100644
--- a/tools/perf/util/block-range.h
+++ b/tools/perf/util/block-range.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_BLOCK_RANGE_H
#define __PERF_BLOCK_RANGE_H
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index 4a1264c66101bd..72c107fcbc5a5a 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* bpf-loader.c
*
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h
index 48863867878bc3..5d3aefd6fae7c6 100644
--- a/tools/perf/util/bpf-loader.h
+++ b/tools/perf/util/bpf-loader.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2015, Wang Nan <wangnan0@huawei.com>
* Copyright (C) 2015, Huawei Inc.
diff --git a/tools/perf/util/bpf-prologue.c b/tools/perf/util/bpf-prologue.c
index 827f9140f3b8ab..29347756b0afbe 100644
--- a/tools/perf/util/bpf-prologue.c
+++ b/tools/perf/util/bpf-prologue.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* bpf-prologue.c
*
diff --git a/tools/perf/util/bpf-prologue.h b/tools/perf/util/bpf-prologue.h
index ba564838375f7b..c50c7358009f23 100644
--- a/tools/perf/util/bpf-prologue.h
+++ b/tools/perf/util/bpf-prologue.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2015, He Kuang <hekuang@huawei.com>
* Copyright (C) 2015, Huawei Inc.
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index c1a06fcd7e70b8..7f8553630c4d9f 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* build-id.c
*
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h
index c94b0dcbfd7418..f0c565164a97aa 100644
--- a/tools/perf/util/build-id.h
+++ b/tools/perf/util/build-id.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_BUILD_ID_H_
#define PERF_BUILD_ID_H_ 1
diff --git a/tools/perf/util/c++/clang-c.h b/tools/perf/util/c++/clang-c.h
index ccafcf72b37a84..e513366f2ee00d 100644
--- a/tools/perf/util/c++/clang-c.h
+++ b/tools/perf/util/c++/clang-c.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_UTIL_CLANG_C_H
#define PERF_UTIL_CLANG_C_H
diff --git a/tools/perf/util/c++/clang-test.cpp b/tools/perf/util/c++/clang-test.cpp
index 9b11e8c8279895..a4014d786676cb 100644
--- a/tools/perf/util/c++/clang-test.cpp
+++ b/tools/perf/util/c++/clang-test.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "clang.h"
#include "clang-c.h"
#include "llvm/IR/Function.h"
diff --git a/tools/perf/util/c++/clang.cpp b/tools/perf/util/c++/clang.cpp
index 1e974152cac2d3..1bfc946e37dcda 100644
--- a/tools/perf/util/c++/clang.cpp
+++ b/tools/perf/util/c++/clang.cpp
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* llvm C frontend for perf. Support dynamically compile C file
*
diff --git a/tools/perf/util/c++/clang.h b/tools/perf/util/c++/clang.h
index dd8b0427550dc5..6ce33e22f23c08 100644
--- a/tools/perf/util/c++/clang.h
+++ b/tools/perf/util/c++/clang.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_UTIL_CLANG_H
#define PERF_UTIL_CLANG_H
diff --git a/tools/perf/util/cache.h b/tools/perf/util/cache.h
index 0175765c05b923..9f2e36ef5072e9 100644
--- a/tools/perf/util/cache.h
+++ b/tools/perf/util/cache.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_CACHE_H
#define __PERF_CACHE_H
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 837012147c7b56..082505d08d720b 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2009-2011, Frederic Weisbecker <fweisbec@gmail.com>
*
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 8f67b681cde96d..b79ef2478a575f 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_CALLCHAIN_H
#define __PERF_CALLCHAIN_H
diff --git a/tools/perf/util/cgroup.c b/tools/perf/util/cgroup.c
index 0e77bc9e5f3c3b..d9ffc1e6eb3997 100644
--- a/tools/perf/util/cgroup.c
+++ b/tools/perf/util/cgroup.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include "../perf.h"
#include <subcmd/parse-options.h>
diff --git a/tools/perf/util/cgroup.h b/tools/perf/util/cgroup.h
index d91966b97cbd72..afafc87e920147 100644
--- a/tools/perf/util/cgroup.h
+++ b/tools/perf/util/cgroup.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __CGROUP_H__
#define __CGROUP_H__
diff --git a/tools/perf/util/cloexec.c b/tools/perf/util/cloexec.c
index 4b4f00df58a825..ca0fff6272be4c 100644
--- a/tools/perf/util/cloexec.c
+++ b/tools/perf/util/cloexec.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <sched.h>
#include "util.h"
diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
index 94a5a7d829d5ba..78216b1015c441 100644
--- a/tools/perf/util/cloexec.h
+++ b/tools/perf/util/cloexec.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_CLOEXEC_H
#define __PERF_CLOEXEC_H
diff --git a/tools/perf/util/color.c b/tools/perf/util/color.c
index dbbf89b050a5dd..39e628b8938e63 100644
--- a/tools/perf/util/color.c
+++ b/tools/perf/util/color.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/kernel.h>
#include "cache.h"
#include "config.h"
diff --git a/tools/perf/util/color.h b/tools/perf/util/color.h
index 52122bcc31701f..22777b1812eed4 100644
--- a/tools/perf/util/color.h
+++ b/tools/perf/util/color.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_COLOR_H
#define __PERF_COLOR_H
diff --git a/tools/perf/util/comm.c b/tools/perf/util/comm.c
index 756a9c14efbb8f..7798a2cc8a8674 100644
--- a/tools/perf/util/comm.c
+++ b/tools/perf/util/comm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "comm.h"
#include "util.h"
#include <errno.h>
diff --git a/tools/perf/util/comm.h b/tools/perf/util/comm.h
index 71c9c39340d4bf..3e5c438fe85ea5 100644
--- a/tools/perf/util/comm.h
+++ b/tools/perf/util/comm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_COMM_H
#define __PERF_COMM_H
diff --git a/tools/perf/util/compress.h b/tools/perf/util/compress.h
index 67fd1bb7c2b75f..ecca688a25fb75 100644
--- a/tools/perf/util/compress.h
+++ b/tools/perf/util/compress.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_COMPRESS_H
#define PERF_COMPRESS_H
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index d2b6983b1779d7..84eb9393c7db1b 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* config.c
*
diff --git a/tools/perf/util/config.h b/tools/perf/util/config.h
index b6bb11f3f1655d..baf82bf227acba 100644
--- a/tools/perf/util/config.h
+++ b/tools/perf/util/config.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_CONFIG_H
#define __PERF_CONFIG_H
diff --git a/tools/perf/util/counts.c b/tools/perf/util/counts.c
index c4af82ab7808c2..03032b410c291a 100644
--- a/tools/perf/util/counts.c
+++ b/tools/perf/util/counts.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <stdlib.h>
#include "evsel.h"
diff --git a/tools/perf/util/counts.h b/tools/perf/util/counts.h
index cb45a6aecf9dbc..0d1050ccc586bb 100644
--- a/tools/perf/util/counts.h
+++ b/tools/perf/util/counts.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_COUNTS_H
#define __PERF_COUNTS_H
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
index 37b3bb79ee08db..1ccbd334206942 100644
--- a/tools/perf/util/cpumap.c
+++ b/tools/perf/util/cpumap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include <api/fs/fs.h>
#include "../perf.h"
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h
index 6b8bff87481d09..ed8999d1a64025 100644
--- a/tools/perf/util/cpumap.h
+++ b/tools/perf/util/cpumap.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_CPUMAP_H
#define __PERF_CPUMAP_H
diff --git a/tools/perf/util/ctype.c b/tools/perf/util/ctype.c
index 4b261c2ec0f10a..ee4c1e8ed54b4d 100644
--- a/tools/perf/util/ctype.c
+++ b/tools/perf/util/ctype.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Sane locale-independent, ASCII ctype.
*
diff --git a/tools/perf/util/data-convert-bt.h b/tools/perf/util/data-convert-bt.h
index 9a3b587f76c196..821674d63c4ed8 100644
--- a/tools/perf/util/data-convert-bt.h
+++ b/tools/perf/util/data-convert-bt.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __DATA_CONVERT_BT_H
#define __DATA_CONVERT_BT_H
#include "data-convert.h"
diff --git a/tools/perf/util/data-convert.h b/tools/perf/util/data-convert.h
index 5314962fe95bbf..af90b6076c0616 100644
--- a/tools/perf/util/data-convert.h
+++ b/tools/perf/util/data-convert.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __DATA_CONVERT_H
#define __DATA_CONVERT_H
diff --git a/tools/perf/util/data.c b/tools/perf/util/data.c
index f80a23d031d649..48094fde0a682c 100644
--- a/tools/perf/util/data.c
+++ b/tools/perf/util/data.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <sys/types.h>
diff --git a/tools/perf/util/data.h b/tools/perf/util/data.h
index 000c43bbb7acc4..4828f7feea8949 100644
--- a/tools/perf/util/data.h
+++ b/tools/perf/util/data.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_DATA_H
#define __PERF_DATA_H
diff --git a/tools/perf/util/debug.c b/tools/perf/util/debug.c
index cd24ebf0da2f4d..f3a71db8394735 100644
--- a/tools/perf/util/debug.c
+++ b/tools/perf/util/debug.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* For general debugging purposes */
#include "../perf.h"
diff --git a/tools/perf/util/debug.h b/tools/perf/util/debug.h
index c818bdb1c1aba8..77445dfc5c7d26 100644
--- a/tools/perf/util/debug.h
+++ b/tools/perf/util/debug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/* For debugging general purposes */
#ifndef __PERF_DEBUG_H
#define __PERF_DEBUG_H
diff --git a/tools/perf/util/demangle-java.c b/tools/perf/util/demangle-java.c
index cb66d334f53286..e4c48675605319 100644
--- a/tools/perf/util/demangle-java.c
+++ b/tools/perf/util/demangle-java.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
diff --git a/tools/perf/util/demangle-java.h b/tools/perf/util/demangle-java.h
index a981c1f968fe97..f936c8eabe5d1d 100644
--- a/tools/perf/util/demangle-java.h
+++ b/tools/perf/util/demangle-java.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_DEMANGLE_JAVA
#define __PERF_DEMANGLE_JAVA 1
/*
diff --git a/tools/perf/util/demangle-rust.c b/tools/perf/util/demangle-rust.c
index f9dafa888c0637..423afbbd386bb0 100644
--- a/tools/perf/util/demangle-rust.c
+++ b/tools/perf/util/demangle-rust.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <string.h>
#include "util.h"
#include "debug.h"
diff --git a/tools/perf/util/demangle-rust.h b/tools/perf/util/demangle-rust.h
index 7b41ead7e0ddfe..2fca618b1aa599 100644
--- a/tools/perf/util/demangle-rust.h
+++ b/tools/perf/util/demangle-rust.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_DEMANGLE_RUST
#define __PERF_DEMANGLE_RUST 1
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c
index 3192b608e91b4d..d5b6f7f5baffff 100644
--- a/tools/perf/util/dso.c
+++ b/tools/perf/util/dso.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <asm/bug.h>
#include <linux/kernel.h>
#include <sys/time.h>
diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
index 821b16c670309c..c229dbe0277a2a 100644
--- a/tools/perf/util/dso.h
+++ b/tools/perf/util/dso.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_DSO
#define __PERF_DSO
diff --git a/tools/perf/util/dump-insn.c b/tools/perf/util/dump-insn.c
index ffbdb19f05d01d..10988d3de7cec8 100644
--- a/tools/perf/util/dump-insn.c
+++ b/tools/perf/util/dump-insn.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include "dump-insn.h"
diff --git a/tools/perf/util/dump-insn.h b/tools/perf/util/dump-insn.h
index 90fb115981cf5d..0e06280a88602b 100644
--- a/tools/perf/util/dump-insn.h
+++ b/tools/perf/util/dump-insn.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_DUMP_INSN_H
#define __PERF_DUMP_INSN_H 1
diff --git a/tools/perf/util/dwarf-regs.c b/tools/perf/util/dwarf-regs.c
index c708395b3cb661..db55eddce8cd57 100644
--- a/tools/perf/util/dwarf-regs.c
+++ b/tools/perf/util/dwarf-regs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* dwarf-regs.c : Mapping of DWARF debug register numbers into register names.
*
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
index 9e21538c42ae96..6276b340f893e9 100644
--- a/tools/perf/util/env.c
+++ b/tools/perf/util/env.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "cpumap.h"
#include "env.h"
#include "util.h"
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index b164dfd2dcbf59..1eb35b190b3423 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_ENV_H
#define __PERF_ENV_H
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 3c411e7e36aa99..97a8ef9980db74 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index d6cbb0a0d919c7..1ae95efbfb95d2 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_RECORD_H
#define __PERF_RECORD_H
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index 8c433e95bd9a57..e72ae64c11acb5 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_EVLIST_H
#define __PERF_EVLIST_H 1
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 64782b19089d40..9277df96ffdad9 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_EVSEL_H
#define __PERF_EVSEL_H 1
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 5b9e89257aa797..06dfb027879d01 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <stdio.h>
#include <stdbool.h>
diff --git a/tools/perf/util/expr.h b/tools/perf/util/expr.h
index 400ef9eab00a08..046160831f9052 100644
--- a/tools/perf/util/expr.h
+++ b/tools/perf/util/expr.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PARSE_CTX_H
#define PARSE_CTX_H 1
diff --git a/tools/perf/util/find-vdso-map.c b/tools/perf/util/find-vdso-map.c
index 95ef1cffc0562f..d7823e3508fcb2 100644
--- a/tools/perf/util/find-vdso-map.c
+++ b/tools/perf/util/find-vdso-map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
static int find_vdso_map(void **start, void **end)
{
FILE *maps;
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h
index 2424bd9862a309..de322d51c7fe2c 100644
--- a/tools/perf/util/genelf.h
+++ b/tools/perf/util/genelf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __GENELF_H__
#define __GENELF_H__
diff --git a/tools/perf/util/generate-cmdlist.sh b/tools/perf/util/generate-cmdlist.sh
index 0ac2037c970c9c..9bbcec4e3365e9 100755
--- a/tools/perf/util/generate-cmdlist.sh
+++ b/tools/perf/util/generate-cmdlist.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
echo "/* Automatically generated by $0 */
struct cmdname_help
diff --git a/tools/perf/util/group.h b/tools/perf/util/group.h
index 116debe7a99570..f36c7e31780a9b 100644
--- a/tools/perf/util/group.h
+++ b/tools/perf/util/group.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef GROUP_H
#define GROUP_H 1
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 6e59dcca9df273..7c0e9d587bfaf0 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include "util.h"
diff --git a/tools/perf/util/header.h b/tools/perf/util/header.h
index f7a16ee527b8ae..29ccbfdf872451 100644
--- a/tools/perf/util/header.h
+++ b/tools/perf/util/header.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_HEADER_H
#define __PERF_HEADER_H
diff --git a/tools/perf/util/help-unknown-cmd.c b/tools/perf/util/help-unknown-cmd.c
index 15b95300d7f37e..4f07a5ba5030b9 100644
--- a/tools/perf/util/help-unknown-cmd.c
+++ b/tools/perf/util/help-unknown-cmd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "cache.h"
#include "config.h"
#include <poll.h>
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 25d143053ab57b..b6140950301eec 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include "build-id.h"
#include "hist.h"
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index e60dda26a9207c..f6630cb95effc3 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_HIST_H
#define __PERF_HIST_H
diff --git a/tools/perf/util/include/asm/asm-offsets.h b/tools/perf/util/include/asm/asm-offsets.h
index ed538942523d6a..3aff4cf4494492 100644
--- a/tools/perf/util/include/asm/asm-offsets.h
+++ b/tools/perf/util/include/asm/asm-offsets.h
@@ -1 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/* stub */
diff --git a/tools/perf/util/include/asm/cpufeature.h b/tools/perf/util/include/asm/cpufeature.h
index acffd5e4d1d4ea..2270481c7e0aa9 100644
--- a/tools/perf/util/include/asm/cpufeature.h
+++ b/tools/perf/util/include/asm/cpufeature.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_CPUFEATURE_H
#define PERF_CPUFEATURE_H
diff --git a/tools/perf/util/include/asm/dwarf2.h b/tools/perf/util/include/asm/dwarf2.h
index afe38199e92242..e9876be63dbf0f 100644
--- a/tools/perf/util/include/asm/dwarf2.h
+++ b/tools/perf/util/include/asm/dwarf2.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_DWARF2_H
#define PERF_DWARF2_H
diff --git a/tools/perf/util/include/asm/uaccess.h b/tools/perf/util/include/asm/uaccess.h
index d0f72b8fcc355b..6a6f4b990547ec 100644
--- a/tools/perf/util/include/asm/uaccess.h
+++ b/tools/perf/util/include/asm/uaccess.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_ASM_UACCESS_H_
#define _PERF_ASM_UACCESS_H_
diff --git a/tools/perf/util/include/dwarf-regs.h b/tools/perf/util/include/dwarf-regs.h
index 43bfd8da7919a6..7d99a084e82d7c 100644
--- a/tools/perf/util/include/dwarf-regs.h
+++ b/tools/perf/util/include/dwarf-regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_DWARF_REGS_H_
#define _PERF_DWARF_REGS_H_
diff --git a/tools/perf/util/include/linux/linkage.h b/tools/perf/util/include/linux/linkage.h
index 06387cffe12582..f01d48a8d70798 100644
--- a/tools/perf/util/include/linux/linkage.h
+++ b/tools/perf/util/include/linux/linkage.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_LINUX_LINKAGE_H_
#define PERF_LINUX_LINKAGE_H_
diff --git a/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk b/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk
index 54e961659514c7..ddd5c4c21129b2 100644
--- a/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk
+++ b/tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk
@@ -1,4 +1,5 @@
#!/bin/awk -f
+# SPDX-License-Identifier: GPL-2.0
# gen-insn-attr-x86.awk: Instruction attribute table generator
# Written by Masami Hiramatsu <mhiramat@redhat.com>
#
diff --git a/tools/perf/util/intlist.h b/tools/perf/util/intlist.h
index 020b9ca1b47ed8..85bab8735fa9b9 100644
--- a/tools/perf/util/intlist.h
+++ b/tools/perf/util/intlist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_INTLIST_H
#define __PERF_INTLIST_H
diff --git a/tools/perf/util/jit.h b/tools/perf/util/jit.h
index 961e7a8a0e1734..6817ffc2a059fb 100644
--- a/tools/perf/util/jit.h
+++ b/tools/perf/util/jit.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __JIT_H__
#define __JIT_H__
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index e7645098a323e4..a1863000e972db 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <errno.h>
diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h
index d01e73592f6e34..7b1f0656752170 100644
--- a/tools/perf/util/kvm-stat.h
+++ b/tools/perf/util/kvm-stat.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_KVM_STAT_H
#define __PERF_KVM_STAT_H
diff --git a/tools/perf/util/levenshtein.c b/tools/perf/util/levenshtein.c
index f616e4f65b6744..a217ecf0359df1 100644
--- a/tools/perf/util/levenshtein.c
+++ b/tools/perf/util/levenshtein.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "levenshtein.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/tools/perf/util/levenshtein.h b/tools/perf/util/levenshtein.h
index b0fcb6d8a881d8..34ca173c557d9e 100644
--- a/tools/perf/util/levenshtein.h
+++ b/tools/perf/util/levenshtein.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_LEVENSHTEIN_H
#define __PERF_LEVENSHTEIN_H
diff --git a/tools/perf/util/libunwind/arm64.c b/tools/perf/util/libunwind/arm64.c
index 6559bc586643de..66756e6be111fa 100644
--- a/tools/perf/util/libunwind/arm64.c
+++ b/tools/perf/util/libunwind/arm64.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file setups defines to compile arch specific binary from the
* generic one.
diff --git a/tools/perf/util/libunwind/x86_32.c b/tools/perf/util/libunwind/x86_32.c
index 957ffff724286a..c5e568188e199a 100644
--- a/tools/perf/util/libunwind/x86_32.c
+++ b/tools/perf/util/libunwind/x86_32.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* This file setups defines to compile arch specific binary from the
* generic one.
diff --git a/tools/perf/util/llvm-utils.c b/tools/perf/util/llvm-utils.c
index 209b0c82eff466..4952b429caa738 100644
--- a/tools/perf/util/llvm-utils.c
+++ b/tools/perf/util/llvm-utils.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2015, Wang Nan <wangnan0@huawei.com>
* Copyright (C) 2015, Huawei Inc.
diff --git a/tools/perf/util/llvm-utils.h b/tools/perf/util/llvm-utils.h
index c87a2a92a88fac..d3ad8deb5db4d3 100644
--- a/tools/perf/util/llvm-utils.h
+++ b/tools/perf/util/llvm-utils.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2015, Wang Nan <wangnan0@huawei.com>
* Copyright (C) 2015, Huawei Inc.
diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c
index 4ca7c5c6cdcd0a..07498eaddc0836 100644
--- a/tools/perf/util/lzma.c
+++ b/tools/perf/util/lzma.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <lzma.h>
#include <stdio.h>
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 94d8f1ccedd907..6a8d03c3d9b709 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <errno.h>
#include <inttypes.h>
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h
index c6a299ea506c9a..5ce860b64c7417 100644
--- a/tools/perf/util/machine.h
+++ b/tools/perf/util/machine.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_MACHINE_H
#define __PERF_MACHINE_H
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 5792d7a78152f5..6d40efd7440273 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "symbol.h"
#include <errno.h>
#include <inttypes.h>
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index d5d7442dac7a71..edeb7291c8e1ff 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_MAP_H
#define __PERF_MAP_H
diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index 28afe5fa84d613..93f74d8d3cdd96 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index 40f72ee4f42a25..a889ec2fa9f537 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_MEM_EVENTS_H
#define __PERF_MEM_EVENTS_H
diff --git a/tools/perf/util/memswap.c b/tools/perf/util/memswap.c
index 55f7faa8d9ec06..c1317e4983bcf5 100644
--- a/tools/perf/util/memswap.c
+++ b/tools/perf/util/memswap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <byteswap.h>
#include "memswap.h"
#include <linux/types.h>
diff --git a/tools/perf/util/memswap.h b/tools/perf/util/memswap.h
index 7d1b1c34bb5702..1e29ff903ca925 100644
--- a/tools/perf/util/memswap.h
+++ b/tools/perf/util/memswap.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_MEMSWAP_H_
#define PERF_MEMSWAP_H_
diff --git a/tools/perf/util/ordered-events.c b/tools/perf/util/ordered-events.c
index 4de398cfb57717..8e09fd2d842f49 100644
--- a/tools/perf/util/ordered-events.c
+++ b/tools/perf/util/ordered-events.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <linux/list.h>
diff --git a/tools/perf/util/ordered-events.h b/tools/perf/util/ordered-events.h
index e11468a9a6e408..96e5292d88e258 100644
--- a/tools/perf/util/ordered-events.h
+++ b/tools/perf/util/ordered-events.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ORDERED_EVENTS_H
#define __ORDERED_EVENTS_H
diff --git a/tools/perf/util/parse-branch-options.c b/tools/perf/util/parse-branch-options.c
index e71fb5f31e84db..bd779d9f4d1eab 100644
--- a/tools/perf/util/parse-branch-options.c
+++ b/tools/perf/util/parse-branch-options.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "util/util.h"
#include "util/debug.h"
diff --git a/tools/perf/util/parse-branch-options.h b/tools/perf/util/parse-branch-options.h
index 6086fd90eb23a3..11d1722733f24c 100644
--- a/tools/perf/util/parse-branch-options.h
+++ b/tools/perf/util/parse-branch-options.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_PARSE_BRANCH_OPTIONS_H
#define _PERF_PARSE_BRANCH_OPTIONS_H 1
#include <stdint.h>
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 04f35db063ee74..a7fcd95961ef07 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/hw_breakpoint.h>
#include <linux/err.h>
#include <dirent.h>
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index 3909ca0639f25d..be337c266697a7 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_PARSE_EVENTS_H
#define __PERF_PARSE_EVENTS_H
/*
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l
index 38a42bdf1492ba..241396cd059da6 100644
--- a/tools/perf/util/parse-events.l
+++ b/tools/perf/util/parse-events.l
@@ -154,6 +154,10 @@ do { \
yycolumn += yyleng; \
} while (0);
+#define USER_REJECT \
+ yycolumn -= yyleng; \
+ REJECT
+
%}
%x mem
@@ -336,8 +340,8 @@ r{num_raw_hex} { return raw(yyscanner); }
{num_hex} { return value(yyscanner, 16); }
{modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); }
-{bpf_object} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_OBJECT); }
-{bpf_source} { if (!isbpf(yyscanner)) REJECT; return str(yyscanner, PE_BPF_SOURCE); }
+{bpf_object} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); }
+{bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); }
{name} { return pmu_str_check(yyscanner); }
"/" { BEGIN(config); return '/'; }
- { return '-'; }
diff --git a/tools/perf/util/parse-regs-options.c b/tools/perf/util/parse-regs-options.c
index 646ecf736aadb7..e6599e290f467c 100644
--- a/tools/perf/util/parse-regs-options.c
+++ b/tools/perf/util/parse-regs-options.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "perf.h"
#include "util/util.h"
#include "util/debug.h"
diff --git a/tools/perf/util/parse-regs-options.h b/tools/perf/util/parse-regs-options.h
index 7d762b188007fb..cdefb1acf6be18 100644
--- a/tools/perf/util/parse-regs-options.h
+++ b/tools/perf/util/parse-regs-options.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_PARSE_REGS_OPTIONS_H
#define _PERF_PARSE_REGS_OPTIONS_H 1
struct option;
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 50ec3bc87a6044..933f5c6bffb453 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* I'm tired of doing "vsnprintf()" etc just to open a
* file, so here's a "return static buffer with printf"
diff --git a/tools/perf/util/path.h b/tools/perf/util/path.h
index 9a276a58e3c2c8..14a254ada7eb47 100644
--- a/tools/perf/util/path.h
+++ b/tools/perf/util/path.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_PATH_H
#define _PERF_PATH_H
diff --git a/tools/perf/util/perf-hooks.c b/tools/perf/util/perf-hooks.c
index d55092964da2f3..4f3aa8d99ef4d2 100644
--- a/tools/perf/util/perf-hooks.c
+++ b/tools/perf/util/perf-hooks.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* perf_hooks.c
*
diff --git a/tools/perf/util/perf-hooks.h b/tools/perf/util/perf-hooks.h
index 838d5797bc1ef4..27fbec62d4fe91 100644
--- a/tools/perf/util/perf-hooks.h
+++ b/tools/perf/util/perf-hooks.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_UTIL_PERF_HOOKS_H
#define PERF_UTIL_PERF_HOOKS_H
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index b2ae039eff85c4..2acfcc527caca6 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include "perf_regs.h"
#include "event.h"
diff --git a/tools/perf/util/perf_regs.h b/tools/perf/util/perf_regs.h
index 32b37d19dcc34b..c9319f8d17a6ac 100644
--- a/tools/perf/util/perf_regs.h
+++ b/tools/perf/util/perf_regs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_REGS_H
#define __PERF_REGS_H
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 94cf2c29fed616..07cb2ac041d7a6 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/list.h>
#include <linux/compiler.h>
#include <sys/types.h>
diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h
index 7ca675598b43a1..27c75e63586695 100644
--- a/tools/perf/util/pmu.h
+++ b/tools/perf/util/pmu.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PMU_H
#define __PMU_H
diff --git a/tools/perf/util/print_binary.c b/tools/perf/util/print_binary.c
index df55ad3b47a0f3..23e3670634465c 100644
--- a/tools/perf/util/print_binary.c
+++ b/tools/perf/util/print_binary.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "print_binary.h"
#include <linux/log2.h>
#include "sane_ctype.h"
diff --git a/tools/perf/util/print_binary.h b/tools/perf/util/print_binary.h
index f97918a179db31..2a1554afc95757 100644
--- a/tools/perf/util/print_binary.h
+++ b/tools/perf/util/print_binary.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_PRINT_BINARY_H
#define PERF_PRINT_BINARY_H
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 078681d1216871..45b14f0205587e 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PROBE_EVENT_H
#define _PROBE_EVENT_H
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h
index 2ca4163abafeb7..63f29b1d22c18c 100644
--- a/tools/perf/util/probe-file.h
+++ b/tools/perf/util/probe-file.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PROBE_FILE_H
#define __PROBE_FILE_H
diff --git a/tools/perf/util/probe-finder.h b/tools/perf/util/probe-finder.h
index 27f06155101298..16252980ff00b1 100644
--- a/tools/perf/util/probe-finder.h
+++ b/tools/perf/util/probe-finder.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PROBE_FINDER_H
#define _PROBE_FINDER_H
diff --git a/tools/perf/util/pstack.c b/tools/perf/util/pstack.c
index b234a6e3d0d4f3..797fe1ae2d2e4e 100644
--- a/tools/perf/util/pstack.c
+++ b/tools/perf/util/pstack.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Simple pointer stack
*
diff --git a/tools/perf/util/pstack.h b/tools/perf/util/pstack.h
index ded7f2e36624a9..8729b8be061d6e 100644
--- a/tools/perf/util/pstack.h
+++ b/tools/perf/util/pstack.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_PSTACK_
#define _PERF_PSTACK_
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
index c129e99114aedf..8e49d9cafcfc00 100644
--- a/tools/perf/util/python.c
+++ b/tools/perf/util/python.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <Python.h>
#include <structmember.h>
#include <inttypes.h>
diff --git a/tools/perf/util/quote.c b/tools/perf/util/quote.c
index 1ba8920151d891..22eaa201aa275a 100644
--- a/tools/perf/util/quote.c
+++ b/tools/perf/util/quote.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <stdlib.h>
#include "strbuf.h"
diff --git a/tools/perf/util/quote.h b/tools/perf/util/quote.h
index 055ca45bed9920..274bf26d351129 100644
--- a/tools/perf/util/quote.h
+++ b/tools/perf/util/quote.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_QUOTE_H
#define __PERF_QUOTE_H
diff --git a/tools/perf/util/rb_resort.h b/tools/perf/util/rb_resort.h
index b30746f5f6139a..a920f702a74dfd 100644
--- a/tools/perf/util/rb_resort.h
+++ b/tools/perf/util/rb_resort.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_RESORT_RB_H_
#define _PERF_RESORT_RB_H_
/*
diff --git a/tools/perf/util/rblist.h b/tools/perf/util/rblist.h
index ff9913b994c261..4c8638a2257119 100644
--- a/tools/perf/util/rblist.h
+++ b/tools/perf/util/rblist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_RBLIST_H
#define __PERF_RBLIST_H
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
index d91bdf5a1aa459..1e97937b03a933 100644
--- a/tools/perf/util/record.c
+++ b/tools/perf/util/record.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "evlist.h"
#include "evsel.h"
#include "cpumap.h"
diff --git a/tools/perf/util/sane_ctype.h b/tools/perf/util/sane_ctype.h
index 4308c22c22ad14..c2b42ff9ff3244 100644
--- a/tools/perf/util/sane_ctype.h
+++ b/tools/perf/util/sane_ctype.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_SANE_CTYPE_H
#define _PERF_SANE_CTYPE_H
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index c09b748ab5994b..5c412310f26644 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <linux/kernel.h>
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index cc1c5ea53c39cf..80bc80de8362c0 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SESSION_H
#define __PERF_SESSION_H
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 006d10a0dc962d..a00eacdf02ed9d 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <regex.h>
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 507d096aee4e43..f5901c10a563c3 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SORT_H
#define __PERF_SORT_H
#include "../builtin.h"
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index ad1b46f1f2cfc1..d19f05c56de61f 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h
index 1c4d6210860b06..847b7086182c1a 100644
--- a/tools/perf/util/srcline.h
+++ b/tools/perf/util/srcline.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_SRCLINE_H
#define PERF_SRCLINE_H
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 51ad03a799ec9b..855e35cbb1dcec 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include "evsel.h"
#include "stat.h"
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 203f5d8d11d113..151e9efd728623 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <inttypes.h>
#include <math.h>
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 490b78aa723025..eefca5c981fdc4 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_STATS_H
#define __PERF_STATS_H
diff --git a/tools/perf/util/strbuf.c b/tools/perf/util/strbuf.c
index aafe908b82b572..3d1cf5bf7f184b 100644
--- a/tools/perf/util/strbuf.c
+++ b/tools/perf/util/strbuf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "debug.h"
#include "util.h"
#include <linux/kernel.h>
diff --git a/tools/perf/util/strbuf.h b/tools/perf/util/strbuf.h
index 802d743378afa5..ea94d862898020 100644
--- a/tools/perf/util/strbuf.h
+++ b/tools/perf/util/strbuf.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_STRBUF_H
#define __PERF_STRBUF_H
diff --git a/tools/perf/util/strfilter.c b/tools/perf/util/strfilter.c
index 4dc0af669a3009..7f3253d44afdef 100644
--- a/tools/perf/util/strfilter.c
+++ b/tools/perf/util/strfilter.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "util.h"
#include "string2.h"
#include "strfilter.h"
diff --git a/tools/perf/util/strfilter.h b/tools/perf/util/strfilter.h
index cff5eda88728b2..e0c25a40f79674 100644
--- a/tools/perf/util/strfilter.h
+++ b/tools/perf/util/strfilter.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_STRFILTER_H
#define __PERF_STRFILTER_H
/* General purpose glob matching filter */
diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index cca53b693a48d8..aaa08ee8c71715 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "string2.h"
#include <linux/kernel.h>
#include <linux/string.h>
diff --git a/tools/perf/util/string2.h b/tools/perf/util/string2.h
index 2f619681bd6a70..ee14ca5451ab27 100644
--- a/tools/perf/util/string2.h
+++ b/tools/perf/util/string2.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_STRING_H
#define PERF_STRING_H
diff --git a/tools/perf/util/strlist.h b/tools/perf/util/strlist.h
index 19207e50fce50a..d58f1e08b170b4 100644
--- a/tools/perf/util/strlist.h
+++ b/tools/perf/util/strlist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_STRLIST_H
#define __PERF_STRLIST_H
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h
index 946fdf2db97caf..e55338d5c3bda6 100644
--- a/tools/perf/util/svghelper.h
+++ b/tools/perf/util/svghelper.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SVGHELPER_H
#define __PERF_SVGHELPER_H
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 9cf781f0d8a2d7..2de770511e705d 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
diff --git a/tools/perf/util/symbol-minimal.c b/tools/perf/util/symbol-minimal.c
index 1a5aa35b0100d0..ff48d0d49584cd 100644
--- a/tools/perf/util/symbol-minimal.c
+++ b/tools/perf/util/symbol-minimal.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "symbol.h"
#include "util.h"
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index ce6993bebf8c1d..1b67a8639dfeb0 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <errno.h>
#include <stdlib.h>
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index d548ea5cb418bd..a4f0075b4e5cf2 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SYMBOL
#define __PERF_SYMBOL 1
diff --git a/tools/perf/util/symbol_fprintf.c b/tools/perf/util/symbol_fprintf.c
index 63694e174e5c3c..6dd2cb88ccbeab 100644
--- a/tools/perf/util/symbol_fprintf.c
+++ b/tools/perf/util/symbol_fprintf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <elf.h>
#include <inttypes.h>
#include <stdio.h>
diff --git a/tools/perf/util/syscalltbl.h b/tools/perf/util/syscalltbl.h
index e9fb8786da7c83..c8e7e9ce0f01e1 100644
--- a/tools/perf/util/syscalltbl.h
+++ b/tools/perf/util/syscalltbl.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_SYSCALLTBL_H
#define __PERF_SYSCALLTBL_H
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index 7381b1ca4041f2..446aa7a56f25f6 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_TARGET_H
#define _PERF_TARGET_H
diff --git a/tools/perf/util/term.c b/tools/perf/util/term.c
index 8f254a74d97dee..e7aa82c06c7662 100644
--- a/tools/perf/util/term.c
+++ b/tools/perf/util/term.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "term.h"
#include <stdlib.h>
#include <termios.h>
diff --git a/tools/perf/util/term.h b/tools/perf/util/term.h
index 2c06a61846a107..607b170a9017a4 100644
--- a/tools/perf/util/term.h
+++ b/tools/perf/util/term.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TERM_H
#define __PERF_TERM_H
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index bf73117b482267..68b65b10579bcc 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../perf.h"
#include <errno.h>
#include <stdlib.h>
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 10555d6a0b86c3..40cfa36c022ab7 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_THREAD_H
#define __PERF_THREAD_H
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index 63ead7b06324c1..be0d5a736deada 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <dirent.h>
#include <errno.h>
#include <limits.h>
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h
index bd34d7a0b9fa9f..f1580398543596 100644
--- a/tools/perf/util/thread_map.h
+++ b/tools/perf/util/thread_map.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_THREAD_MAP_H
#define __PERF_THREAD_MAP_H
diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
index 5b5d0214debdcb..81927d0274176a 100644
--- a/tools/perf/util/time-utils.c
+++ b/tools/perf/util/time-utils.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
diff --git a/tools/perf/util/time-utils.h b/tools/perf/util/time-utils.h
index 8656be08513b17..15b475c50ccf76 100644
--- a/tools/perf/util/time-utils.h
+++ b/tools/perf/util/time-utils.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TIME_UTILS_H_
#define _TIME_UTILS_H_
diff --git a/tools/perf/util/tool.h b/tools/perf/util/tool.h
index d549e50db39793..2532b558099b79 100644
--- a/tools/perf/util/tool.h
+++ b/tools/perf/util/tool.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TOOL_H
#define __PERF_TOOL_H
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index f4296e1e3bb8c0..9892323cdd7cea 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TOP_H
#define __PERF_TOP_H 1
diff --git a/tools/perf/util/trace-event.c b/tools/perf/util/trace-event.c
index c330780674fcff..16a776371d0322 100644
--- a/tools/perf/util/trace-event.c
+++ b/tools/perf/util/trace-event.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <unistd.h>
diff --git a/tools/perf/util/trace-event.h b/tools/perf/util/trace-event.h
index 1fbc044f9eb039..dcbdb53dc702a6 100644
--- a/tools/perf/util/trace-event.h
+++ b/tools/perf/util/trace-event.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_UTIL_TRACE_EVENT_H
#define _PERF_UTIL_TRACE_EVENT_H
diff --git a/tools/perf/util/trigger.h b/tools/perf/util/trigger.h
index e97d7016d771c3..370138e7e35ca3 100644
--- a/tools/perf/util/trigger.h
+++ b/tools/perf/util/trigger.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TRIGGER_H_
#define __TRIGGER_H_ 1
diff --git a/tools/perf/util/tsc.c b/tools/perf/util/tsc.c
index 1b741646eed00b..bfa782421cbdf9 100644
--- a/tools/perf/util/tsc.c
+++ b/tools/perf/util/tsc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <linux/types.h>
diff --git a/tools/perf/util/tsc.h b/tools/perf/util/tsc.h
index d5b11e2b85e050..e0c3af34ac8dfc 100644
--- a/tools/perf/util/tsc.h
+++ b/tools/perf/util/tsc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_TSC_H
#define __PERF_TSC_H
diff --git a/tools/perf/util/units.c b/tools/perf/util/units.c
index 4767ec2c5ef63c..a46762aec4c9f0 100644
--- a/tools/perf/util/units.c
+++ b/tools/perf/util/units.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "units.h"
#include <inttypes.h>
#include <limits.h>
diff --git a/tools/perf/util/units.h b/tools/perf/util/units.h
index f02c87317150e0..99263b6a23f7bb 100644
--- a/tools/perf/util/units.h
+++ b/tools/perf/util/units.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERF_UNIT_H
#define PERF_UNIT_H
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 7755a5e0fe5eb2..1e9c974faf67f0 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/compiler.h>
#include <elfutils/libdw.h>
#include <elfutils/libdwfl.h>
diff --git a/tools/perf/util/unwind-libdw.h b/tools/perf/util/unwind-libdw.h
index 4a2b269a7b3be2..0cbd2650e280e5 100644
--- a/tools/perf/util/unwind-libdw.h
+++ b/tools/perf/util/unwind-libdw.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_UNWIND_LIBDW_H
#define __PERF_UNWIND_LIBDW_H
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 672c2ada9357a2..7a42f703e858b7 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Post mortem Dwarf CFI based unwinding on top of regs and stack dumps.
*
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index 8aef572d08890b..647a1e6b4c7b72 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "unwind.h"
#include "thread.h"
#include "session.h"
diff --git a/tools/perf/util/unwind.h b/tools/perf/util/unwind.h
index bfbdcc6198c9d8..8a44a1569a21bc 100644
--- a/tools/perf/util/unwind.h
+++ b/tools/perf/util/unwind.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __UNWIND_H
#define __UNWIND_H
diff --git a/tools/perf/util/usage.c b/tools/perf/util/usage.c
index 6cc9d9888ce0fc..070d25ceea6a92 100644
--- a/tools/perf/util/usage.c
+++ b/tools/perf/util/usage.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* usage.c
*
diff --git a/tools/perf/util/util-cxx.h b/tools/perf/util/util-cxx.h
index 0e0e019c9f349e..80a99e458d4e0e 100644
--- a/tools/perf/util/util-cxx.h
+++ b/tools/perf/util/util-cxx.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support C++ source use utilities defined in util.h
*/
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 97e0c8e26477a8..a789f952b3e9b8 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "../perf.h"
#include "util.h"
#include "debug.h"
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 6c7e6cc902bb3b..01434509c2e985 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef GIT_COMPAT_UTIL_H
#define GIT_COMPAT_UTIL_H
diff --git a/tools/perf/util/values.c b/tools/perf/util/values.c
index 8a32bb0095e5e6..4b7a303e4ba807 100644
--- a/tools/perf/util/values.c
+++ b/tools/perf/util/values.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tools/perf/util/values.h b/tools/perf/util/values.h
index 808ff9c73bf5d4..8c41f22f42cfbb 100644
--- a/tools/perf/util/values.h
+++ b/tools/perf/util/values.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_VALUES_H
#define __PERF_VALUES_H
diff --git a/tools/perf/util/vdso.c b/tools/perf/util/vdso.c
index f5f843d3c22f59..0acb1ec0e2f08c 100644
--- a/tools/perf/util/vdso.c
+++ b/tools/perf/util/vdso.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/perf/util/vdso.h b/tools/perf/util/vdso.h
index cdc4fabfc2124e..bc74ace603ae70 100644
--- a/tools/perf/util/vdso.h
+++ b/tools/perf/util/vdso.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __PERF_VDSO__
#define __PERF_VDSO__
diff --git a/tools/perf/util/xyarray.c b/tools/perf/util/xyarray.c
index c8f415d9877b08..dc95154f5646b0 100644
--- a/tools/perf/util/xyarray.c
+++ b/tools/perf/util/xyarray.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include "xyarray.h"
#include "util.h"
#include <stdlib.h>
diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h
index 54af604621304a..7ffe562e7ae7fa 100644
--- a/tools/perf/util/xyarray.h
+++ b/tools/perf/util/xyarray.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PERF_XYARRAY_H_
#define _PERF_XYARRAY_H_ 1
diff --git a/tools/perf/util/zlib.c b/tools/perf/util/zlib.c
index 7c1175310a1292..a725b958cf31bb 100644
--- a/tools/perf/util/zlib.c
+++ b/tools/perf/util/zlib.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile
index 4c5a481a850c6d..d6e1c02ddcfead 100644
--- a/tools/power/cpupower/Makefile
+++ b/tools/power/cpupower/Makefile
@@ -26,7 +26,7 @@ endif
ifneq ($(OUTPUT),)
# check that the output directory actually exists
-OUTDIR := $(realpath $(OUTPUT))
+OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
endif
diff --git a/tools/power/cpupower/bench/Makefile b/tools/power/cpupower/bench/Makefile
index 3e59f1aa3947ec..d79ab161cc75f9 100644
--- a/tools/power/cpupower/bench/Makefile
+++ b/tools/power/cpupower/bench/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
OUTPUT := ./
ifeq ("$(origin O)", "command line")
ifneq ($(O),)
diff --git a/tools/power/cpupower/debug/i386/Makefile b/tools/power/cpupower/debug/i386/Makefile
index c05cc0ac80c745..b3f771039b17ae 100644
--- a/tools/power/cpupower/debug/i386/Makefile
+++ b/tools/power/cpupower/debug/i386/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
OUTPUT=./
ifeq ("$(origin O)", "command line")
OUTPUT := $(O)/
diff --git a/tools/power/cpupower/debug/kernel/Makefile b/tools/power/cpupower/debug/kernel/Makefile
index a8a6f8eec5c2d5..c23e5a6ceb7e0f 100644
--- a/tools/power/cpupower/debug/kernel/Makefile
+++ b/tools/power/cpupower/debug/kernel/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
obj-m :=
KDIR := /lib/modules/$(shell uname -r)/build
diff --git a/tools/power/cpupower/debug/x86_64/Makefile b/tools/power/cpupower/debug/x86_64/Makefile
index 1c52145267166a..59af84b8ef455d 100644
--- a/tools/power/cpupower/debug/x86_64/Makefile
+++ b/tools/power/cpupower/debug/x86_64/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
OUTPUT=./
ifeq ("$(origin O)", "command line")
OUTPUT := $(O)/
diff --git a/tools/power/cpupower/lib/cpuidle.h b/tools/power/cpupower/lib/cpuidle.h
index 04eb3cfa6e4290..2e10fead2e1ec5 100644
--- a/tools/power/cpupower/lib/cpuidle.h
+++ b/tools/power/cpupower/lib/cpuidle.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __CPUPOWER_CPUIDLE_H__
#define __CPUPOWER_CPUIDLE_H__
diff --git a/tools/power/cpupower/lib/cpupower.h b/tools/power/cpupower/lib/cpupower.h
index fa031fcc771081..e4e4292eacec6d 100644
--- a/tools/power/cpupower/lib/cpupower.h
+++ b/tools/power/cpupower/lib/cpupower.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __CPUPOWER_CPUPOWER_H__
#define __CPUPOWER_CPUPOWER_H__
diff --git a/tools/power/cpupower/lib/cpupower_intern.h b/tools/power/cpupower/lib/cpupower_intern.h
index f8ec4009621ca2..92affdfbe4174e 100644
--- a/tools/power/cpupower/lib/cpupower_intern.h
+++ b/tools/power/cpupower/lib/cpupower_intern.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#define PATH_TO_CPU "/sys/devices/system/cpu/"
#define MAX_LINE_LEN 4096
#define SYSFS_PATH_MAX 255
diff --git a/tools/power/cpupower/utils/builtin.h b/tools/power/cpupower/utils/builtin.h
index 2284c8ea4e2a51..f7065ae60a1447 100644
--- a/tools/power/cpupower/utils/builtin.h
+++ b/tools/power/cpupower/utils/builtin.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BUILTIN_H
#define BUILTIN_H
diff --git a/tools/power/cpupower/utils/cpuidle-set.c b/tools/power/cpupower/utils/cpuidle-set.c
index 691c24d50ef4db..569f268f4c7ffe 100644
--- a/tools/power/cpupower/utils/cpuidle-set.c
+++ b/tools/power/cpupower/utils/cpuidle-set.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
diff --git a/tools/power/cpupower/utils/helpers/amd.c b/tools/power/cpupower/utils/helpers/amd.c
index 5fd5c5b8c7b8c1..bb41cdd0df6bfe 100644
--- a/tools/power/cpupower/utils/helpers/amd.c
+++ b/tools/power/cpupower/utils/helpers/amd.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#if defined(__i386__) || defined(__x86_64__)
#include <unistd.h>
#include <errno.h>
diff --git a/tools/power/cpupower/utils/helpers/bitmask.c b/tools/power/cpupower/utils/helpers/bitmask.c
index 5c074c60f90441..6c7932f5bd66a4 100644
--- a/tools/power/cpupower/utils/helpers/bitmask.c
+++ b/tools/power/cpupower/utils/helpers/bitmask.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/power/cpupower/utils/helpers/bitmask.h b/tools/power/cpupower/utils/helpers/bitmask.h
index eb289df41053cc..b98d93a44e1b93 100644
--- a/tools/power/cpupower/utils/helpers/bitmask.h
+++ b/tools/power/cpupower/utils/helpers/bitmask.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __CPUPOWER_BITMASK__
#define __CPUPOWER_BITMASK__
diff --git a/tools/power/cpupower/utils/helpers/cpuid.c b/tools/power/cpupower/utils/helpers/cpuid.c
index 32d37c9be79133..732b0b41ba2616 100644
--- a/tools/power/cpupower/utils/helpers/cpuid.c
+++ b/tools/power/cpupower/utils/helpers/cpuid.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <string.h>
diff --git a/tools/power/cpupower/utils/helpers/misc.c b/tools/power/cpupower/utils/helpers/misc.c
index a5e7ddf19dbd65..80fdf55f414dce 100644
--- a/tools/power/cpupower/utils/helpers/misc.c
+++ b/tools/power/cpupower/utils/helpers/misc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#if defined(__i386__) || defined(__x86_64__)
#include "helpers/helpers.h"
diff --git a/tools/power/cpupower/utils/helpers/msr.c b/tools/power/cpupower/utils/helpers/msr.c
index 31a4b24a8bc6f0..ab9950748838a9 100644
--- a/tools/power/cpupower/utils/helpers/msr.c
+++ b/tools/power/cpupower/utils/helpers/msr.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#if defined(__i386__) || defined(__x86_64__)
#include <fcntl.h>
diff --git a/tools/power/cpupower/utils/helpers/pci.c b/tools/power/cpupower/utils/helpers/pci.c
index 8b278983cfc574..113f3da2a203da 100644
--- a/tools/power/cpupower/utils/helpers/pci.c
+++ b/tools/power/cpupower/utils/helpers/pci.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#if defined(__i386__) || defined(__x86_64__)
#include <helpers/helpers.h>
diff --git a/tools/power/cpupower/utils/helpers/sysfs.h b/tools/power/cpupower/utils/helpers/sysfs.h
index d28f11fedbdaa0..0f0b9ad97e4a9a 100644
--- a/tools/power/cpupower/utils/helpers/sysfs.h
+++ b/tools/power/cpupower/utils/helpers/sysfs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __CPUPOWER_HELPERS_SYSFS_H__
#define __CPUPOWER_HELPERS_SYSFS_H__
diff --git a/tools/power/cpupower/utils/version-gen.sh b/tools/power/cpupower/utils/version-gen.sh
index 5ec41c556992a4..c70de2eabffb2b 100755
--- a/tools/power/cpupower/utils/version-gen.sh
+++ b/tools/power/cpupower/utils/version-gen.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
#
# Script which prints out the version to use for building cpupowerutils.
# Must be called from tools/power/cpupower/
diff --git a/tools/power/pm-graph/Makefile b/tools/power/pm-graph/Makefile
index 32f40eacdafeeb..4e1e999e7b0547 100644
--- a/tools/power/pm-graph/Makefile
+++ b/tools/power/pm-graph/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
PREFIX ?= /usr
DESTDIR ?=
diff --git a/tools/power/x86/turbostat/Makefile b/tools/power/x86/turbostat/Makefile
index 8792ad8dbf8370..a9bc914a8fe816 100644
--- a/tools/power/x86/turbostat/Makefile
+++ b/tools/power/x86/turbostat/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC = $(CROSS_COMPILE)gcc
BUILD_OUTPUT := $(CURDIR)
PREFIX ?= /usr
diff --git a/tools/power/x86/x86_energy_perf_policy/Makefile b/tools/power/x86/x86_energy_perf_policy/Makefile
index a711eec0c8953f..2447b1bbaacff8 100644
--- a/tools/power/x86/x86_energy_perf_policy/Makefile
+++ b/tools/power/x86/x86_energy_perf_policy/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC = $(CROSS_COMPILE)gcc
BUILD_OUTPUT := $(CURDIR)
PREFIX := /usr
diff --git a/tools/scripts/Makefile.arch b/tools/scripts/Makefile.arch
index ad85b921a60761..78d90a249e8863 100644
--- a/tools/scripts/Makefile.arch
+++ b/tools/scripts/Makefile.arch
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
-e s/sun4u/sparc/ -e s/sparc64/sparc/ \
-e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
diff --git a/tools/scripts/Makefile.include b/tools/scripts/Makefile.include
index 9dc8f078a83c87..654efd9768fd36 100644
--- a/tools/scripts/Makefile.include
+++ b/tools/scripts/Makefile.include
@@ -1,7 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0
ifneq ($(O),)
ifeq ($(origin O), command line)
- ABSOLUTE_O := $(realpath $(O))
- dummy := $(if $(ABSOLUTE_O),,$(error O=$(O) does not exist))
+ dummy := $(if $(shell test -d $(O) || echo $(O)),$(error O=$(O) does not exist),)
+ ABSOLUTE_O := $(shell cd $(O) ; pwd)
OUTPUT := $(ABSOLUTE_O)/$(if $(subdir),$(subdir)/)
COMMAND_O := O=$(ABSOLUTE_O)
ifeq ($(objtree),)
@@ -12,7 +13,7 @@ endif
# check that the output directory actually exists
ifneq ($(OUTPUT),)
-OUTDIR := $(realpath $(OUTPUT))
+OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd)
$(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist))
endif
diff --git a/tools/spi/spidev_fdx.c b/tools/spi/spidev_fdx.c
index 0ea3e51292fcbb..7d2a867cd4aee6 100644
--- a/tools/spi/spidev_fdx.c
+++ b/tools/spi/spidev_fdx.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/tools/testing/fault-injection/failcmd.sh b/tools/testing/fault-injection/failcmd.sh
index 78a9ed7fecdb34..29a6c63c5a15c0 100644
--- a/tools/testing/fault-injection/failcmd.sh
+++ b/tools/testing/fault-injection/failcmd.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# NAME
# failcmd.sh - run a command with injecting slab/page allocation failures
diff --git a/tools/testing/ktest/compare-ktest-sample.pl b/tools/testing/ktest/compare-ktest-sample.pl
index a373a5bfff683c..4118eb4a842d2e 100755
--- a/tools/testing/ktest/compare-ktest-sample.pl
+++ b/tools/testing/ktest/compare-ktest-sample.pl
@@ -1,4 +1,5 @@
#!/usr/bin/perl
+# SPDX-License-Identifier: GPL-2.0
open (IN,"ktest.pl");
while (<IN>) {
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index d870520da68b9b..65368d9027f549 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ldflags-y += --wrap=ioremap_wc
ldflags-y += --wrap=memremap
ldflags-y += --wrap=devm_ioremap_nocache
diff --git a/tools/testing/nvdimm/Makefile b/tools/testing/nvdimm/Makefile
index 3dfe024b4e7e9a..c37a6a0bde28dc 100644
--- a/tools/testing/nvdimm/Makefile
+++ b/tools/testing/nvdimm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
KDIR ?= ../../../
default:
diff --git a/tools/testing/nvdimm/config_check.c b/tools/testing/nvdimm/config_check.c
index 7dc5a0af9b544c..cac891028cd1bf 100644
--- a/tools/testing/nvdimm/config_check.c
+++ b/tools/testing/nvdimm/config_check.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/bug.h>
void check(void)
diff --git a/tools/testing/nvdimm/test/Kbuild b/tools/testing/nvdimm/test/Kbuild
index d32f25bba42a35..fb3c3d7cdb9bd1 100644
--- a/tools/testing/nvdimm/test/Kbuild
+++ b/tools/testing/nvdimm/test/Kbuild
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ccflags-y := -I$(src)/../../../../drivers/nvdimm/
ccflags-y += -I$(src)/../../../../drivers/acpi/nfit/
diff --git a/tools/testing/radix-tree/Makefile b/tools/testing/radix-tree/Makefile
index 6a9480c03cbdfc..fa7ee369b3c919 100644
--- a/tools/testing/radix-tree/Makefile
+++ b/tools/testing/radix-tree/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -I. -I../../include -g -O2 -Wall -D_LGPL_SOURCE -fsanitize=address
LDFLAGS += -fsanitize=address
diff --git a/tools/testing/radix-tree/linux.c b/tools/testing/radix-tree/linux.c
index cf48c8473f4869..6903ccf35595f5 100644
--- a/tools/testing/radix-tree/linux.c
+++ b/tools/testing/radix-tree/linux.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
diff --git a/tools/testing/radix-tree/linux/gfp.h b/tools/testing/radix-tree/linux/gfp.h
index 39a0dcb9475a3c..e9fff59dfd8a86 100644
--- a/tools/testing/radix-tree/linux/gfp.h
+++ b/tools/testing/radix-tree/linux/gfp.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _GFP_H
#define _GFP_H
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
index b21a77fddcf735..c3bc3f364f6827 100644
--- a/tools/testing/radix-tree/linux/kernel.h
+++ b/tools/testing/radix-tree/linux/kernel.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _KERNEL_H
#define _KERNEL_H
diff --git a/tools/testing/radix-tree/linux/percpu.h b/tools/testing/radix-tree/linux/percpu.h
index 3ea01a1a88c2b2..b2403aa743b21c 100644
--- a/tools/testing/radix-tree/linux/percpu.h
+++ b/tools/testing/radix-tree/linux/percpu.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#define DECLARE_PER_CPU(type, val) extern type val
#define DEFINE_PER_CPU(type, val) type val
diff --git a/tools/testing/radix-tree/linux/preempt.h b/tools/testing/radix-tree/linux/preempt.h
index 35c5ac81529fa9..edb10302b903e8 100644
--- a/tools/testing/radix-tree/linux/preempt.h
+++ b/tools/testing/radix-tree/linux/preempt.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __LINUX_PREEMPT_H
#define __LINUX_PREEMPT_H
diff --git a/tools/testing/radix-tree/linux/radix-tree.h b/tools/testing/radix-tree/linux/radix-tree.h
index bf1bb231f9b5cd..24f13d27a8da9c 100644
--- a/tools/testing/radix-tree/linux/radix-tree.h
+++ b/tools/testing/radix-tree/linux/radix-tree.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _TEST_RADIX_TREE_H
#define _TEST_RADIX_TREE_H
diff --git a/tools/testing/radix-tree/linux/rcupdate.h b/tools/testing/radix-tree/linux/rcupdate.h
index f7129ea2a89913..73ed3365820377 100644
--- a/tools/testing/radix-tree/linux/rcupdate.h
+++ b/tools/testing/radix-tree/linux/rcupdate.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _RCUPDATE_H
#define _RCUPDATE_H
diff --git a/tools/testing/radix-tree/linux/slab.h b/tools/testing/radix-tree/linux/slab.h
index e40337f41a387a..979baeec7e706a 100644
--- a/tools/testing/radix-tree/linux/slab.h
+++ b/tools/testing/radix-tree/linux/slab.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef SLAB_H
#define SLAB_H
diff --git a/tools/testing/radix-tree/main.c b/tools/testing/radix-tree/main.c
index bc9a78449572f1..257f3f8aacaa52 100644
--- a/tools/testing/radix-tree/main.c
+++ b/tools/testing/radix-tree/main.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/tools/testing/radix-tree/regression.h b/tools/testing/radix-tree/regression.h
index e018c481668853..3c8a1584e9ee4c 100644
--- a/tools/testing/radix-tree/regression.h
+++ b/tools/testing/radix-tree/regression.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __REGRESSION_H__
#define __REGRESSION_H__
diff --git a/tools/testing/radix-tree/regression1.c b/tools/testing/radix-tree/regression1.c
index bf97742fc18c1c..0aece092f40ebb 100644
--- a/tools/testing/radix-tree/regression1.c
+++ b/tools/testing/radix-tree/regression1.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Regression1
* Description:
diff --git a/tools/testing/radix-tree/regression2.c b/tools/testing/radix-tree/regression2.c
index 42dd2a33ed2490..424b91c77831d6 100644
--- a/tools/testing/radix-tree/regression2.c
+++ b/tools/testing/radix-tree/regression2.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Regression2
* Description:
diff --git a/tools/testing/radix-tree/regression3.c b/tools/testing/radix-tree/regression3.c
index 670c3d2ae7b189..ace2543c3edab3 100644
--- a/tools/testing/radix-tree/regression3.c
+++ b/tools/testing/radix-tree/regression3.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Regression3
* Description:
diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c
index 36dcf7d6945dc6..543181e4847b9b 100644
--- a/tools/testing/radix-tree/tag_check.c
+++ b/tools/testing/radix-tree/tag_check.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
diff --git a/tools/testing/radix-tree/test.c b/tools/testing/radix-tree/test.c
index 1a257d738a1e4e..5978ab1f403d97 100644
--- a/tools/testing/radix-tree/test.c
+++ b/tools/testing/radix-tree/test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
diff --git a/tools/testing/radix-tree/test.h b/tools/testing/radix-tree/test.h
index 0f8220cc61663f..d9c031dbeb1a96 100644
--- a/tools/testing/radix-tree/test.h
+++ b/tools/testing/radix-tree/test.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/gfp.h>
#include <linux/types.h>
#include <linux/radix-tree.h>
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index ff805643b5f723..3c9c0bbe7dbb66 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TARGETS = bpf
TARGETS += breakpoints
TARGETS += capabilities
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index f4b23d6974486a..eab7644a07b4e7 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
LIBDIR := ../../../lib
BPFDIR := $(LIBDIR)/bpf
APIDIR := ../../../include/uapi
diff --git a/tools/testing/selftests/bpf/bpf_endian.h b/tools/testing/selftests/bpf/bpf_endian.h
index 74af266aa512ba..b25595ea4a7898 100644
--- a/tools/testing/selftests/bpf/bpf_endian.h
+++ b/tools/testing/selftests/bpf/bpf_endian.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __BPF_ENDIAN__
#define __BPF_ENDIAN__
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index b2e02bdcd098f6..50353c10573c23 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __BPF_HELPERS_H
#define __BPF_HELPERS_H
diff --git a/tools/testing/selftests/bpf/bpf_util.h b/tools/testing/selftests/bpf/bpf_util.h
index 6c53a8906eff4c..d0811b3d6a6f16 100644
--- a/tools/testing/selftests/bpf/bpf_util.h
+++ b/tools/testing/selftests/bpf/bpf_util.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __BPF_UTIL__
#define __BPF_UTIL__
diff --git a/tools/testing/selftests/bpf/include/uapi/linux/types.h b/tools/testing/selftests/bpf/include/uapi/linux/types.h
index 51841848fbfe35..91fa51a9c31de1 100644
--- a/tools/testing/selftests/bpf/include/uapi/linux/types.h
+++ b/tools/testing/selftests/bpf/include/uapi/linux/types.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _UAPI_LINUX_TYPES_H
#define _UAPI_LINUX_TYPES_H
diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh
index 6d58cca8e23574..ed4774d8d6ed1c 100755
--- a/tools/testing/selftests/bpf/test_kmod.sh
+++ b/tools/testing/selftests/bpf/test_kmod.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
SRC_TREE=../../../../
diff --git a/tools/testing/selftests/bpf/test_lpm_map.c b/tools/testing/selftests/bpf/test_lpm_map.c
index e97565243d59c0..f93a333cbf2c96 100644
--- a/tools/testing/selftests/bpf/test_lpm_map.c
+++ b/tools/testing/selftests/bpf/test_lpm_map.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Randomized tests for eBPF longest-prefix-match maps
*
diff --git a/tools/testing/selftests/bpf/test_tag.c b/tools/testing/selftests/bpf/test_tag.c
index de409fc50c35b3..8b201895c569f9 100644
--- a/tools/testing/selftests/bpf/test_tag.c
+++ b/tools/testing/selftests/bpf/test_tag.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/tools/testing/selftests/breakpoints/Makefile b/tools/testing/selftests/breakpoints/Makefile
index 247b0a1899d70f..9ec2c78de8caab 100644
--- a/tools/testing/selftests/breakpoints/Makefile
+++ b/tools/testing/selftests/breakpoints/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Taken from perf makefile
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
diff --git a/tools/testing/selftests/capabilities/Makefile b/tools/testing/selftests/capabilities/Makefile
index 29b8adfdac717d..6e9d98d457d5b6 100644
--- a/tools/testing/selftests/capabilities/Makefile
+++ b/tools/testing/selftests/capabilities/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_FILES := validate_cap
TEST_GEN_PROGS := test_execve
diff --git a/tools/testing/selftests/capabilities/test_execve.c b/tools/testing/selftests/capabilities/test_execve.c
index cf67784413812f..3ab39a61b95bdc 100644
--- a/tools/testing/selftests/capabilities/test_execve.c
+++ b/tools/testing/selftests/capabilities/test_execve.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <cap-ng.h>
diff --git a/tools/testing/selftests/capabilities/validate_cap.c b/tools/testing/selftests/capabilities/validate_cap.c
index 694cd73d449382..cdfc94268fe6e6 100644
--- a/tools/testing/selftests/capabilities/validate_cap.c
+++ b/tools/testing/selftests/capabilities/validate_cap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <cap-ng.h>
#include <linux/capability.h>
#include <stdbool.h>
diff --git a/tools/testing/selftests/cpu-hotplug/Makefile b/tools/testing/selftests/cpu-hotplug/Makefile
index fe1f99101c5d50..d8be047ee5b6aa 100644
--- a/tools/testing/selftests/cpu-hotplug/Makefile
+++ b/tools/testing/selftests/cpu-hotplug/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
TEST_PROGS := cpu-on-off-test.sh
diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
index b18b253d7bfbca..f3a8933c12755f 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
SYSFS=
diff --git a/tools/testing/selftests/cpufreq/Makefile b/tools/testing/selftests/cpufreq/Makefile
index 3955cd96f3a25c..c86ca8342222b8 100644
--- a/tools/testing/selftests/cpufreq/Makefile
+++ b/tools/testing/selftests/cpufreq/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
TEST_PROGS := main.sh
diff --git a/tools/testing/selftests/cpufreq/cpu.sh b/tools/testing/selftests/cpufreq/cpu.sh
index 8e08a83d65f2d5..39fdcdfb8e97f4 100755
--- a/tools/testing/selftests/cpufreq/cpu.sh
+++ b/tools/testing/selftests/cpufreq/cpu.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# CPU helpers
diff --git a/tools/testing/selftests/cpufreq/cpufreq.sh b/tools/testing/selftests/cpufreq/cpufreq.sh
index 1ed3832030b4fc..b583a2fb450425 100755
--- a/tools/testing/selftests/cpufreq/cpufreq.sh
+++ b/tools/testing/selftests/cpufreq/cpufreq.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
# protect against multiple inclusion
if [ $FILE_CPUFREQ ]; then
diff --git a/tools/testing/selftests/cpufreq/governor.sh b/tools/testing/selftests/cpufreq/governor.sh
index def645103555f6..fe37df79c0871b 100755
--- a/tools/testing/selftests/cpufreq/governor.sh
+++ b/tools/testing/selftests/cpufreq/governor.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# Test governors
diff --git a/tools/testing/selftests/cpufreq/main.sh b/tools/testing/selftests/cpufreq/main.sh
index 01bac76ac0ec71..d83922de9d8997 100755
--- a/tools/testing/selftests/cpufreq/main.sh
+++ b/tools/testing/selftests/cpufreq/main.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
source cpu.sh
source cpufreq.sh
diff --git a/tools/testing/selftests/cpufreq/module.sh b/tools/testing/selftests/cpufreq/module.sh
index 8ff2244a33a156..22563cd122e7dd 100755
--- a/tools/testing/selftests/cpufreq/module.sh
+++ b/tools/testing/selftests/cpufreq/module.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# Modules specific tests cases
diff --git a/tools/testing/selftests/cpufreq/special-tests.sh b/tools/testing/selftests/cpufreq/special-tests.sh
index 58b730f23ef726..8d40505dc4682c 100755
--- a/tools/testing/selftests/cpufreq/special-tests.sh
+++ b/tools/testing/selftests/cpufreq/special-tests.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# Special test cases reported by people
diff --git a/tools/testing/selftests/drivers/gpu/drm_mm.sh b/tools/testing/selftests/drivers/gpu/drm_mm.sh
index 96dd55c927994b..b789dc8257e628 100755
--- a/tools/testing/selftests/drivers/gpu/drm_mm.sh
+++ b/tools/testing/selftests/drivers/gpu/drm_mm.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs API tests for struct drm_mm (DRM range manager)
if ! /sbin/modprobe -n -q test-drm_mm; then
diff --git a/tools/testing/selftests/drivers/gpu/i915.sh b/tools/testing/selftests/drivers/gpu/i915.sh
index c06d6e8a8dcc91..d3895bc714b73d 100755
--- a/tools/testing/selftests/drivers/gpu/i915.sh
+++ b/tools/testing/selftests/drivers/gpu/i915.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs hardware independent tests for i915 (drivers/gpu/drm/i915)
if ! /sbin/modprobe -q -r i915; then
diff --git a/tools/testing/selftests/efivarfs/create-read.c b/tools/testing/selftests/efivarfs/create-read.c
index 7feef1880968e5..9674a19396a325 100644
--- a/tools/testing/selftests/efivarfs/create-read.c
+++ b/tools/testing/selftests/efivarfs/create-read.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh
index 057278448515a4..c6d5790575ae34 100755
--- a/tools/testing/selftests/efivarfs/efivarfs.sh
+++ b/tools/testing/selftests/efivarfs/efivarfs.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
efivarfs_mount=/sys/firmware/efi/efivars
test_guid=210be57c-9849-4fc7-a635-e6382d1aec27
diff --git a/tools/testing/selftests/efivarfs/open-unlink.c b/tools/testing/selftests/efivarfs/open-unlink.c
index 4af74f7330365e..562742d44ac969 100644
--- a/tools/testing/selftests/efivarfs/open-unlink.c
+++ b/tools/testing/selftests/efivarfs/open-unlink.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <errno.h>
#include <stdio.h>
#include <stdint.h>
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 2e13035dff7f6f..427c41ba515136 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS = -Wall
TEST_GEN_PROGS := execveat
diff --git a/tools/testing/selftests/filesystems/Makefile b/tools/testing/selftests/filesystems/Makefile
index 0ab11307b41422..13a73bf725b555 100644
--- a/tools/testing/selftests/filesystems/Makefile
+++ b/tools/testing/selftests/filesystems/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := dnotify_test
all: $(TEST_PROGS)
diff --git a/tools/testing/selftests/filesystems/dnotify_test.c b/tools/testing/selftests/filesystems/dnotify_test.c
index 8b37b4a1e18da3..c0a9b2d3302dcb 100644
--- a/tools/testing/selftests/filesystems/dnotify_test.c
+++ b/tools/testing/selftests/filesystems/dnotify_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE /* needed to get the defines */
#include <fcntl.h> /* in glibc 2.2 this has the needed
values defined */
diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh
index 8f511035f78331..a52a3bab532b95 100755
--- a/tools/testing/selftests/firmware/fw_fallback.sh
+++ b/tools/testing/selftests/firmware/fw_fallback.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# This validates that the kernel will fall back to using the fallback mechanism
# to load firmware it can't find on disk itself. We must request a firmware
# that the kernel won't find, and any installed helper (e.g. udev) also
diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh
index 7d8fd2e3695a8d..62f2d6f54929a4 100755
--- a/tools/testing/selftests/firmware/fw_filesystem.sh
+++ b/tools/testing/selftests/firmware/fw_filesystem.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# This validates that the kernel will load firmware out of its list of
# firmware locations on disk. Since the user helper does similar work,
# we reset the custom load directory to a location the user helper doesn't
diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
index a8a5e21850e740..cd1f5b3a777461 100644
--- a/tools/testing/selftests/ftrace/Makefile
+++ b/tools/testing/selftests/ftrace/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
TEST_PROGS := ftracetest
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc
index ebfce83f35b44b..531e472362dfb1 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/basic2.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Basic test for tracers
# flags: instance
test -f available_tracers
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc b/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc
index 9e33f841812f30..58a2506f788e8c 100644
--- a/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc
+++ b/tools/testing/selftests/ftrace/test.d/00basic/basic3.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Basic trace clock test
# flags: instance
test -f trace_clock
diff --git a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
index 283b45ecb199d5..6ff851a7588461 100644
--- a/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/event-enable.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event tracing - enable/disable with event level files
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/event/event-pid.tc b/tools/testing/selftests/ftrace/test.d/event/event-pid.tc
index 96c1a95be4f798..cc14feec6e1f2d 100644
--- a/tools/testing/selftests/ftrace/test.d/event/event-pid.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/event-pid.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event tracing - restricts events based on pid
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
index b8fe2e5b9e674f..85094904aa79b3 100644
--- a/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event tracing - enable/disable with subsystem level files
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
index 15e2d3fe173178..cc1cf4d30ef5d3 100644
--- a/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
+++ b/tools/testing/selftests/ftrace/test.d/event/toplevel-enable.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event tracing - enable/disable with top level files
do_reset() {
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
index 15c2dba06ea288..45df747887e072 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter-stack.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function graph filters with stack tracer
# Make sure that function graph filtering works, and is not
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
index 0ab2189613efe5..0387e22e757757 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/fgraph-filter.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function graph filters
# Make sure that function graph filtering works
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
index 8095e122daa976..589d52b211b7c0 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-glob.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function glob filters
# Make sure that function glob matching filter works.
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
index bab5ff7c607edb..78524fcc25aee9 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function pid filters
# Make sure that function pid matching filter works.
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
index 77dfb6b481861c..9d4afcca1e36aa 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - test for function event triggers
# flags: instance
#
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
index 7808336d6f5083..fe0dc5a7ea2685 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profiler.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - function profiler with function tracing
# There was a bug after a rewrite of the ftrace infrastructure that
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
index 113b4d9bc7336f..5ad723724adb9c 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - test reading of set_ftrace_filter
#
# The set_ftrace_filter file of ftrace is used to list functions as well as
diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
index 7a9ab4ff83b6fc..cdc92a371cd73f 100644
--- a/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
+++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_traceonoff_triggers.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: ftrace - test for function traceon/off triggers
# flags: instance
#
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
index 8a353314dc9b2a..d7f48b55df51cb 100644
--- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
+++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Test creation and deletion of trace instances while setting an event
if [ ! -d instances ] ; then
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance.tc b/tools/testing/selftests/ftrace/test.d/instances/instance.tc
index 1e1abe0ad35426..ddda622033664a 100644
--- a/tools/testing/selftests/ftrace/test.d/instances/instance.tc
+++ b/tools/testing/selftests/ftrace/test.d/instances/instance.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Test creation and deletion of trace instances
if [ ! -d instances ] ; then
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc b/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
index c3843ed49bf6df..4604d2103c8938 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/add_and_remove.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event - adding and removing
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
index 74507db8bbc89e..0e6f415c6152af 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/busy_check.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event - busy event check
[ -f kprobe_events ] || exit_unsupported
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
index 64949d4eda699a..679bbd23bcc3fe 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event with arguments
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
index c75faefb4fffcb..17d33ba192f64a 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobes event arguments with types
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc
index b9302cc82c1223..2724a1068cb1da 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe event auto/manual naming
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
index d6f2f4965697a8..cc4cac0e60f278 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_ftrace.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event with function tracer
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
index 6d634e4b768056..1e9f75f7a30fce 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_module.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event - probing module
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
index 0d09546258fde3..f1825bdbe3f307 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_args.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kretprobe dynamic event with arguments
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc
index 7ec6f2639ad6e6..7c0290684c4387 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_maxactive.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Kretprobe dynamic event with maxactive
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
index a4fd4c851a5b7f..bb16cf91f1b53e 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: Register/unregister many kprobe events
[ -f kprobe_events ] || exit_unsupported # this is configurable
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc
index c5435adfdd932b..839ac4320b24e7 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-eventonoff.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test event enable/disable trigger
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc
index 48849a8d577f7f..66873c4b12c952 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-filter.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test trigger filter
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
index b7f86d10b549ab..4237b32769f145 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist-mod.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test histogram modifiers
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
index fb66f7d9339da5..d24e2b8bd8633b 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-hist.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test histogram trigger
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
index f9153087dd7cdc..4c0774fff37815 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-multihist.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test multiple histogram triggers
# flags: instance
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
index ed94f0c4e0e461..3fc6321e081f32 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-snapshot.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test snapshot-trigger
do_reset() {
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc
index 9fa23b085def46..3652824f81ed6a 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-stacktrace.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test stacktrace-trigger
do_reset() {
diff --git a/tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc b/tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc
index 87648e5f987c0b..6d9051cdf408f3 100644
--- a/tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc
+++ b/tools/testing/selftests/ftrace/test.d/trigger/trigger-traceonoff.tc
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test traceon/off trigger
do_reset() {
diff --git a/tools/testing/selftests/futex/Makefile b/tools/testing/selftests/futex/Makefile
index f0c0369ccb7972..cea4adcd42b887 100644
--- a/tools/testing/selftests/futex/Makefile
+++ b/tools/testing/selftests/futex/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
SUBDIRS := functional
TEST_PROGS := run.sh
diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile
index a648e7a6cbc3d3..ff8feca4974607 100644
--- a/tools/testing/selftests/futex/functional/Makefile
+++ b/tools/testing/selftests/futex/functional/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
INCLUDES := -I../include -I../../
CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES)
LDFLAGS := $(LDFLAGS) -pthread -lrt
diff --git a/tools/testing/selftests/gpio/Makefile b/tools/testing/selftests/gpio/Makefile
index 298929df97e695..1bbb47565c554c 100644
--- a/tools/testing/selftests/gpio/Makefile
+++ b/tools/testing/selftests/gpio/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := gpio-mockup.sh
TEST_FILES := gpio-mockup-sysfs.sh $(BINARIES)
diff --git a/tools/testing/selftests/gpio/gpio-mockup-sysfs.sh b/tools/testing/selftests/gpio/gpio-mockup-sysfs.sh
index 085d7a39899c76..dd269d87756240 100755
--- a/tools/testing/selftests/gpio/gpio-mockup-sysfs.sh
+++ b/tools/testing/selftests/gpio/gpio-mockup-sysfs.sh
@@ -1,4 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0
is_consistent()
{
val=
diff --git a/tools/testing/selftests/gpio/gpio-mockup.sh b/tools/testing/selftests/gpio/gpio-mockup.sh
index b183439e058ec2..183fb932edbdb8 100755
--- a/tools/testing/selftests/gpio/gpio-mockup.sh
+++ b/tools/testing/selftests/gpio/gpio-mockup.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#exit status
#1: run as non-root user
diff --git a/tools/testing/selftests/ia64/Makefile b/tools/testing/selftests/ia64/Makefile
index 2b3de2d3e94592..4bce1a84b3a142 100644
--- a/tools/testing/selftests/ia64/Makefile
+++ b/tools/testing/selftests/ia64/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := aliasing-test
all: $(TEST_PROGS)
diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile
index a97e24edde39ed..5a3f7d37e91214 100644
--- a/tools/testing/selftests/intel_pstate/Makefile
+++ b/tools/testing/selftests/intel_pstate/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE
LDLIBS := $(LDLIBS) -lm
diff --git a/tools/testing/selftests/intel_pstate/aperf.c b/tools/testing/selftests/intel_pstate/aperf.c
index cd72f3dc83e9de..d21edea9c5601f 100644
--- a/tools/testing/selftests/intel_pstate/aperf.c
+++ b/tools/testing/selftests/intel_pstate/aperf.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <math.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/testing/selftests/intel_pstate/msr.c b/tools/testing/selftests/intel_pstate/msr.c
index abbbfc84d3595a..88fdd2a4b0a072 100644
--- a/tools/testing/selftests/intel_pstate/msr.c
+++ b/tools/testing/selftests/intel_pstate/msr.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <math.h>
#include <unistd.h>
#include <stdio.h>
diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index d3ab48f91cd6a6..c670359becc6c2 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#
# This test runs on Intel x86 based hardware which support the intel_pstate
# driver. The test checks the frequency settings from the maximum turbo
diff --git a/tools/testing/selftests/ipc/Makefile b/tools/testing/selftests/ipc/Makefile
index 30ef4c7f53eaa3..1c4448a843a41e 100644
--- a/tools/testing/selftests/ipc/Makefile
+++ b/tools/testing/selftests/ipc/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/)
ifeq ($(ARCH),i386)
diff --git a/tools/testing/selftests/ipc/msgque.c b/tools/testing/selftests/ipc/msgque.c
index 1b2ce334bb3f02..ee9382bdfadc87 100644
--- a/tools/testing/selftests/ipc/msgque.c
+++ b/tools/testing/selftests/ipc/msgque.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/tools/testing/selftests/kcmp/kcmp_test.c b/tools/testing/selftests/kcmp/kcmp_test.c
index 73684c4a1ed692..6ea7b9f37a411e 100644
--- a/tools/testing/selftests/kcmp/kcmp_test.c
+++ b/tools/testing/selftests/kcmp/kcmp_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <stdio.h>
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index f65886af7c0cac..5bef05d6ba3935 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -31,7 +31,11 @@ define RUN_TESTS
echo "selftests: Warning: file $$BASENAME_TEST is not executable, correct this.";\
echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; \
else \
- cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\
+ if [ "X$(summary)" != "X" ]; then \
+ cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST > /tmp/$$BASENAME_TEST 2>&1 && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\
+ else \
+ cd `dirname $$TEST` > /dev/null; (./$$BASENAME_TEST && echo "ok 1..$$test_num selftests: $$BASENAME_TEST [PASS]") || echo "not ok 1..$$test_num selftests: $$BASENAME_TEST [FAIL]"; cd - > /dev/null;\
+ fi; \
fi; \
done;
endef
diff --git a/tools/testing/selftests/lib/bitmap.sh b/tools/testing/selftests/lib/bitmap.sh
index b073c22a3435a2..4dee4d2a8bbed8 100755
--- a/tools/testing/selftests/lib/bitmap.sh
+++ b/tools/testing/selftests/lib/bitmap.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs bitmap infrastructure tests using test_bitmap kernel module
if ! /sbin/modprobe -q -n test_bitmap; then
echo "bitmap: [SKIP]"
diff --git a/tools/testing/selftests/lib/prime_numbers.sh b/tools/testing/selftests/lib/prime_numbers.sh
index da4cbcd766f5bc..b363994e5e11aa 100755
--- a/tools/testing/selftests/lib/prime_numbers.sh
+++ b/tools/testing/selftests/lib/prime_numbers.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Checks fast/slow prime_number generation for inconsistencies
if ! /sbin/modprobe -q -r prime_numbers; then
diff --git a/tools/testing/selftests/lib/printf.sh b/tools/testing/selftests/lib/printf.sh
index cbf3b124bd94a2..0c37377fd7d492 100755
--- a/tools/testing/selftests/lib/printf.sh
+++ b/tools/testing/selftests/lib/printf.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs printf infrastructure using test_printf kernel module
if ! /sbin/modprobe -q -n test_printf; then
echo "printf: [SKIP]"
diff --git a/tools/testing/selftests/locking/ww_mutex.sh b/tools/testing/selftests/locking/ww_mutex.sh
index 6905da965f3bdc..2c3d6b1878c214 100644
--- a/tools/testing/selftests/locking/ww_mutex.sh
+++ b/tools/testing/selftests/locking/ww_mutex.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs API tests for struct ww_mutex (Wait/Wound mutexes)
if /sbin/modprobe -q test-ww_mutex; then
diff --git a/tools/testing/selftests/media_tests/Makefile b/tools/testing/selftests/media_tests/Makefile
index 6b34a019946801..be5bd4ffb89505 100644
--- a/tools/testing/selftests/media_tests/Makefile
+++ b/tools/testing/selftests/media_tests/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := media_device_test media_device_open video_device_test
all: $(TEST_PROGS)
diff --git a/tools/testing/selftests/media_tests/bind_unbind_sample.sh b/tools/testing/selftests/media_tests/bind_unbind_sample.sh
index 9f362f10631ad2..0101c1ec4ff738 100755
--- a/tools/testing/selftests/media_tests/bind_unbind_sample.sh
+++ b/tools/testing/selftests/media_tests/bind_unbind_sample.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
# Find device number in /sys/bus/usb/drivers/drivername
# Edit this file to update the driver numer and name
# Example test for uvcvideo driver
diff --git a/tools/testing/selftests/media_tests/open_loop_test.sh b/tools/testing/selftests/media_tests/open_loop_test.sh
index dcd3c17efc1771..d4c0179bbe2c4d 100755
--- a/tools/testing/selftests/media_tests/open_loop_test.sh
+++ b/tools/testing/selftests/media_tests/open_loop_test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
i=0
file=/dev/media$1
while :; do
diff --git a/tools/testing/selftests/membarrier/membarrier_test.c b/tools/testing/selftests/membarrier/membarrier_test.c
index 21399fcf1a5912..9e674d9514d1d1 100644
--- a/tools/testing/selftests/membarrier/membarrier_test.c
+++ b/tools/testing/selftests/membarrier/membarrier_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <linux/membarrier.h>
#include <syscall.h>
diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests/memfd/Makefile
index bc9d02d615dabf..3926a0409dda3e 100644
--- a/tools/testing/selftests/memfd/Makefile
+++ b/tools/testing/selftests/memfd/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I../../../../include/uapi/
CFLAGS += -I../../../../include/
diff --git a/tools/testing/selftests/memfd/fuse_mnt.c b/tools/testing/selftests/memfd/fuse_mnt.c
index feacf1280fcd0f..6936f2a001f303 100644
--- a/tools/testing/selftests/memfd/fuse_mnt.c
+++ b/tools/testing/selftests/memfd/fuse_mnt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* memfd test file-system
* This file uses FUSE to create a dummy file-system with only one file /memfd.
diff --git a/tools/testing/selftests/memfd/fuse_test.c b/tools/testing/selftests/memfd/fuse_test.c
index 7f3617274bf53d..1ccb7a3eb14bfd 100644
--- a/tools/testing/selftests/memfd/fuse_test.c
+++ b/tools/testing/selftests/memfd/fuse_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* memfd GUP test-case
* This tests memfd interactions with get_user_pages(). We require the
diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c
index f94c6d1fb46f85..845e5f67b6f024 100644
--- a/tools/testing/selftests/memfd/memfd_test.c
+++ b/tools/testing/selftests/memfd/memfd_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#define __EXPORTED_HEADERS__
diff --git a/tools/testing/selftests/memfd/run_fuse_test.sh b/tools/testing/selftests/memfd/run_fuse_test.sh
index 69b930e1e04156..407df68dfe27b4 100755
--- a/tools/testing/selftests/memfd/run_fuse_test.sh
+++ b/tools/testing/selftests/memfd/run_fuse_test.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
if test -d "./mnt" ; then
fusermount -u ./mnt
diff --git a/tools/testing/selftests/memory-hotplug/Makefile b/tools/testing/selftests/memory-hotplug/Makefile
index afb2624c704894..23db11c94b59ab 100644
--- a/tools/testing/selftests/memory-hotplug/Makefile
+++ b/tools/testing/selftests/memory-hotplug/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
include ../lib.mk
diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
index 35025ce9ca665d..ae2c790d08806e 100755
--- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
+++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
SYSFS=
diff --git a/tools/testing/selftests/mount/Makefile b/tools/testing/selftests/mount/Makefile
index 9093d7ffe87f15..e094f71c6dbc4a 100644
--- a/tools/testing/selftests/mount/Makefile
+++ b/tools/testing/selftests/mount/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for mount selftests.
CFLAGS = -Wall \
-O2
diff --git a/tools/testing/selftests/mount/unprivileged-remount-test.c b/tools/testing/selftests/mount/unprivileged-remount-test.c
index 517785052f1c37..584dc6bc3b0667 100644
--- a/tools/testing/selftests/mount/unprivileged-remount-test.c
+++ b/tools/testing/selftests/mount/unprivileged-remount-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sched.h>
#include <stdio.h>
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 152823b6cb2152..743d3f9e59181c 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -O2
LDLIBS = -lrt -lpthread -lpopt
TEST_GEN_PROGS := mq_open_tests mq_perf_tests
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index d86bca991f456a..500c74db746c81 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for net selftests
CFLAGS = -Wall -Wl,--no-as-needed -O2 -g
diff --git a/tools/testing/selftests/net/netdevice.sh b/tools/testing/selftests/net/netdevice.sh
index 90cb903c33815b..903679e0ff318b 100755
--- a/tools/testing/selftests/net/netdevice.sh
+++ b/tools/testing/selftests/net/netdevice.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
#
# This test is for checking network interface
# For the moment it tests only ethernet interface (but wifi could be easily added)
diff --git a/tools/testing/selftests/net/reuseport_bpf_cpu.c b/tools/testing/selftests/net/reuseport_bpf_cpu.c
index b23d6f54de7bd1..2d646174729f92 100644
--- a/tools/testing/selftests/net/reuseport_bpf_cpu.c
+++ b/tools/testing/selftests/net/reuseport_bpf_cpu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Test functionality of BPF filters with SO_REUSEPORT. This program creates
* an SO_REUSEPORT receiver group containing one socket per CPU core. It then
diff --git a/tools/testing/selftests/net/reuseport_bpf_numa.c b/tools/testing/selftests/net/reuseport_bpf_numa.c
index 6f20bc9ff62779..365c32e841897e 100644
--- a/tools/testing/selftests/net/reuseport_bpf_numa.c
+++ b/tools/testing/selftests/net/reuseport_bpf_numa.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Test functionality of BPF filters with SO_REUSEPORT. Same test as
* in reuseport_bpf_cpu, only as one socket per NUMA node.
diff --git a/tools/testing/selftests/net/reuseport_dualstack.c b/tools/testing/selftests/net/reuseport_dualstack.c
index 90958aaaafb93d..fe3230c5598639 100644
--- a/tools/testing/selftests/net/reuseport_dualstack.c
+++ b/tools/testing/selftests/net/reuseport_dualstack.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* It is possible to use SO_REUSEPORT to open multiple sockets bound to
* equivalent local addresses using AF_INET and AF_INET6 at the same time. If
diff --git a/tools/testing/selftests/net/run_afpackettests b/tools/testing/selftests/net/run_afpackettests
index 5246e782d6e806..21fe149e3de1ea 100755
--- a/tools/testing/selftests/net/run_afpackettests
+++ b/tools/testing/selftests/net/run_afpackettests
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
if [ $(id -u) != 0 ]; then
echo $msg must be run as root >&2
diff --git a/tools/testing/selftests/net/run_netsocktests b/tools/testing/selftests/net/run_netsocktests
index 16058bbea7a850..b093f39c298c3f 100755
--- a/tools/testing/selftests/net/run_netsocktests
+++ b/tools/testing/selftests/net/run_netsocktests
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
echo "--------------------"
echo "running socket test"
diff --git a/tools/testing/selftests/net/socket.c b/tools/testing/selftests/net/socket.c
index 0f227f2f9be918..afca1ead677f4a 100644
--- a/tools/testing/selftests/net/socket.c
+++ b/tools/testing/selftests/net/socket.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
diff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh
index 8b29796d46aa54..65677909c574df 100755
--- a/tools/testing/selftests/net/test_bpf.sh
+++ b/tools/testing/selftests/net/test_bpf.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs bpf test using test_bpf kernel module
if /sbin/modprobe -q test_bpf ; then
diff --git a/tools/testing/selftests/networking/timestamping/Makefile b/tools/testing/selftests/networking/timestamping/Makefile
index 92fb8ee917c563..a728040edbe18e 100644
--- a/tools/testing/selftests/networking/timestamping/Makefile
+++ b/tools/testing/selftests/networking/timestamping/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -I../../../../../usr/include
TEST_PROGS := hwtstamp_config rxtimestamp timestamping txtimestamp
diff --git a/tools/testing/selftests/networking/timestamping/hwtstamp_config.c b/tools/testing/selftests/networking/timestamping/hwtstamp_config.c
index e8b685a7f15fc3..e1fdee84102119 100644
--- a/tools/testing/selftests/networking/timestamping/hwtstamp_config.c
+++ b/tools/testing/selftests/networking/timestamping/hwtstamp_config.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* Test program for SIOC{G,S}HWTSTAMP
* Copyright 2013 Solarflare Communications
* Author: Ben Hutchings
diff --git a/tools/testing/selftests/nsfs/owner.c b/tools/testing/selftests/nsfs/owner.c
index 437205f8b71435..96a976c745504f 100644
--- a/tools/testing/selftests/nsfs/owner.c
+++ b/tools/testing/selftests/nsfs/owner.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sched.h>
#include <unistd.h>
diff --git a/tools/testing/selftests/nsfs/pidns.c b/tools/testing/selftests/nsfs/pidns.c
index ae3a0d68e9664d..1182d4e437a2c1 100644
--- a/tools/testing/selftests/nsfs/pidns.c
+++ b/tools/testing/selftests/nsfs/pidns.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sched.h>
#include <unistd.h>
diff --git a/tools/testing/selftests/powerpc/Makefile b/tools/testing/selftests/powerpc/Makefile
index 72c3ac2323e15f..f6b1338730db5c 100644
--- a/tools/testing/selftests/powerpc/Makefile
+++ b/tools/testing/selftests/powerpc/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for powerpc selftests
# ARCH can be overridden by the user for cross compiling
diff --git a/tools/testing/selftests/powerpc/benchmarks/Makefile b/tools/testing/selftests/powerpc/benchmarks/Makefile
index fb96a89bd953bf..a35058e3766c24 100644
--- a/tools/testing/selftests/powerpc/benchmarks/Makefile
+++ b/tools/testing/selftests/powerpc/benchmarks/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := gettimeofday context_switch mmap_bench futex_bench null_syscall
CFLAGS += -O2
diff --git a/tools/testing/selftests/powerpc/cache_shape/Makefile b/tools/testing/selftests/powerpc/cache_shape/Makefile
index b24485ab30e2e8..1be547434a49c3 100644
--- a/tools/testing/selftests/powerpc/cache_shape/Makefile
+++ b/tools/testing/selftests/powerpc/cache_shape/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := cache_shape
all: $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/copyloops/Makefile b/tools/testing/selftests/powerpc/copyloops/Makefile
index 681ab19d0a8486..ac4a52e19e590c 100644
--- a/tools/testing/selftests/powerpc/copyloops/Makefile
+++ b/tools/testing/selftests/powerpc/copyloops/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# The loops are all 64-bit code
CFLAGS += -m64
CFLAGS += -I$(CURDIR)
diff --git a/tools/testing/selftests/powerpc/copyloops/asm/export.h b/tools/testing/selftests/powerpc/copyloops/asm/export.h
index 2d14a9b4248c7e..0bab35f6777a20 100644
--- a/tools/testing/selftests/powerpc/copyloops/asm/export.h
+++ b/tools/testing/selftests/powerpc/copyloops/asm/export.h
@@ -1 +1,2 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#define EXPORT_SYMBOL(x)
diff --git a/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
index 80d34a9ffff425..5ffe04d802c907 100644
--- a/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
+++ b/tools/testing/selftests/powerpc/copyloops/asm/ppc_asm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <ppc-asm.h>
#define CONFIG_ALTIVEC
diff --git a/tools/testing/selftests/powerpc/copyloops/validate.c b/tools/testing/selftests/powerpc/copyloops/validate.c
index 7fb436f82d16e6..0f687361855233 100644
--- a/tools/testing/selftests/powerpc/copyloops/validate.c
+++ b/tools/testing/selftests/powerpc/copyloops/validate.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <malloc.h>
#include <string.h>
#include <stdlib.h>
diff --git a/tools/testing/selftests/powerpc/dscr/Makefile b/tools/testing/selftests/powerpc/dscr/Makefile
index c5639deb8887ed..55d7db7a616bcd 100644
--- a/tools/testing/selftests/powerpc/dscr/Makefile
+++ b/tools/testing/selftests/powerpc/dscr/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := dscr_default_test dscr_explicit_test dscr_user_test \
dscr_inherit_test dscr_inherit_exec_test dscr_sysfs_test \
dscr_sysfs_thread_test
diff --git a/tools/testing/selftests/powerpc/include/basic_asm.h b/tools/testing/selftests/powerpc/include/basic_asm.h
index 12eaddf72e6630..886dc026fe7af1 100644
--- a/tools/testing/selftests/powerpc/include/basic_asm.h
+++ b/tools/testing/selftests/powerpc/include/basic_asm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _SELFTESTS_POWERPC_BASIC_ASM_H
#define _SELFTESTS_POWERPC_BASIC_ASM_H
diff --git a/tools/testing/selftests/powerpc/include/instructions.h b/tools/testing/selftests/powerpc/include/instructions.h
index 0fb0bd3b28c92e..f36061eb6f0f16 100644
--- a/tools/testing/selftests/powerpc/include/instructions.h
+++ b/tools/testing/selftests/powerpc/include/instructions.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _SELFTESTS_POWERPC_INSTRUCTIONS_H
#define _SELFTESTS_POWERPC_INSTRUCTIONS_H
diff --git a/tools/testing/selftests/powerpc/math/Makefile b/tools/testing/selftests/powerpc/math/Makefile
index fa8bae920c911f..0dd3a01fdab92b 100644
--- a/tools/testing/selftests/powerpc/math/Makefile
+++ b/tools/testing/selftests/powerpc/math/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := fpu_syscall fpu_preempt fpu_signal vmx_syscall vmx_preempt vmx_signal vsx_preempt
include ../../lib.mk
diff --git a/tools/testing/selftests/powerpc/mm/Makefile b/tools/testing/selftests/powerpc/mm/Makefile
index 1cffe54dccfb8a..bf315bcbe66393 100644
--- a/tools/testing/selftests/powerpc/mm/Makefile
+++ b/tools/testing/selftests/powerpc/mm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
noarg:
$(MAKE) -C ../
diff --git a/tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c b/tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c
index 49003674de4fa3..9932359ce38fcd 100644
--- a/tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c
+++ b/tools/testing/selftests/powerpc/mm/hugetlb_vs_thp_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
diff --git a/tools/testing/selftests/powerpc/pmu/Makefile b/tools/testing/selftests/powerpc/pmu/Makefile
index e4e55d1d3e0fae..6e1629bf5b09db 100644
--- a/tools/testing/selftests/powerpc/pmu/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
noarg:
$(MAKE) -C ../
diff --git a/tools/testing/selftests/powerpc/pmu/ebb/Makefile b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
index 6001fb0a377a70..c4e64bc2e2650a 100644
--- a/tools/testing/selftests/powerpc/pmu/ebb/Makefile
+++ b/tools/testing/selftests/powerpc/pmu/ebb/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
noarg:
$(MAKE) -C ../../
diff --git a/tools/testing/selftests/powerpc/ptrace/Makefile b/tools/testing/selftests/powerpc/ptrace/Makefile
index 8932263e5a749c..48030526650437 100644
--- a/tools/testing/selftests/powerpc/ptrace/Makefile
+++ b/tools/testing/selftests/powerpc/ptrace/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := ptrace-gpr ptrace-tm-gpr ptrace-tm-spd-gpr \
ptrace-tar ptrace-tm-tar ptrace-tm-spd-tar ptrace-vsx ptrace-tm-vsx \
ptrace-tm-spd-vsx ptrace-tm-spr
diff --git a/tools/testing/selftests/powerpc/signal/Makefile b/tools/testing/selftests/powerpc/signal/Makefile
index f0eef27458e2bd..a7cbd5082e2717 100644
--- a/tools/testing/selftests/powerpc/signal/Makefile
+++ b/tools/testing/selftests/powerpc/signal/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := signal signal_tm
all: $(TEST_PROGS)
diff --git a/tools/testing/selftests/powerpc/stringloops/Makefile b/tools/testing/selftests/powerpc/stringloops/Makefile
index 557b9379f3bb9c..1125e489055e15 100644
--- a/tools/testing/selftests/powerpc/stringloops/Makefile
+++ b/tools/testing/selftests/powerpc/stringloops/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# The loops are all 64-bit code
CFLAGS += -m64
CFLAGS += -I$(CURDIR)
diff --git a/tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h b/tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h
index 11bece87e88083..136242ec4b0e61 100644
--- a/tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h
+++ b/tools/testing/selftests/powerpc/stringloops/asm/ppc_asm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <ppc-asm.h>
#ifndef r1
diff --git a/tools/testing/selftests/powerpc/stringloops/memcmp.c b/tools/testing/selftests/powerpc/stringloops/memcmp.c
index 30b1222380cae8..8250db25b37981 100644
--- a/tools/testing/selftests/powerpc/stringloops/memcmp.c
+++ b/tools/testing/selftests/powerpc/stringloops/memcmp.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
diff --git a/tools/testing/selftests/powerpc/switch_endian/Makefile b/tools/testing/selftests/powerpc/switch_endian/Makefile
index b92c2a132c4f5d..30b8ff8fb82e7a 100644
--- a/tools/testing/selftests/powerpc/switch_endian/Makefile
+++ b/tools/testing/selftests/powerpc/switch_endian/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := switch_endian_test
ASFLAGS += -O2 -Wall -g -nostdlib -m64
diff --git a/tools/testing/selftests/powerpc/switch_endian/check.S b/tools/testing/selftests/powerpc/switch_endian/check.S
index e2484d2c24f48a..927a5c675e832e 100644
--- a/tools/testing/selftests/powerpc/switch_endian/check.S
+++ b/tools/testing/selftests/powerpc/switch_endian/check.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include "common.h"
/*
diff --git a/tools/testing/selftests/powerpc/switch_endian/common.h b/tools/testing/selftests/powerpc/switch_endian/common.h
index 69e399698c6483..1434cbc2a6ad0b 100644
--- a/tools/testing/selftests/powerpc/switch_endian/common.h
+++ b/tools/testing/selftests/powerpc/switch_endian/common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <ppc-asm.h>
#include <asm/unistd.h>
diff --git a/tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S b/tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S
index bceb53f57573b5..cc493046723511 100644
--- a/tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S
+++ b/tools/testing/selftests/powerpc/switch_endian/switch_endian_test.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include "common.h"
.data
diff --git a/tools/testing/selftests/powerpc/syscalls/ipc.h b/tools/testing/selftests/powerpc/syscalls/ipc.h
index fbebc022edf636..26a20682c9a48c 100644
--- a/tools/testing/selftests/powerpc/syscalls/ipc.h
+++ b/tools/testing/selftests/powerpc/syscalls/ipc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifdef __NR_semop
DO_TEST(semop, __NR_semop)
#endif
diff --git a/tools/testing/selftests/powerpc/tm/Makefile b/tools/testing/selftests/powerpc/tm/Makefile
index 7bfcd454fb2aa0..fca7c7f5e640d3 100644
--- a/tools/testing/selftests/powerpc/tm/Makefile
+++ b/tools/testing/selftests/powerpc/tm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
SIGNAL_CONTEXT_CHK_TESTS := tm-signal-context-chk-gpr tm-signal-context-chk-fpu \
tm-signal-context-chk-vmx tm-signal-context-chk-vsx
diff --git a/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c b/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
index a7ac2e4c60d913..4cdb83964bb329 100644
--- a/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
+++ b/tools/testing/selftests/powerpc/tm/tm-resched-dscr.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* Test context switching to see if the DSCR SPR is correctly preserved
* when within a transaction.
*
diff --git a/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S b/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
index 431f61ae236814..bd1ca25febe4c7 100644
--- a/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
+++ b/tools/testing/selftests/powerpc/tm/tm-syscall-asm.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <ppc-asm.h>
#include <asm/unistd.h>
diff --git a/tools/testing/selftests/powerpc/vphn/test-vphn.c b/tools/testing/selftests/powerpc/vphn/test-vphn.c
index 5742f6876b2513..81d3069ffb8461 100644
--- a/tools/testing/selftests/powerpc/vphn/test-vphn.c
+++ b/tools/testing/selftests/powerpc/vphn/test-vphn.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include <byteswap.h>
#include "utils.h"
diff --git a/tools/testing/selftests/prctl/Makefile b/tools/testing/selftests/prctl/Makefile
index 35aa1c8f2df21e..c7923b205222dd 100644
--- a/tools/testing/selftests/prctl/Makefile
+++ b/tools/testing/selftests/prctl/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifndef CROSS_COMPILE
uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/x86/ -e s/x86_64/x86/)
diff --git a/tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c b/tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c
index f7499d1c0415f3..62a93cc61b7cc3 100644
--- a/tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c
+++ b/tools/testing/selftests/prctl/disable-tsc-ctxt-sw-stress-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
*
diff --git a/tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c b/tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c
index a06f027e9d1642..79950f9a26fd66 100644
--- a/tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c
+++ b/tools/testing/selftests/prctl/disable-tsc-on-off-stress-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
*
diff --git a/tools/testing/selftests/prctl/disable-tsc-test.c b/tools/testing/selftests/prctl/disable-tsc-test.c
index 8d494f7bebdbd6..f84d4ee111d37b 100644
--- a/tools/testing/selftests/prctl/disable-tsc-test.c
+++ b/tools/testing/selftests/prctl/disable-tsc-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Tests for prctl(PR_GET_TSC, ...) / prctl(PR_SET_TSC, ...)
*
diff --git a/tools/testing/selftests/pstore/Makefile b/tools/testing/selftests/pstore/Makefile
index c5f2440ba1f707..5ef57855a2be34 100644
--- a/tools/testing/selftests/pstore/Makefile
+++ b/tools/testing/selftests/pstore/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for pstore selftests.
# Expects pstore backend is registered.
diff --git a/tools/testing/selftests/ptp/Makefile b/tools/testing/selftests/ptp/Makefile
index d4064c742c2673..ef06de0898b739 100644
--- a/tools/testing/selftests/ptp/Makefile
+++ b/tools/testing/selftests/ptp/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -I../../../../usr/include/
TEST_PROGS := testptp
LDLIBS += -lrt
diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace/peeksiginfo.c
index c34cd8ac8aaab6..54900657eb442f 100644
--- a/tools/testing/selftests/ptrace/peeksiginfo.c
+++ b/tools/testing/selftests/ptrace/peeksiginfo.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <stdio.h>
#include <signal.h>
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile
index 16b01559fa5585..4bed0b678f8b81 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all: srcu.c store_buffering
LINUX_SOURCE = ../../../../../..
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h
index 4a3d538fef128c..891ad13e95b2dc 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/include/linux/types.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* This header has been modifies to remove definitions of types that
* are defined in standard userspace headers or are problematic for some
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
index c9e8bc5082a78d..e05182d3e47d19 100755
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/modify_srcu.awk
@@ -1,4 +1,5 @@
#!/usr/bin/awk -f
+# SPDX-License-Identifier: GPL-2.0
# Modify SRCU for formal verification. The first argument should be srcu.h and
# the second should be srcu.c. Outputs modified srcu.h and srcu.c into the
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/assume.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/assume.h
index a64955447995f1..570a49d9da7e2b 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/assume.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/assume.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ASSUME_H
#define ASSUME_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/barriers.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/barriers.h
index 6687acc08e6dfb..be3fdd351937c2 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/barriers.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/barriers.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BARRIERS_H
#define BARRIERS_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/bug_on.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/bug_on.h
index 2a80e91f78e725..5e7912c6a52159 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/bug_on.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/bug_on.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BUG_ON_H
#define BUG_ON_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/combined_source.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/combined_source.c
index 29eb5d2697ed84..e67ee5b3dd7c86 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/combined_source.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/combined_source.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <config.h>
/* Include all source files. */
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h
index a60038aeea7a9f..283d7103334f4e 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/config.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/* "Cheater" definitions based on restricted Kconfig choices. */
#undef CONFIG_TINY_RCU
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/include_srcu.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/include_srcu.c
index 5ec582a53018de..e5202d4cff3038 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/include_srcu.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/include_srcu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <config.h>
#include <assert.h>
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/int_typedefs.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/int_typedefs.h
index 3aad639178580f..0dd27aa517a79f 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/int_typedefs.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/int_typedefs.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef INT_TYPEDEFS_H
#define INT_TYPEDEFS_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/locks.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/locks.h
index 35600466557665..cf6938d679d7fe 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/locks.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/locks.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LOCKS_H
#define LOCKS_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/misc.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/misc.c
index ca892e3b235199..9440cc39e3c686 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/misc.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/misc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <config.h>
#include "misc.h"
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/percpu.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/percpu.h
index 3de5a49de49b2b..27e67a3f291f76 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/percpu.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/percpu.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PERCPU_H
#define PERCPU_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.c
index 4f1b068e9b7a6e..b4083ae348fb2c 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <config.h>
#include "preempt.h"
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h
index 2f95ee0e4dd5e1..f8b762cd214cb5 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/preempt.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef PREEMPT_H
#define PREEMPT_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/simple_sync_srcu.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/simple_sync_srcu.c
index ac9cbc62b4111f..97f592048e0b7c 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/simple_sync_srcu.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/simple_sync_srcu.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <config.h>
#include <assert.h>
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/workqueues.h b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/workqueues.h
index e58c8dfd3e901a..28b96030097118 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/workqueues.h
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/src/workqueues.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef WORKQUEUES_H
#define WORKQUEUES_H
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile
index 3a3aee14922537..ad21b925fbb45c 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CBMC_FLAGS = -I../.. -I../../src -I../../include -I../../empty_includes -32 -pointer-check -mm pso
all:
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/test.c b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/test.c
index 470b1105a11271..2ce2016f7871a2 100644
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/test.c
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/store_buffering/test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <src/combined_source.c>
int x;
diff --git a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/test_script.sh b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/test_script.sh
index d1545972a0fa43..2fe1f0339b4fa0 100755
--- a/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/test_script.sh
+++ b/tools/testing/selftests/rcutorture/formal/srcu-cbmc/tests/test_script.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# This script expects a mode (either --should-pass or --should-fail) followed by
# an input file. The script uses the following environment variables. The test C
diff --git a/tools/testing/selftests/seccomp/Makefile b/tools/testing/selftests/seccomp/Makefile
index 553d870b4ca983..fce7f4ce069251 100644
--- a/tools/testing/selftests/seccomp/Makefile
+++ b/tools/testing/selftests/seccomp/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
include ../lib.mk
diff --git a/tools/testing/selftests/sigaltstack/sas.c b/tools/testing/selftests/sigaltstack/sas.c
index 97bb150837df02..228c2ae47687dd 100644
--- a/tools/testing/selftests/sigaltstack/sas.c
+++ b/tools/testing/selftests/sigaltstack/sas.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Stas Sergeev <stsp@users.sourceforge.net>
*
diff --git a/tools/testing/selftests/splice/Makefile b/tools/testing/selftests/splice/Makefile
index 7e1187e007fa59..e519b159b60d83 100644
--- a/tools/testing/selftests/splice/Makefile
+++ b/tools/testing/selftests/splice/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_PROGS := default_file_splice_read.sh
TEST_GEN_PROGS_EXTENDED := default_file_splice_read
diff --git a/tools/testing/selftests/splice/default_file_splice_read.c b/tools/testing/selftests/splice/default_file_splice_read.c
index 01dd6091554c3d..a3c6e5672e09a2 100644
--- a/tools/testing/selftests/splice/default_file_splice_read.c
+++ b/tools/testing/selftests/splice/default_file_splice_read.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <fcntl.h>
diff --git a/tools/testing/selftests/splice/default_file_splice_read.sh b/tools/testing/selftests/splice/default_file_splice_read.sh
index 1ea2adeabc946d..490db5a2e43521 100755
--- a/tools/testing/selftests/splice/default_file_splice_read.sh
+++ b/tools/testing/selftests/splice/default_file_splice_read.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
n=`./default_file_splice_read </dev/null | wc -c`
test "$n" = 0 && exit 0
diff --git a/tools/testing/selftests/static_keys/test_static_keys.sh b/tools/testing/selftests/static_keys/test_static_keys.sh
index 1261e3fa1e3a85..24cff498b31aa8 100755
--- a/tools/testing/selftests/static_keys/test_static_keys.sh
+++ b/tools/testing/selftests/static_keys/test_static_keys.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs static keys kernel module tests
if /sbin/modprobe -q test_static_key_base; then
diff --git a/tools/testing/selftests/sync/Makefile b/tools/testing/selftests/sync/Makefile
index 8e04d0afcbd7f9..b3c8ba3cb66855 100644
--- a/tools/testing/selftests/sync/Makefile
+++ b/tools/testing/selftests/sync/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -O2 -g -std=gnu89 -pthread -Wall -Wextra
CFLAGS += -I../../../../usr/include/
LDFLAGS += -pthread
diff --git a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
index c727b96a59b0d0..5fa02d86b35f6c 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/filters/tests.json
@@ -17,5 +17,26 @@
"teardown": [
"$TC qdisc del dev $DEV1 ingress"
]
+ },
+ {
+ "id": "d052",
+ "name": "Add 1M filters with the same action",
+ "category": [
+ "filter",
+ "flower"
+ ],
+ "setup": [
+ "$TC qdisc add dev $DEV2 ingress",
+ "./tdc_batch.py $DEV2 $BATCH_FILE --share_action -n 1000000"
+ ],
+ "cmdUnderTest": "$TC -b $BATCH_FILE",
+ "expExitCode": "0",
+ "verifyCmd": "$TC actions list action gact",
+ "matchPattern": "action order 0: gact action drop.*index 1 ref 1000000 bind 1000000",
+ "matchCount": "1",
+ "teardown": [
+ "$TC qdisc del dev $DEV2 ingress",
+ "/bin/rm $BATCH_FILE"
+ ]
}
-] \ No newline at end of file
+]
diff --git a/tools/testing/selftests/tc-testing/tdc.py b/tools/testing/selftests/tc-testing/tdc.py
index cd61b7844c0d48..b8462e1b74f960 100755
--- a/tools/testing/selftests/tc-testing/tdc.py
+++ b/tools/testing/selftests/tc-testing/tdc.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
"""
tdc.py - Linux tc (Traffic Control) unit test driver
@@ -88,7 +89,7 @@ def prepare_env(cmdlist):
exit(1)
-def test_runner(filtered_tests):
+def test_runner(filtered_tests, args):
"""
Driver function for the unit tests.
@@ -105,6 +106,8 @@ def test_runner(filtered_tests):
for tidx in testlist:
result = True
tresult = ""
+ if "flower" in tidx["category"] and args.device == None:
+ continue
print("Test " + tidx["id"] + ": " + tidx["name"])
prepare_env(tidx["setup"])
(p, procout) = exec_cmd(tidx["cmdUnderTest"])
@@ -150,7 +153,11 @@ def ns_create():
exec_cmd(cmd, False)
cmd = 'ip link set $DEV0 up'
exec_cmd(cmd, False)
- cmd = 'ip -s $NS link set $DEV1 up'
+ cmd = 'ip -n $NS link set $DEV1 up'
+ exec_cmd(cmd, False)
+ cmd = 'ip link set $DEV2 netns $NS'
+ exec_cmd(cmd, False)
+ cmd = 'ip -n $NS link set $DEV2 up'
exec_cmd(cmd, False)
@@ -211,7 +218,8 @@ def set_args(parser):
help='Execute the single test case with specified ID')
parser.add_argument('-i', '--id', action='store_true', dest='gen_id',
help='Generate ID numbers for new test cases')
- return parser
+ parser.add_argument('-d', '--device',
+ help='Execute the test case in flower category')
return parser
@@ -225,6 +233,8 @@ def check_default_settings(args):
if args.path != None:
NAMES['TC'] = args.path
+ if args.device != None:
+ NAMES['DEV2'] = args.device
if not os.path.isfile(NAMES['TC']):
print("The specified tc path " + NAMES['TC'] + " does not exist.")
exit(1)
@@ -381,14 +391,17 @@ def set_operation_mode(args):
if (len(alltests) == 0):
print("Cannot find a test case with ID matching " + target_id)
exit(1)
- catresults = test_runner(alltests)
+ catresults = test_runner(alltests, args)
print("All test results: " + "\n\n" + catresults)
elif (len(target_category) > 0):
+ if (target_category == "flower") and args.device == None:
+ print("Please specify a NIC device (-d) to run category flower")
+ exit(1)
if (target_category not in ucat):
print("Specified category is not present in this file.")
exit(1)
else:
- catresults = test_runner(testcases[target_category])
+ catresults = test_runner(testcases[target_category], args)
print("Category " + target_category + "\n\n" + catresults)
ns_destroy()
diff --git a/tools/testing/selftests/tc-testing/tdc_batch.py b/tools/testing/selftests/tc-testing/tdc_batch.py
new file mode 100755
index 00000000000000..707c6bfef68994
--- /dev/null
+++ b/tools/testing/selftests/tc-testing/tdc_batch.py
@@ -0,0 +1,62 @@
+#!/usr/bin/python3
+
+"""
+tdc_batch.py - a script to generate TC batch file
+
+Copyright (C) 2017 Chris Mi <chrism@mellanox.com>
+"""
+
+import argparse
+
+parser = argparse.ArgumentParser(description='TC batch file generator')
+parser.add_argument("device", help="device name")
+parser.add_argument("file", help="batch file name")
+parser.add_argument("-n", "--number", type=int,
+ help="how many lines in batch file")
+parser.add_argument("-o", "--skip_sw",
+ help="skip_sw (offload), by default skip_hw",
+ action="store_true")
+parser.add_argument("-s", "--share_action",
+ help="all filters share the same action",
+ action="store_true")
+parser.add_argument("-p", "--prio",
+ help="all filters have different prio",
+ action="store_true")
+args = parser.parse_args()
+
+device = args.device
+file = open(args.file, 'w')
+
+number = 1
+if args.number:
+ number = args.number
+
+skip = "skip_hw"
+if args.skip_sw:
+ skip = "skip_sw"
+
+share_action = ""
+if args.share_action:
+ share_action = "index 1"
+
+prio = "prio 1"
+if args.prio:
+ prio = ""
+ if number > 0x4000:
+ number = 0x4000
+
+index = 0
+for i in range(0x100):
+ for j in range(0x100):
+ for k in range(0x100):
+ mac = ("%02x:%02x:%02x" % (i, j, k))
+ src_mac = "e4:11:00:" + mac
+ dst_mac = "e4:12:00:" + mac
+ cmd = ("filter add dev %s %s protocol ip parent ffff: flower %s "
+ "src_mac %s dst_mac %s action drop %s" %
+ (device, prio, skip, src_mac, dst_mac, share_action))
+ file.write("%s\n" % cmd)
+ index += 1
+ if index >= number:
+ file.close()
+ exit(0)
diff --git a/tools/testing/selftests/tc-testing/tdc_config.py b/tools/testing/selftests/tc-testing/tdc_config.py
index 01087375a7c38e..eb188c729dd6a0 100644
--- a/tools/testing/selftests/tc-testing/tdc_config.py
+++ b/tools/testing/selftests/tc-testing/tdc_config.py
@@ -1,4 +1,5 @@
"""
+# SPDX-License-Identifier: GPL-2.0
tdc_config.py - tdc user-specified values
Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com>
@@ -12,6 +13,8 @@ NAMES = {
# Name of veth devices to be created for the namespace
'DEV0': 'v0p0',
'DEV1': 'v0p1',
+ 'DEV2': '',
+ 'BATCH_FILE': './batch.txt',
# Name of the namespace to use
'NS': 'tcut'
}
diff --git a/tools/testing/selftests/tc-testing/tdc_helper.py b/tools/testing/selftests/tc-testing/tdc_helper.py
index c3254f861fb29c..ccf2d245870385 100644
--- a/tools/testing/selftests/tc-testing/tdc_helper.py
+++ b/tools/testing/selftests/tc-testing/tdc_helper.py
@@ -1,4 +1,5 @@
"""
+# SPDX-License-Identifier: GPL-2.0
tdc_helper.py - tdc helper functions
Copyright (C) 2017 Lucas Bates <lucasb@mojatatu.com>
diff --git a/tools/testing/selftests/timers/Makefile b/tools/testing/selftests/timers/Makefile
index ae459311540896..3496680981f20f 100644
--- a/tools/testing/selftests/timers/Makefile
+++ b/tools/testing/selftests/timers/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CFLAGS += -O3 -Wl,-no-as-needed -Wall
LDFLAGS += -lrt -lpthread -lm
diff --git a/tools/testing/selftests/user/test_user_copy.sh b/tools/testing/selftests/user/test_user_copy.sh
index 350107f40c1d52..d60506fc77f8bc 100755
--- a/tools/testing/selftests/user/test_user_copy.sh
+++ b/tools/testing/selftests/user/test_user_copy.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
# Runs copy_to/from_user infrastructure using test_user_copy kernel module
if /sbin/modprobe -q test_user_copy; then
diff --git a/tools/testing/selftests/vDSO/Makefile b/tools/testing/selftests/vDSO/Makefile
index 706b68b1c3722d..3d5a62ff7d31ed 100644
--- a/tools/testing/selftests/vDSO/Makefile
+++ b/tools/testing/selftests/vDSO/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
ifndef CROSS_COMPILE
CFLAGS := -std=gnu99
CFLAGS_vdso_standalone_test_x86 := -nostdlib -fno-asynchronous-unwind-tables -fno-stack-protector
diff --git a/tools/testing/selftests/vm/Makefile b/tools/testing/selftests/vm/Makefile
index cbb29e41ef2b3a..e49eca1915f8ca 100644
--- a/tools/testing/selftests/vm/Makefile
+++ b/tools/testing/selftests/vm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for vm selftests
ifndef OUTPUT
diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
index 6d1437f895b8ea..a65b016d4c13a3 100644
--- a/tools/testing/selftests/vm/compaction_test.c
+++ b/tools/testing/selftests/vm/compaction_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
*
* A test for the patch "Allow compaction of unevictable pages".
diff --git a/tools/testing/selftests/vm/hugepage-mmap.c b/tools/testing/selftests/vm/hugepage-mmap.c
index a10f310d2362ff..93f9e7b813314e 100644
--- a/tools/testing/selftests/vm/hugepage-mmap.c
+++ b/tools/testing/selftests/vm/hugepage-mmap.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* hugepage-mmap:
*
diff --git a/tools/testing/selftests/vm/hugepage-shm.c b/tools/testing/selftests/vm/hugepage-shm.c
index 0d0ef4fc0c0474..e2527f32005b38 100644
--- a/tools/testing/selftests/vm/hugepage-shm.c
+++ b/tools/testing/selftests/vm/hugepage-shm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* hugepage-shm:
*
diff --git a/tools/testing/selftests/vm/map_hugetlb.c b/tools/testing/selftests/vm/map_hugetlb.c
index 77687ab59f7732..9b777fa95f090e 100644
--- a/tools/testing/selftests/vm/map_hugetlb.c
+++ b/tools/testing/selftests/vm/map_hugetlb.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Example of using hugepage memory in a user application using the mmap
* system call with MAP_HUGETLB flag. Before running this program make
diff --git a/tools/testing/selftests/vm/mlock-random-test.c b/tools/testing/selftests/vm/mlock-random-test.c
index 83de4f58d2629c..ff4d72eb74b9a0 100644
--- a/tools/testing/selftests/vm/mlock-random-test.c
+++ b/tools/testing/selftests/vm/mlock-random-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* It tests the mlock/mlock2() when they are invoked
* on randomly memory region.
diff --git a/tools/testing/selftests/vm/mlock2-tests.c b/tools/testing/selftests/vm/mlock2-tests.c
index e5dbc87b429777..4997b9222cfa50 100644
--- a/tools/testing/selftests/vm/mlock2-tests.c
+++ b/tools/testing/selftests/vm/mlock2-tests.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sys/mman.h>
#include <stdint.h>
diff --git a/tools/testing/selftests/vm/mlock2.h b/tools/testing/selftests/vm/mlock2.h
index 7ee062929d3e9b..2a6e76c226bc30 100644
--- a/tools/testing/selftests/vm/mlock2.h
+++ b/tools/testing/selftests/vm/mlock2.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <syscall.h>
#include <errno.h>
#include <stdio.h>
diff --git a/tools/testing/selftests/vm/on-fault-limit.c b/tools/testing/selftests/vm/on-fault-limit.c
index 7f96a5c2e2924c..634d87dfb2a4ef 100644
--- a/tools/testing/selftests/vm/on-fault-limit.c
+++ b/tools/testing/selftests/vm/on-fault-limit.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/mman.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/tools/testing/selftests/vm/run_vmtests b/tools/testing/selftests/vm/run_vmtests
index 07548a1fa901ca..cc826326de87ac 100755
--- a/tools/testing/selftests/vm/run_vmtests
+++ b/tools/testing/selftests/vm/run_vmtests
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
#please run as root
#we need 256M, below is the size in kB
diff --git a/tools/testing/selftests/vm/thuge-gen.c b/tools/testing/selftests/vm/thuge-gen.c
index 88a2ab535e0129..361ef7192cc666 100644
--- a/tools/testing/selftests/vm/thuge-gen.c
+++ b/tools/testing/selftests/vm/thuge-gen.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* Test selecting other page sizes for mmap/shmget.
Before running this huge pages for each huge page size must have been
diff --git a/tools/testing/selftests/watchdog/Makefile b/tools/testing/selftests/watchdog/Makefile
index ee068511fd0bc6..6b5598b5525236 100644
--- a/tools/testing/selftests/watchdog/Makefile
+++ b/tools/testing/selftests/watchdog/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
TEST_GEN_PROGS := watchdog-test
include ../lib.mk
diff --git a/tools/testing/selftests/watchdog/watchdog-test.c b/tools/testing/selftests/watchdog/watchdog-test.c
index a1391be2dc1e2b..6e290874b70e21 100644
--- a/tools/testing/selftests/watchdog/watchdog-test.c
+++ b/tools/testing/selftests/watchdog/watchdog-test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Watchdog Driver Test Program
*/
diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 0a74a20ca32bae..7b1adeee4b0f19 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
include ../lib.mk
diff --git a/tools/testing/selftests/x86/ioperm.c b/tools/testing/selftests/x86/ioperm.c
index b77313ba2ab164..01de41c1b7251d 100644
--- a/tools/testing/selftests/x86/ioperm.c
+++ b/tools/testing/selftests/x86/ioperm.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* ioperm.c - Test case for ioperm(2)
* Copyright (c) 2015 Andrew Lutomirski
diff --git a/tools/testing/selftests/x86/iopl.c b/tools/testing/selftests/x86/iopl.c
index c496ca97bc18a3..6aa27f34644c49 100644
--- a/tools/testing/selftests/x86/iopl.c
+++ b/tools/testing/selftests/x86/iopl.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* iopl.c - Test case for a Linux on Xen 64-bit bug
* Copyright (c) 2015 Andrew Lutomirski
diff --git a/tools/testing/selftests/x86/ldt_gdt.c b/tools/testing/selftests/x86/ldt_gdt.c
index b9a22f18566ae2..961e3ee26c2722 100644
--- a/tools/testing/selftests/x86/ldt_gdt.c
+++ b/tools/testing/selftests/x86/ldt_gdt.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* ldt_gdt.c - Test cases for LDT and GDT access
* Copyright (c) 2015 Andrew Lutomirski
diff --git a/tools/testing/selftests/x86/mpx-debug.h b/tools/testing/selftests/x86/mpx-debug.h
index 9230981f2e12a0..7546eba7f17a0d 100644
--- a/tools/testing/selftests/x86/mpx-debug.h
+++ b/tools/testing/selftests/x86/mpx-debug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _MPX_DEBUG_H
#define _MPX_DEBUG_H
diff --git a/tools/testing/selftests/x86/mpx-dig.c b/tools/testing/selftests/x86/mpx-dig.c
index ce85356d7e2e7f..c13607ef5c11e0 100644
--- a/tools/testing/selftests/x86/mpx-dig.c
+++ b/tools/testing/selftests/x86/mpx-dig.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Written by Dave Hansen <dave.hansen@intel.com>
*/
diff --git a/tools/testing/selftests/x86/mpx-hw.h b/tools/testing/selftests/x86/mpx-hw.h
index 093c190178a962..3f0093911f03d5 100644
--- a/tools/testing/selftests/x86/mpx-hw.h
+++ b/tools/testing/selftests/x86/mpx-hw.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _MPX_HW_H
#define _MPX_HW_H
diff --git a/tools/testing/selftests/x86/mpx-mm.h b/tools/testing/selftests/x86/mpx-mm.h
index af706a5398f7a7..6dbdd66b824240 100644
--- a/tools/testing/selftests/x86/mpx-mm.h
+++ b/tools/testing/selftests/x86/mpx-mm.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _MPX_MM_H
#define _MPX_MM_H
diff --git a/tools/testing/selftests/x86/pkey-helpers.h b/tools/testing/selftests/x86/pkey-helpers.h
index b20293956eecd3..3818f25391c24c 100644
--- a/tools/testing/selftests/x86/pkey-helpers.h
+++ b/tools/testing/selftests/x86/pkey-helpers.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _PKEYS_HELPER_H
#define _PKEYS_HELPER_H
#define _GNU_SOURCE
diff --git a/tools/testing/selftests/x86/protection_keys.c b/tools/testing/selftests/x86/protection_keys.c
index 23927845518dee..555e43ca846b2b 100644
--- a/tools/testing/selftests/x86/protection_keys.c
+++ b/tools/testing/selftests/x86/protection_keys.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Tests x86 Memory Protection Keys (see Documentation/x86/protection-keys.txt)
*
diff --git a/tools/testing/selftests/x86/ptrace_syscall.c b/tools/testing/selftests/x86/ptrace_syscall.c
index eaea9243970840..1ae1c5a7392ead 100644
--- a/tools/testing/selftests/x86/ptrace_syscall.c
+++ b/tools/testing/selftests/x86/ptrace_syscall.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <sys/ptrace.h>
diff --git a/tools/testing/selftests/x86/raw_syscall_helper_32.S b/tools/testing/selftests/x86/raw_syscall_helper_32.S
index 534e71e35c6a1f..94410fa2b5ed3e 100644
--- a/tools/testing/selftests/x86/raw_syscall_helper_32.S
+++ b/tools/testing/selftests/x86/raw_syscall_helper_32.S
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
.global sys32_helper
sys32_helper:
/* Args: syscall_args_32*, function pointer */
diff --git a/tools/testing/selftests/x86/test_FCMOV.c b/tools/testing/selftests/x86/test_FCMOV.c
index 4adcca0c80c449..6b5036fbb7358a 100644
--- a/tools/testing/selftests/x86/test_FCMOV.c
+++ b/tools/testing/selftests/x86/test_FCMOV.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#undef __USE_GNU
diff --git a/tools/testing/selftests/x86/test_FCOMI.c b/tools/testing/selftests/x86/test_FCOMI.c
index db4933e31af925..aec6692c6dcf80 100644
--- a/tools/testing/selftests/x86/test_FCOMI.c
+++ b/tools/testing/selftests/x86/test_FCOMI.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#undef __USE_GNU
diff --git a/tools/testing/selftests/x86/test_FISTTP.c b/tools/testing/selftests/x86/test_FISTTP.c
index b8e61a047f6ba1..09789c0ce3e9cd 100644
--- a/tools/testing/selftests/x86/test_FISTTP.c
+++ b/tools/testing/selftests/x86/test_FISTTP.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#undef _GNU_SOURCE
#define _GNU_SOURCE 1
#undef __USE_GNU
diff --git a/tools/testing/selftests/x86/test_vdso.c b/tools/testing/selftests/x86/test_vdso.c
index 65d7a2bf7e143d..29973cde06d3db 100644
--- a/tools/testing/selftests/x86/test_vdso.c
+++ b/tools/testing/selftests/x86/test_vdso.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* ldt_gdt.c - Test cases for LDT and GDT access
* Copyright (c) 2011-2015 Andrew Lutomirski
diff --git a/tools/testing/selftests/zram/Makefile b/tools/testing/selftests/zram/Makefile
index c3a87e5f9d3648..7f78eb1b59cb45 100644
--- a/tools/testing/selftests/zram/Makefile
+++ b/tools/testing/selftests/zram/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
TEST_PROGS := zram.sh
diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh
index 683a292e329015..754de7da426a80 100755
--- a/tools/testing/selftests/zram/zram.sh
+++ b/tools/testing/selftests/zram/zram.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# SPDX-License-Identifier: GPL-2.0
TCID="zram.sh"
. ./zram_lib.sh
diff --git a/tools/thermal/tmon/Makefile b/tools/thermal/tmon/Makefile
index 3a961e998281b7..21169322baeaca 100644
--- a/tools/thermal/tmon/Makefile
+++ b/tools/thermal/tmon/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
VERSION = 1.0
BINDIR=usr/bin
diff --git a/tools/thermal/tmon/tmon.8 b/tools/thermal/tmon/tmon.8
index 02d5179803aae1..2f122de5841b17 100644
--- a/tools/thermal/tmon/tmon.8
+++ b/tools/thermal/tmon/tmon.8
@@ -1,4 +1,5 @@
.TH TMON 8
+# SPDX-License-Identifier: GPL-2.0
.SH NAME
\fBtmon\fP - A monitoring and testing tool for Linux kernel thermal subsystem
diff --git a/tools/usb/Makefile b/tools/usb/Makefile
index acf2165c04e64f..4e6506078494fb 100644
--- a/tools/usb/Makefile
+++ b/tools/usb/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for USB tools
CC = $(CROSS_COMPILE)gcc
diff --git a/tools/usb/ffs-aio-example/multibuff/host_app/Makefile b/tools/usb/ffs-aio-example/multibuff/host_app/Makefile
index 8c4a6f0aa82ded..df36e4c28f619a 100644
--- a/tools/usb/ffs-aio-example/multibuff/host_app/Makefile
+++ b/tools/usb/ffs-aio-example/multibuff/host_app/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC = gcc
LIBUSB_CFLAGS = $(shell pkg-config --cflags libusb-1.0)
LIBUSB_LIBS = $(shell pkg-config --libs libusb-1.0)
diff --git a/tools/usb/hcd-tests.sh b/tools/usb/hcd-tests.sh
index b30b3dc4c7888c..e8cad6a4f9c9c7 100644
--- a/tools/usb/hcd-tests.sh
+++ b/tools/usb/hcd-tests.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
#
# test types can be passed on the command line:
#
diff --git a/tools/usb/usbip/Makefile.am b/tools/usb/usbip/Makefile.am
index 66f8bf038c9f6a..da3a430849a873 100644
--- a/tools/usb/usbip/Makefile.am
+++ b/tools/usb/usbip/Makefile.am
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
SUBDIRS := libsrc src
includedir = @includedir@/usbip
include_HEADERS := $(addprefix libsrc/, \
diff --git a/tools/usb/usbip/cleanup.sh b/tools/usb/usbip/cleanup.sh
index 955c3ccb729a28..8028c3a5c22b43 100755
--- a/tools/usb/usbip/cleanup.sh
+++ b/tools/usb/usbip/cleanup.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
if [ -r Makefile ]; then
make distclean
diff --git a/tools/usb/usbip/libsrc/Makefile.am b/tools/usb/usbip/libsrc/Makefile.am
index 90daf95c0804a4..dabd2c91d311f1 100644
--- a/tools/usb/usbip/libsrc/Makefile.am
+++ b/tools/usb/usbip/libsrc/Makefile.am
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
libusbip_la_CPPFLAGS = -DUSBIDS_FILE='"@USBIDS_DIR@/usb.ids"'
libusbip_la_CFLAGS = @EXTRA_CFLAGS@
libusbip_la_LDFLAGS = -version-info @LIBUSBIP_VERSION@
diff --git a/tools/usb/usbip/libsrc/list.h b/tools/usb/usbip/libsrc/list.h
index 5eaaa78e2c6a47..a941671e4900d8 100644
--- a/tools/usb/usbip/libsrc/list.h
+++ b/tools/usb/usbip/libsrc/list.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LIST_H
#define _LIST_H
diff --git a/tools/usb/usbip/libsrc/sysfs_utils.c b/tools/usb/usbip/libsrc/sysfs_utils.c
index 36ac88ece0b87b..14d5e67d398a96 100644
--- a/tools/usb/usbip/libsrc/sysfs_utils.c
+++ b/tools/usb/usbip/libsrc/sysfs_utils.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/tools/usb/usbip/libsrc/sysfs_utils.h b/tools/usb/usbip/libsrc/sysfs_utils.h
index 32ac1d105d1854..0cd5f17e7eb224 100644
--- a/tools/usb/usbip/libsrc/sysfs_utils.h
+++ b/tools/usb/usbip/libsrc/sysfs_utils.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __SYSFS_UTILS_H
#define __SYSFS_UTILS_H
diff --git a/tools/usb/usbip/libsrc/usbip_common.c b/tools/usb/usbip/libsrc/usbip_common.c
index 1517a232ab1879..001bb8e8f66894 100644
--- a/tools/usb/usbip/libsrc/usbip_common.c
+++ b/tools/usb/usbip/libsrc/usbip_common.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2005-2007 Takahiro Hirofuchi
*/
diff --git a/tools/usb/usbip/libsrc/usbip_common.h b/tools/usb/usbip/libsrc/usbip_common.h
index 51ef5fe485dde8..e45ec9d2fdbc57 100644
--- a/tools/usb/usbip/libsrc/usbip_common.h
+++ b/tools/usb/usbip/libsrc/usbip_common.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2005-2007 Takahiro Hirofuchi
*/
diff --git a/tools/usb/usbip/libsrc/vhci_driver.c b/tools/usb/usbip/libsrc/vhci_driver.c
index 9bd2cd71645df0..5727dfb15a83ef 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.c
+++ b/tools/usb/usbip/libsrc/vhci_driver.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2005-2007 Takahiro Hirofuchi
*/
diff --git a/tools/usb/usbip/libsrc/vhci_driver.h b/tools/usb/usbip/libsrc/vhci_driver.h
index 4898d3bafb1098..418b404d512107 100644
--- a/tools/usb/usbip/libsrc/vhci_driver.h
+++ b/tools/usb/usbip/libsrc/vhci_driver.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2005-2007 Takahiro Hirofuchi
*/
diff --git a/tools/usb/usbip/src/Makefile.am b/tools/usb/usbip/src/Makefile.am
index e81a4ebadeff9b..e26f39e0579d25 100644
--- a/tools/usb/usbip/src/Makefile.am
+++ b/tools/usb/usbip/src/Makefile.am
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
AM_CPPFLAGS = -I$(top_srcdir)/libsrc -DUSBIDS_FILE='"@USBIDS_DIR@/usb.ids"'
AM_CFLAGS = @EXTRA_CFLAGS@
LDADD = $(top_builddir)/libsrc/libusbip.la
diff --git a/tools/usb/usbip/src/usbip_network.h b/tools/usb/usbip/src/usbip_network.h
index c1e875cf1078cb..7032687621d3b5 100644
--- a/tools/usb/usbip/src/usbip_network.h
+++ b/tools/usb/usbip/src/usbip_network.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2005-2007 Takahiro Hirofuchi
*/
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile
index 39c89a5ea990fa..8e2a908115c2d5 100644
--- a/tools/virtio/Makefile
+++ b/tools/virtio/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all: test mod
test: virtio_test vringh_test
virtio_test: virtio_ring.o virtio_test.o
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h
index ba34f9e96efd6b..0ac3caf90877fe 100644
--- a/tools/virtio/asm/barrier.h
+++ b/tools/virtio/asm/barrier.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#if defined(__i386__) || defined(__x86_64__)
#define barrier() asm volatile("" ::: "memory")
#define virt_mb() __sync_synchronize()
diff --git a/tools/virtio/linux/bug.h b/tools/virtio/linux/bug.h
index fb94f0787c47fe..b14c2c3b6b8578 100644
--- a/tools/virtio/linux/bug.h
+++ b/tools/virtio/linux/bug.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef BUG_H
#define BUG_H
diff --git a/tools/virtio/linux/compiler.h b/tools/virtio/linux/compiler.h
index c9ccfd42ec137d..903dc9c4bd115f 100644
--- a/tools/virtio/linux/compiler.h
+++ b/tools/virtio/linux/compiler.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LINUX_COMPILER_H
#define LINUX_COMPILER_H
diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h
index 18601f6689b9e1..1571e24e94942b 100644
--- a/tools/virtio/linux/dma-mapping.h
+++ b/tools/virtio/linux/dma-mapping.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_DMA_MAPPING_H
#define _LINUX_DMA_MAPPING_H
diff --git a/tools/virtio/linux/err.h b/tools/virtio/linux/err.h
index e32eff8b2a14f9..0943c644a701a4 100644
--- a/tools/virtio/linux/err.h
+++ b/tools/virtio/linux/err.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef ERR_H
#define ERR_H
#define MAX_ERRNO 4095
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h
index d9554fc3f3403c..395521a7a8d86b 100644
--- a/tools/virtio/linux/kernel.h
+++ b/tools/virtio/linux/kernel.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef KERNEL_H
#define KERNEL_H
#include <stdbool.h>
diff --git a/tools/virtio/linux/module.h b/tools/virtio/linux/module.h
index 28ce95a0599785..9dfa96fea2b239 100644
--- a/tools/virtio/linux/module.h
+++ b/tools/virtio/linux/module.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/export.h>
#define MODULE_LICENSE(__MODULE_LICENSE_value) \
diff --git a/tools/virtio/linux/scatterlist.h b/tools/virtio/linux/scatterlist.h
index 68c9e2adc996e0..9a45f90e2d0897 100644
--- a/tools/virtio/linux/scatterlist.h
+++ b/tools/virtio/linux/scatterlist.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef SCATTERLIST_H
#define SCATTERLIST_H
#include <linux/kernel.h>
diff --git a/tools/virtio/linux/slab.h b/tools/virtio/linux/slab.h
index 7e1c1197d4390e..319dcaa07755f3 100644
--- a/tools/virtio/linux/slab.h
+++ b/tools/virtio/linux/slab.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LINUX_SLAB_H
#define GFP_KERNEL 0
#define GFP_ATOMIC 0
diff --git a/tools/virtio/linux/uaccess.h b/tools/virtio/linux/uaccess.h
index fa05d01b2c9052..991dfb2639987f 100644
--- a/tools/virtio/linux/uaccess.h
+++ b/tools/virtio/linux/uaccess.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef UACCESS_H
#define UACCESS_H
diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h
index d8f534025b7f7b..b751350d4ce8a1 100644
--- a/tools/virtio/linux/virtio.h
+++ b/tools/virtio/linux/virtio.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef LINUX_VIRTIO_H
#define LINUX_VIRTIO_H
#include <linux/scatterlist.h>
diff --git a/tools/virtio/linux/virtio_byteorder.h b/tools/virtio/linux/virtio_byteorder.h
index 9de9e6ac1d10b5..5b50f7eebd9c09 100644
--- a/tools/virtio/linux/virtio_byteorder.h
+++ b/tools/virtio/linux/virtio_byteorder.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_VIRTIO_BYTEORDER_STUB_H
#define _LINUX_VIRTIO_BYTEORDER_STUB_H
diff --git a/tools/virtio/linux/virtio_config.h b/tools/virtio/linux/virtio_config.h
index 9ba11815e0a16b..dbf14c1e2188d9 100644
--- a/tools/virtio/linux/virtio_config.h
+++ b/tools/virtio/linux/virtio_config.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/virtio_byteorder.h>
#include <linux/virtio.h>
#include <uapi/linux/virtio_config.h>
diff --git a/tools/virtio/ringtest/Makefile b/tools/virtio/ringtest/Makefile
index c012edbdb13b65..85c98c2810fb39 100644
--- a/tools/virtio/ringtest/Makefile
+++ b/tools/virtio/ringtest/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
all:
all: ring virtio_ring_0_9 virtio_ring_poll virtio_ring_inorder ptr_ring noring
diff --git a/tools/virtio/ringtest/noring.c b/tools/virtio/ringtest/noring.c
index b8d1c1daac7cc0..ce2440d5ca936c 100644
--- a/tools/virtio/ringtest/noring.c
+++ b/tools/virtio/ringtest/noring.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include "main.h"
#include <assert.h>
diff --git a/tools/virtio/ringtest/ptr_ring.c b/tools/virtio/ringtest/ptr_ring.c
index 7b22f1b2065208..38bb171acebade 100644
--- a/tools/virtio/ringtest/ptr_ring.c
+++ b/tools/virtio/ringtest/ptr_ring.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include "main.h"
#include <stdlib.h>
diff --git a/tools/virtio/ringtest/run-on-all.sh b/tools/virtio/ringtest/run-on-all.sh
index 29b0d3920bfc41..dcc3ea758f48ed 100755
--- a/tools/virtio/ringtest/run-on-all.sh
+++ b/tools/virtio/ringtest/run-on-all.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
CPUS_ONLINE=$(lscpu --online -p=cpu|grep -v -e '#')
#use last CPU for host. Why not the first?
diff --git a/tools/virtio/uapi/linux/virtio_ring.h b/tools/virtio/uapi/linux/virtio_ring.h
index 4d99c78234d34c..cf50b2e5ff022b 100644
--- a/tools/virtio/uapi/linux/virtio_ring.h
+++ b/tools/virtio/uapi/linux/virtio_ring.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef VIRTIO_RING_H
#define VIRTIO_RING_H
#include "../../../../include/uapi/linux/virtio_ring.h"
diff --git a/tools/virtio/virtio-trace/Makefile b/tools/virtio/virtio-trace/Makefile
index 0d2381633475a2..7843ebcda71dec 100644
--- a/tools/virtio/virtio-trace/Makefile
+++ b/tools/virtio/virtio-trace/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
CC = gcc
CFLAGS = -O2 -Wall -pthread
diff --git a/tools/virtio/virtio-trace/trace-agent.h b/tools/virtio/virtio-trace/trace-agent.h
index 8de79bfeaa7328..e67885969f0e1e 100644
--- a/tools/virtio/virtio-trace/trace-agent.h
+++ b/tools/virtio/virtio-trace/trace-agent.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __TRACE_AGENT_H__
#define __TRACE_AGENT_H__
#include <pthread.h>
diff --git a/tools/virtio/virtio_test.c b/tools/virtio/virtio_test.c
index 0fecaec90d0d69..b427def67e7e52 100644
--- a/tools/virtio/virtio_test.c
+++ b/tools/virtio/virtio_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#define _GNU_SOURCE
#include <getopt.h>
#include <string.h>
diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c
index 9476c616d0642c..293653463303b6 100644
--- a/tools/virtio/vringh_test.c
+++ b/tools/virtio/vringh_test.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* Simple test of virtio code, entirely in userpsace. */
#define _GNU_SOURCE
#include <sched.h>
diff --git a/tools/vm/Makefile b/tools/vm/Makefile
index 006029456988d6..be320b905ea75d 100644
--- a/tools/vm/Makefile
+++ b/tools/vm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Makefile for vm tools
#
TARGETS=page-types slabinfo page_owner_sort
diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c
index f1c055f3c24365..18fc112b65cdf7 100644
--- a/tools/vm/page_owner_sort.c
+++ b/tools/vm/page_owner_sort.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* User-space helper to sort the output of /sys/kernel/debug/page_owner
*
diff --git a/tools/vm/slabinfo.c b/tools/vm/slabinfo.c
index b9d34b37c017be..b0b7ef6d0de1c1 100644
--- a/tools/vm/slabinfo.c
+++ b/tools/vm/slabinfo.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Slabinfo: Tool to get reports about slabs
*