Merge tag 'perf-core-for-mingo-5.4-20190920-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:

perf stat:

  Srikar Dronamraju:

  - Fix a segmentation fault when using repeat forever.

  - Reset previous counts on repeat with interval.

aarch64:

  James Clark:

  - Add PMU event JSON files for Cortex-A76 and Neoverse N1.

PowerPC:

  Anju T Sudhakar:

  - Make 'trace_cycles' the default event for 'perf kvm record' in PowerPC.

S/390:

  - Link libjvmti to tools/lib/string.o to have a weak strlcpy()
    implementation, providing previously unresolved symbol on s/390.

perf test:

  Jiri Olsa:

  - Add libperf automated tests to 'make -C tools/perf build-test'.

  Colin Ian King:

  - Fix spelling mistake.

Tree wide:

  Arnaldo Carvalho de Melo:

  - Some more header file sanitization.

libperf:

  Jiri Olsa:

  - Add dependency on libperf for python.so binding.

libtraceevent:

  Sakari Ailus:

  - Convert remaining %p[fF] users to %p[sS].

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar
2019-09-20 18:14:00 +02:00
180 changed files with 2763 additions and 2256 deletions

View File

@@ -25,7 +25,7 @@
#include "../../util/evsel.h"
#include "../../util/pmu.h"
#include "../../util/cs-etm.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/session.h"
#include <errno.h>

View File

@@ -16,7 +16,7 @@
#include "../../util/evsel.h"
#include "../../util/evlist.h"
#include "../../util/session.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/pmu.h"
#include "../../util/debug.h"
#include "../../util/auxtrace.h"

View File

@@ -11,7 +11,6 @@
#include <dwarf-regs.h>
#include <linux/ptrace.h> /* for struct user_pt_regs */
#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
const char *name;

View File

@@ -1,5 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <perf/cpumap.h>
#include <internal/cpumap.h>
#include <api/fs/fs.h>
#include "debug.h"
#include "header.h"
@@ -29,7 +31,7 @@ char *get_cpuid_str(struct perf_pmu *pmu)
/* read midr from list of cpus mapped to this pmu */
cpus = perf_cpu_map__get(pmu->cpus);
for (cpu = 0; cpu < cpus->nr; cpu++) {
for (cpu = 0; cpu < perf_cpu_map__nr(cpus); cpu++) {
scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
sysfs, cpus->map[cpu]);

View File

@@ -5,8 +5,8 @@
#include <libunwind.h>
#include "perf_regs.h"
#include "../../util/unwind.h"
#include "../../util/debug.h"
#endif
#include "../../util/debug.h"
int LIBUNWIND__ARCH_REG_ID(int regnum)
{

View File

@@ -12,7 +12,6 @@
#include <linux/ptrace.h>
#include <linux/kernel.h>
#include <linux/stringify.h>
#include "util.h"
struct pt_regs_dwarfnum {
const char *name;

View File

@@ -6,7 +6,6 @@
#include <string.h>
#include <linux/stringify.h>
#include "header.h"
#include "util.h"
#define mfspr(rn) ({unsigned long rval; \
asm volatile("mfspr %0," __stringify(rn) \

View File

@@ -5,9 +5,11 @@
#include "util/debug.h"
#include "util/evsel.h"
#include "util/evlist.h"
#include "util/pmu.h"
#include "book3s_hv_exits.h"
#include "book3s_hcalls.h"
#include <subcmd/parse-options.h>
#define NR_TPS 4
@@ -172,3 +174,46 @@ int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid __maybe_unused)
return ret;
}
/*
* Incase of powerpc architecture, pmu registers are programmable
* by guest kernel. So monitoring guest via host may not provide
* valid samples with default 'cycles' event. It is better to use
* 'trace_imc/trace_cycles' event for guest profiling, since it
* can track the guest instruction pointer in the trace-record.
*
* Function to parse the arguments and return appropriate values.
*/
int kvm_add_default_arch_event(int *argc, const char **argv)
{
const char **tmp;
bool event = false;
int i, j = *argc;
const struct option event_options[] = {
OPT_BOOLEAN('e', "event", &event, NULL),
OPT_END()
};
tmp = calloc(j + 1, sizeof(char *));
if (!tmp)
return -EINVAL;
for (i = 0; i < j; i++)
tmp[i] = argv[i];
parse_options(j, tmp, event_options, NULL, PARSE_OPT_KEEP_UNKNOWN);
if (!event) {
if (pmu_have_event("trace_imc", "trace_cycles")) {
argv[j++] = strdup("-e");
argv[j++] = strdup("trace_imc/trace_cycles/");
*argc += 2;
} else {
free(tmp);
return -EINVAL;
}
}
free(tmp);
return 0;
}

View File

@@ -13,6 +13,7 @@
#include "util/callchain.h"
#include "util/debug.h"
#include "util/dso.h"
#include "util/event.h" // struct ip_callchain
#include "util/map.h"
#include "util/symbol.h"

View File

@@ -4,7 +4,6 @@
* Copyright (C) 2015 Naveen N. Rao, IBM Corporation
*/
#include "debug.h"
#include "dso.h"
#include "symbol.h"
#include "map.h"

View File

@@ -2,7 +2,7 @@
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include "util.h"
#include "util.h" // page_size
#include "machine.h"
#include "api/fs/fs.h"
#include "debug.h"

View File

@@ -5,7 +5,6 @@
#include "evlist.h"
#include "evsel.h"
#include "arch-tests.h"
#include "util.h"
#include <signal.h>
#include <sys/mman.h>

View File

@@ -15,7 +15,6 @@
#include "evlist.h"
#include "evsel.h"
#include "thread_map.h"
#include "cpumap.h"
#include "record.h"
#include "tsc.h"
#include "tests/tests.h"

View File

@@ -13,7 +13,7 @@
#include "tests/tests.h"
#include "cloexec.h"
#include "event.h"
#include "util.h"
#include "util.h" // page_size
#include "arch-tests.h"
static u64 rdpmc(unsigned int counter)

View File

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "../../../../arch/x86/include/asm/insn.h"
#include "archinsn.h"
#include "event.h"
#include "machine.h"
#include "thread.h"
#include "symbol.h"

View File

@@ -3,6 +3,8 @@
#include <linux/string.h>
#include <linux/zalloc.h>
#include "../../util/event.h"
#include "../../util/synthetic-events.h"
#include "../../util/machine.h"
#include "../../util/tool.h"
#include "../../util/map.h"

View File

@@ -22,7 +22,7 @@
#include "../../util/tsc.h"
#include "../../util/auxtrace.h"
#include "../../util/intel-bts.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#define KiB(x) ((x) * 1024)
#define MiB(x) ((x) * 1024 * 1024)

View File

@@ -26,7 +26,7 @@
#include "../../util/record.h"
#include "../../util/target.h"
#include "../../util/tsc.h"
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/intel-pt.h"
#define KiB(x) ((x) * 1024)

View File

@@ -1,9 +1,10 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/types.h>
#include <linux/string.h>
#include <limits.h>
#include <stdlib.h>
#include "../../util/util.h"
#include "../../util/util.h" // page_size
#include "../../util/machine.h"
#include "../../util/map.h"
#include "../../util/symbol.h"

View File

@@ -8,6 +8,8 @@
#include <linux/types.h>
#include <asm/barrier.h>
#include "../../../util/debug.h"
#include "../../../util/event.h"
#include "../../../util/synthetic-events.h"
#include "../../../util/tsc.h"
int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc,