Commit bbdbeb00 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'perf-tools-for-v5.16-2021-11-07-without-bpftool-fix' of...

Merge tag 'perf-tools-for-v5.16-2021-11-07-without-bpftool-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux

Pull perf tools updates from Arnaldo Carvalho de Melo:
 "perf annotate:
   - Add riscv64 support.
   - Add fusion logic for AMD microarchs.

  perf record:
   - Add an option to control the synthesizing behavior:
       --synth <no|all|task|mmap|cgroup>

  core:
   - Allow controlling synthesizing PERF_RECORD_ metadata events during
     record.
   - perf.data reader prep work for multithreaded processing.
   - Fix missing exclude_{host,guest} setting in PMUs that don't support
     it and that were causing the feature detection code to disable it
     for all events, even the ones in PMUs that support it.
   - Fix the default use of precise events on AMD, that were always
     falling back to non-precise because perf_event_attr.exclude_guest=1
     was set and IBS does not have filtering capability, refusing
     precise + exclude_guest.
   - Add bitfield_swap() to handle branch_stack endian issue.

  perf script:
   - Show binary offsets for userspace addresses in callchains.
   - Support instruction latency via new "ins_lat" selectable field.
   - Add dlfilter-show-cycles

  perf inject:
   - Add vmlinux and ignore-vmlinux arguments, similar to other tools.

  perf list:
   - Display PMU prefix for partially supported hybrid cache events.
   - Display hybrid PMU events with cpu type.

  perf stat:
   - Improve metrics documentation of data structures.
   - Fix memory leaks in the metric code.
   - Use NAN for missing event IDs.
   - Don't compute unused events.
   - Fix memory leak on error path.
   - Encode and use metric-id as a metric qualifier.
   - Allow metrics with no events.
   - Avoid events for an 'if' constant result.
   - Only add a referenced metric once.
   - Simplify metric_refs calculation.
   - Allow modifiers on metrics.

  perf test:
   - Add workload test of metric and metric groups.
   - Workload test of all PMUs.
   - vmlinux-kallsyms: Ignore hidden symbols.
   - Add pmu-event test for event described as "config=".
   - Verify more event members in pmu-events test.
   - Add endian test for struct branch_flags on the sample-parsing test.
   - Improve temp file cleanup in several tests.

  perf daemon:
   - Address MSAN warnings on send_cmd().

  perf kmem:
   - Improve man page for record options

  perf srcline:
   - Use long-running addr2line per DSO, greatly speeding up the
     'srcline' sort order.

  perf symbols:
   - Ignore $a/$d symbols for ARM modules.
   - Fix /proc/kcore access on 32 bit systems.

  Kernel UAPI copies:
   - Update copy of linux/socket.h with the kernel sources, no change in
     tooling output.

  libbpf:
   - Pull in bpf_program__get_prog_info_linear() from libbpf, too much
     specific to perf.
   - Deprecate bpf_map__resize() in favor of bpf_map_set_max_entries()
   - Install libbpf headers locally when building.
   - Bump minimum LLVM C++ std to GNU++14.

  libperf:
   - Use binary search in perf_cpu_map__idx() as array are sorted.

  libtracefs:
   - Enable libtracefs dynamic linking.

  libtraceevent:
   - Increase logging when verbose.

  Arch specific:

   * PowerPC:
      - Add support to expose instruction and data address registers as
        part of extended regs.

  Vendor events:

   * JSON parser:
      - Support ConfigCode to set the config= in PMUs
      - Make the JSON parser more conformant when in strict mode.

   * All JSON files:
      - Fix all remaining invalid JSON files.

   * ARM:
      - Syntax corrections in Neoverse N1 json.
      - Categorise the Neoverse V1 counters.
      - Add new armv8 PMU events.
      - Revise hip08 uncore events.

  Hardware tracing:

   * auxtrace:
      - Add missing Z option to ITRACE_HELP.
      - Add itrace A option to approximate IPC.
      - Add itrace d+o option to direct debug log to stdout.

   * Intel PT:
      - Add support for PERF_RECORD_AUX_OUTPUT_HW_ID
      - Support itrace A option to approximate IPC
      - Support itrace d+o option to direct debug log to stdout"

