aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Makefile.config10
-rw-r--r--tools/perf/Makefile.perf2
-rw-r--r--tools/perf/arch/x86/tests/gen-insn-x86-dat.awk2
-rw-r--r--tools/perf/bench/numa.c3
-rw-r--r--tools/perf/perf.h2
-rw-r--r--tools/perf/scripts/python/Perf-Trace-Util/Context.c4
-rw-r--r--tools/perf/tests/attr.c20
-rw-r--r--tools/perf/tests/bp_signal.c2
-rw-r--r--tools/perf/tests/bp_signal_overflow.c2
-rw-r--r--tools/perf/util/annotate.c2
-rw-r--r--tools/perf/util/intel-pt-decoder/gen-insn-attr-x86.awk2
-rw-r--r--tools/perf/util/libunwind/x86_32.c1
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c4
13 files changed, 35 insertions, 21 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index b97e31498ff7..1f1fdc5a0031 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -180,10 +180,10 @@ strip-libs = $(filter-out -l%,$(1))
PYTHON_CONFIG_SQ := $(call shell-sq,$(PYTHON_CONFIG))
ifdef PYTHON_CONFIG
- PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null)
+ PYTHON_EMBED_LDOPTS := $(shell pkg-config --libs python 2>/dev/null)
PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS))
PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil
- PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null)
+ PYTHON_EMBED_CCOPTS := $(shell pkg-config --cflags python 2>/dev/null)
ifeq ($(CC_NO_CLANG), 1)
PYTHON_EMBED_CCOPTS := $(filter-out -specs=%,$(PYTHON_EMBED_CCOPTS))
endif
@@ -548,8 +548,9 @@ ifndef NO_SLANG
msg := $(warning slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev);
NO_SLANG := 1
else
- # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
- CFLAGS += -I/usr/include/slang
+ # Some releases like Fedora have /usr/include/slang/slang.h instead of /usr/include/slang.h
+ SLANG_INC ?= -idirafter =/usr/include/slang
+ CFLAGS += $(SLANG_INC)
CFLAGS += -DHAVE_SLANG_SUPPORT
EXTLIBS += -lslang
$(call detected,CONFIG_SLANG)
@@ -583,6 +584,7 @@ else
FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
ifneq ($(feature-libperl), 1)
+ msg := $(warning libperl not found, disables Perl scripting support. Please install libperl-dev or perl-devel);
CFLAGS += -DNO_LIBPERL
NO_LIBPERL := 1
msg := $(warning Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev);
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 349ea5133d83..8c310cb736aa 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -781,7 +781,7 @@ install-bin: install-tools install-tests install-traceevent-plugins
install: install-bin try-install-man
install-python_ext:
- $(PYTHON_WORD) util/setup.py --quiet install --root='/$(DESTDIR_SQ)'
+ $(PYTHON_WORD) util/setup.py --quiet install --prefix='$(DESTDIR_SQ)/usr'
# 'make install-doc' should call 'make -C Documentation install'
$(INSTALL_DOC_TARGETS):
diff --git a/tools/perf/arch/x86/tests/gen-insn-x86-dat.awk b/tools/perf/arch/x86/tests/gen-insn-x86-dat.awk
index a21454835cd4..2f5e8c99f372 100644
--- a/tools/perf/arch/x86/tests/gen-insn-x86-dat.awk
+++ b/tools/perf/arch/x86/tests/gen-insn-x86-dat.awk
@@ -1,4 +1,4 @@
-#!/bin/awk -f
+#!/usr/bin/awk -f
# gen-insn-x86-dat.awk: script to convert data for the insn-x86 test
# Copyright (c) 2015, Intel Corporation.
#
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 275f1c3c73b6..065fcdb915d7 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -27,6 +27,7 @@
#include <string.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <inttypes.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
@@ -1194,7 +1195,7 @@ static void *worker_thread(void *__tdata)
/* Check whether our max runtime timed out: */
if (g->p.nr_secs) {
timersub(&stop, &start0, &diff);
- if ((u32)diff.tv_sec >= g->p.nr_secs) {
+ if ((u32)diff.tv_sec >= (long int)g->p.nr_secs) {
g->stop_work = true;
break;
}
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index d4ebd0956114..8deb1a6e17c1 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -13,6 +13,8 @@ void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
int fd, int group_fd, unsigned long flags);
+#include <stdbool.h>
+
#define HAVE_ATTR_TEST
#include "perf-sys.h"
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Context.c b/tools/perf/scripts/python/Perf-Trace-Util/Context.c
index fcd1dd667906..43cf40a42bad 100644
--- a/tools/perf/scripts/python/Perf-Trace-Util/Context.c
+++ b/tools/perf/scripts/python/Perf-Trace-Util/Context.c
@@ -19,6 +19,10 @@
*
*/
+#ifdef __mips__
+#include <sgidefs.h>
+#endif
+
#include <Python.h>
#include "../../../perf.h"
#include "../../../util/trace-event.h"
diff --git a/tools/perf/tests/attr.c b/tools/perf/tests/attr.c
index 60fea0a376fc..278f6afdbc53 100644
--- a/tools/perf/tests/attr.c
+++ b/tools/perf/tests/attr.c
@@ -73,7 +73,7 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
return 0;
snprintf(path, PATH_MAX, "%s/event-%d-%llu-%d", dir,
- attr->type, attr->config, fd);
+ attr->type, (unsigned long long)attr->config, fd);
file = fopen(path, "w+");
if (!file) {
@@ -82,7 +82,7 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
}
if (fprintf(file, "[event-%d-%llu-%d]\n",
- attr->type, attr->config, fd) < 0) {
+ attr->type, (unsigned long long)attr->config, fd) < 0) {
perror("test attr - failed to write event file");
fclose(file);
return -1;
@@ -98,10 +98,10 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
/* struct perf_event_attr */
WRITE_ASS(type, PRIu32);
WRITE_ASS(size, PRIu32);
- WRITE_ASS(config, "llu");
- WRITE_ASS(sample_period, "llu");
- WRITE_ASS(sample_type, "llu");
- WRITE_ASS(read_format, "llu");
+ __WRITE_ASS(config, "llu", (unsigned long long)attr->config);
+ __WRITE_ASS(sample_period, "llu", (unsigned long long)attr->sample_period);
+ __WRITE_ASS(sample_type, "llu", (unsigned long long)attr->sample_type);
+ __WRITE_ASS(read_format, "llu", (unsigned long long)attr->read_format);
WRITE_ASS(disabled, "d");
WRITE_ASS(inherit, "d");
WRITE_ASS(pinned, "d");
@@ -126,10 +126,10 @@ static int store_event(struct perf_event_attr *attr, pid_t pid, int cpu,
WRITE_ASS(exclude_callchain_user, "d");
WRITE_ASS(wakeup_events, PRIu32);
WRITE_ASS(bp_type, PRIu32);
- WRITE_ASS(config1, "llu");
- WRITE_ASS(config2, "llu");
- WRITE_ASS(branch_sample_type, "llu");
- WRITE_ASS(sample_regs_user, "llu");
+ __WRITE_ASS(config1, "llu", (unsigned long long)attr->config1);
+ __WRITE_ASS(config2, "llu", (unsigned long long)attr->config2);
+ __WRITE_ASS(branch_sample_type, "llu", (unsigned long long)attr->branch_sample_type);
+ __WRITE_ASS(sample_regs_user, "llu", (unsigned long long)attr->sample_regs_user);
WRITE_ASS(sample_stack_user, PRIu32);
fclose(file);
diff --git a/tools/perf/tests/bp_signal.c b/tools/perf/tests/bp_signal.c
index 335b695f4970..44cad1e8c9e0 100644
--- a/tools/perf/tests/bp_signal.c
+++ b/tools/perf/tests/bp_signal.c
@@ -128,7 +128,7 @@ static int __event(bool is_x, void *addr, int sig)
fd = sys_perf_event_open(&pe, 0, -1, -1,
perf_event_open_cloexec_flag());
if (fd < 0) {
- pr_debug("failed opening event %llx\n", pe.config);
+ pr_debug("failed opening event %llx\n", (unsigned long long)pe.config);
return TEST_FAIL;
}
diff --git a/tools/perf/tests/bp_signal_overflow.c b/tools/perf/tests/bp_signal_overflow.c
index ca962559e845..35e1de86b295 100644
--- a/tools/perf/tests/bp_signal_overflow.c
+++ b/tools/perf/tests/bp_signal_overflow.c
@@ -95,7 +95,7 @@ int test__bp_signal_overflow(struct test *test __maybe_unused, int subtest __may
fd = sys_perf_event_open(&pe, 0, -1, -1,
perf_event_open_cloexec_flag());
if (fd < 0) {
- pr_debug("failed opening event %llx\n", pe.config);
+ pr_debug("failed opening event %llx\n", (unsigned long long)pe.config);
return TEST_FAIL;
}
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 2a8d2a6723f6..e6150f01c885 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1497,7 +1497,7 @@ int symbol__disassemble(struct symbol *sym, struct map *map,
err = asprintf(&command,
"%s %s%s --start-address=0x%016" PRIx64
" --stop-address=0x%016" PRIx64
- " -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s:\"|expand",
+ " -l -d %s %s -C \"%s\" 2>/dev/null|grep -v \"%s:\"|sed 's/\t/ /g'",
objdump_path ? objdump_path : "objdump",
disassembler_style ? "-M " : "",
disassembler_style ? disassembler_style : "",
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 ddd5c4c21129..d236058fc4e2 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,4 @@
-#!/bin/awk -f
+#!/usr/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/libunwind/x86_32.c b/tools/perf/util/libunwind/x86_32.c
index c5e568188e19..d493f96b806d 100644
--- a/tools/perf/util/libunwind/x86_32.c
+++ b/tools/perf/util/libunwind/x86_32.c
@@ -21,6 +21,7 @@
#define LIBUNWIND__ARCH_REG_IP PERF_REG_X86_IP
#define LIBUNWIND__ARCH_REG_SP PERF_REG_X86_SP
+#include <errno.h>
#include "unwind.h"
#include "debug.h"
#include "libunwind-x86.h"
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index f03fa7a835a1..d3bce67a34f7 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -19,6 +19,10 @@
*
*/
+#ifdef __mips__
+#include <sgidefs.h>
+#endif
+
#include <Python.h>
#include <inttypes.h>