* tag 'perf-tools-for-v5.16-2021-11-07-without-bpftool-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (120 commits)
  perf build: Install libbpf headers locally when building
  perf MANIFEST: Add bpftool files to allow building with BUILD_BPF_SKEL=1
  perf metric: Fix memory leaks
  perf parse-event: Add init and exit to parse_event_error
  perf parse-events: Rename parse_events_error functions
  perf stat: Fix memory leak on error path
  perf tools: Use __BYTE_ORDER__
  perf inject: Add vmlinux and ignore-vmlinux arguments
  perf tools: Check vmlinux/kallsyms arguments in all tools
  perf tools: Refactor out kernel symbol argument sanity checking
  perf symbols: Ignore $a/$d symbols for ARM modules
  perf evsel: Don't set exclude_guest by default
  perf evsel: Fix missing exclude_{host,guest} setting
  perf bpf: Add missing free to bpf_event__print_bpf_prog_info()
  perf beauty: Update copy of linux/socket.h with the kernel sources
  perf clang: Fixes for more recent LLVM/clang
  tools: Bump minimum LLVM C++ std to GNU++14
  perf bpf: Pull in bpf_program__get_prog_info_linear()
  Revert "perf bench futex: Add support for 32-bit systems with 64-bit time_t"
  perf test sample-parsing: Add endian test for struct branch_flags
  ...
parents 1e9ed936 6b491a86
Loading
Loading
Loading
Loading
+18 −10
Original line number Diff line number Diff line
@@ -61,27 +61,35 @@ enum perf_event_powerpc_regs {
	PERF_REG_POWERPC_PMC4,
	PERF_REG_POWERPC_PMC5,
	PERF_REG_POWERPC_PMC6,
	/* Max regs without the extended regs */
	PERF_REG_POWERPC_SDAR,
	PERF_REG_POWERPC_SIAR,
	/* Max mask value for interrupt regs w/o extended regs */
	PERF_REG_POWERPC_MAX = PERF_REG_POWERPC_MMCRA + 1,
	/* Max mask value for interrupt regs including extended regs */
	PERF_REG_EXTENDED_MAX = PERF_REG_POWERPC_SIAR + 1,
};

#define PERF_REG_PMU_MASK	((1ULL << PERF_REG_POWERPC_MAX) - 1)

/* Exclude MMCR3, SIER2, SIER3 for CPU_FTR_ARCH_300 */
#define	PERF_EXCLUDE_REG_EXT_300	(7ULL << PERF_REG_POWERPC_MMCR3)

/*
 * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_300
 * includes 9 SPRS from MMCR0 to PMC6 excluding the
 * unsupported SPRS in PERF_EXCLUDE_REG_EXT_300.
 * includes 11 SPRS from MMCR0 to SIAR excluding the
 * unsupported SPRS MMCR3, SIER2 and SIER3.
 */
#define PERF_REG_PMU_MASK_300   ((0xfffULL << PERF_REG_POWERPC_MMCR0) - PERF_EXCLUDE_REG_EXT_300)
#define PERF_REG_PMU_MASK_300	\
	((1ULL << PERF_REG_POWERPC_MMCR0) | (1ULL << PERF_REG_POWERPC_MMCR1) | \
	(1ULL << PERF_REG_POWERPC_MMCR2) | (1ULL << PERF_REG_POWERPC_PMC1) | \
	(1ULL << PERF_REG_POWERPC_PMC2) | (1ULL << PERF_REG_POWERPC_PMC3) | \
	(1ULL << PERF_REG_POWERPC_PMC4) | (1ULL << PERF_REG_POWERPC_PMC5) | \
	(1ULL << PERF_REG_POWERPC_PMC6) | (1ULL << PERF_REG_POWERPC_SDAR) | \
	(1ULL << PERF_REG_POWERPC_SIAR))

/*
 * PERF_REG_EXTENDED_MASK value for CPU_FTR_ARCH_31
 * includes 12 SPRs from MMCR0 to PMC6.
 * includes 14 SPRs from MMCR0 to SIAR.
 */
#define PERF_REG_PMU_MASK_31   (0xfffULL << PERF_REG_POWERPC_MMCR0)
#define PERF_REG_PMU_MASK_31	\
	(PERF_REG_PMU_MASK_300 | (1ULL << PERF_REG_POWERPC_MMCR3) | \
	(1ULL << PERF_REG_POWERPC_SIER2) | (1ULL << PERF_REG_POWERPC_SIER3))

#define PERF_REG_EXTENDED_MAX  (PERF_REG_POWERPC_PMC6 + 1)
#endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ FEATURE_TESTS_BASIC := \
        libslang                        \
        libslang-include-subdir         \
        libtraceevent                   \
        libtracefs                      \
        libcrypto                       \
        libunwind                       \
        pthread-attr-setaffinity-np     \
+8 −4
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ FILES= \
         test-libslang.bin                      \
         test-libslang-include-subdir.bin       \
         test-libtraceevent.bin                 \
         test-libtracefs.bin                    \
         test-libcrypto.bin                     \
         test-libunwind.bin                     \
         test-libunwind-debug-frame.bin         \
@@ -90,7 +91,7 @@ __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(
###############################

$(OUTPUT)test-all.bin:
	$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -I/usr/include/slang -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap
	$(BUILD) -fstack-protector-all -O2 -D_FORTIFY_SOURCE=2 -ldw -lelf -lnuma -lelf -lslang $(FLAGS_PERL_EMBED) $(FLAGS_PYTHON_EMBED) -DPACKAGE='"perf"' -lbfd -ldl -lz -llzma -lzstd -lcap

$(OUTPUT)test-hello.bin:
	$(BUILD)
@@ -199,6 +200,9 @@ $(OUTPUT)test-libslang-include-subdir.bin:
$(OUTPUT)test-libtraceevent.bin:
	$(BUILD) -ltraceevent

$(OUTPUT)test-libtracefs.bin:
	$(BUILD) -ltracefs

$(OUTPUT)test-libcrypto.bin:
	$(BUILD) -lcrypto

@@ -296,7 +300,7 @@ $(OUTPUT)test-jvmti-cmlr.bin:
	$(BUILD)

$(OUTPUT)test-llvm.bin:
	$(BUILDXX) -std=gnu++11 				\
	$(BUILDXX) -std=gnu++14 				\
		-I$(shell $(LLVM_CONFIG) --includedir) 		\
		-L$(shell $(LLVM_CONFIG) --libdir)		\
		$(shell $(LLVM_CONFIG) --libs Core BPF)		\
@@ -304,12 +308,12 @@ $(OUTPUT)test-llvm.bin:
		> $(@:.bin=.make.output) 2>&1

$(OUTPUT)test-llvm-version.bin:
	$(BUILDXX) -std=gnu++11 				\
	$(BUILDXX) -std=gnu++14					\
		-I$(shell $(LLVM_CONFIG) --includedir)		\
		> $(@:.bin=.make.output) 2>&1

$(OUTPUT)test-clang.bin:
	$(BUILDXX) -std=gnu++11 				\
	$(BUILDXX) -std=gnu++14					\
		-I$(shell $(LLVM_CONFIG) --includedir) 		\
		-L$(shell $(LLVM_CONFIG) --libdir)		\
		-Wl,--start-group -lclangBasic -lclangDriver	\
+10 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
#include <tracefs/tracefs.h>

int main(void)
{
	struct tracefs_instance *inst = tracefs_instance_create("dummy");

	tracefs_instance_destroy(inst);
	return 0;
}
+14 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_LIST_SORT_H
#define _LINUX_LIST_SORT_H

#include <linux/types.h>

struct list_head;

typedef int __attribute__((nonnull(2,3))) (*list_cmp_func_t)(void *,
		const struct list_head *, const struct list_head *);

__attribute__((nonnull(2,3)))
void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp);
#endif
Loading