aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/events/core.c11
-rw-r--r--kernel/events/hw_breakpoint.c13
-rw-r--r--tools/perf/Makefile.perf14
-rw-r--r--tools/perf/arch/arm64/Makefile5
-rwxr-xr-xtools/perf/arch/arm64/entry/syscalls/mksyscalltbl6
-rw-r--r--tools/perf/arch/powerpc/util/sym-handling.c4
-rw-r--r--tools/perf/arch/x86/include/arch-tests.h1
-rw-r--r--tools/perf/arch/x86/tests/Build1
-rw-r--r--tools/perf/arch/x86/tests/arch-tests.c6
-rw-r--r--tools/perf/arch/x86/tests/bp-modify.c213
-rw-r--r--tools/perf/util/annotate.c32
-rw-r--r--tools/perf/util/annotate.h1
-rw-r--r--tools/perf/util/evsel.c5
-rw-r--r--tools/perf/util/trace-event-info.c2
-rw-r--r--tools/perf/util/trace-event-parse.c7
15 files changed, 282 insertions, 39 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 2a62b96600ad..abaed4f8bb7f 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2867,16 +2867,11 @@ static int perf_event_modify_breakpoint(struct perf_event *bp,
2867 _perf_event_disable(bp); 2867 _perf_event_disable(bp);
2868 2868
2869 err = modify_user_hw_breakpoint_check(bp, attr, true); 2869 err = modify_user_hw_breakpoint_check(bp, attr, true);
2870 if (err) {
2871 if (!bp->attr.disabled)
2872 _perf_event_enable(bp);
2873 2870
2874 return err; 2871 if (!bp->attr.disabled)
2875 }
2876
2877 if (!attr->disabled)
2878 _perf_event_enable(bp); 2872 _perf_event_enable(bp);
2879 return 0; 2873
2874 return err;
2880} 2875}
2881 2876
2882static int perf_event_modify_attr(struct perf_event *event, 2877static int perf_event_modify_attr(struct perf_event *event,
diff --git a/kernel/events/hw_breakpoint.c b/kernel/events/hw_breakpoint.c
index b3814fce5ecb..d6b56180827c 100644
--- a/kernel/events/hw_breakpoint.c
+++ b/kernel/events/hw_breakpoint.c
@@ -509,6 +509,8 @@ modify_user_hw_breakpoint_check(struct perf_event *bp, struct perf_event_attr *a
509 */ 509 */
510int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr) 510int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr)
511{ 511{
512 int err;
513
512 /* 514 /*
513 * modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it 515 * modify_user_hw_breakpoint can be invoked with IRQs disabled and hence it
514 * will not be possible to raise IPIs that invoke __perf_event_disable. 516 * will not be possible to raise IPIs that invoke __perf_event_disable.
@@ -520,15 +522,12 @@ int modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *att
520 else 522 else
521 perf_event_disable(bp); 523 perf_event_disable(bp);
522 524
523 if (!attr->disabled) { 525 err = modify_user_hw_breakpoint_check(bp, attr, false);
524 int err = modify_user_hw_breakpoint_check(bp, attr, false);
525 526
526 if (err) 527 if (!bp->attr.disabled)
527 return err;
528 perf_event_enable(bp); 528 perf_event_enable(bp);
529 bp->attr.disabled = 0; 529
530 } 530 return err;
531 return 0;
532} 531}
533EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint); 532EXPORT_SYMBOL_GPL(modify_user_hw_breakpoint);
534 533
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index b3d1b12a5081..5224ade3d5af 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -777,14 +777,12 @@ endif
777 $(call QUIET_INSTALL, libexec) \ 777 $(call QUIET_INSTALL, libexec) \
778 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 778 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
779ifndef NO_LIBBPF 779ifndef NO_LIBBPF
780 $(call QUIET_INSTALL, lib) \ 780 $(call QUIET_INSTALL, bpf-headers) \
781 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf' 781 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'; \
782 $(call QUIET_INSTALL, include/bpf) \ 782 $(INSTALL) include/bpf/*.h -t '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf'
783 $(INSTALL) include/bpf/*.h '$(DESTDIR_SQ)$(perf_include_instdir_SQ)/bpf' 783 $(call QUIET_INSTALL, bpf-examples) \
784 $(call QUIET_INSTALL, lib) \ 784 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'; \
785 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf' 785 $(INSTALL) examples/bpf/*.c -t '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'
786 $(call QUIET_INSTALL, examples/bpf) \
787 $(INSTALL) examples/bpf/*.c '$(DESTDIR_SQ)$(perf_examples_instdir_SQ)/bpf'
788endif 786endif
789 $(call QUIET_INSTALL, perf-archive) \ 787 $(call QUIET_INSTALL, perf-archive) \
790 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)' 788 $(INSTALL) $(OUTPUT)perf-archive -t '$(DESTDIR_SQ)$(perfexec_instdir_SQ)'
diff --git a/tools/perf/arch/arm64/Makefile b/tools/perf/arch/arm64/Makefile
index f013b115dc86..dbef716a1913 100644
--- a/tools/perf/arch/arm64/Makefile
+++ b/tools/perf/arch/arm64/Makefile
@@ -11,7 +11,8 @@ PERF_HAVE_ARCH_REGS_QUERY_REGISTER_OFFSET := 1
11 11
12out := $(OUTPUT)arch/arm64/include/generated/asm 12out := $(OUTPUT)arch/arm64/include/generated/asm
13header := $(out)/syscalls.c 13header := $(out)/syscalls.c
14sysdef := $(srctree)/tools/include/uapi/asm-generic/unistd.h 14incpath := $(srctree)/tools
15sysdef := $(srctree)/tools/arch/arm64/include/uapi/asm/unistd.h
15sysprf := $(srctree)/tools/perf/arch/arm64/entry/syscalls/ 16sysprf := $(srctree)/tools/perf/arch/arm64/entry/syscalls/
16systbl := $(sysprf)/mksyscalltbl 17systbl := $(sysprf)/mksyscalltbl
17 18
@@ -19,7 +20,7 @@ systbl := $(sysprf)/mksyscalltbl
19_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)') 20_dummy := $(shell [ -d '$(out)' ] || mkdir -p '$(out)')
20 21
21$(header): $(sysdef) $(systbl) 22$(header): $(sysdef) $(systbl)
22 $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(sysdef) > $@ 23 $(Q)$(SHELL) '$(systbl)' '$(CC)' '$(HOSTCC)' $(incpath) $(sysdef) > $@
23 24
24clean:: 25clean::
25 $(call QUIET_CLEAN, arm64) $(RM) $(header) 26 $(call QUIET_CLEAN, arm64) $(RM) $(header)
diff --git a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
index 52e197317d3e..2dbb8cade048 100755
--- a/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
+++ b/tools/perf/arch/arm64/entry/syscalls/mksyscalltbl
@@ -11,7 +11,8 @@
11 11
12gcc=$1 12gcc=$1
13hostcc=$2 13hostcc=$2
14input=$3 14incpath=$3
15input=$4
15 16
16if ! test -r $input; then 17if ! test -r $input; then
17 echo "Could not read input file" >&2 18 echo "Could not read input file" >&2
@@ -28,7 +29,6 @@ create_table_from_c()
28 29
29 cat <<-_EoHEADER 30 cat <<-_EoHEADER
30 #include <stdio.h> 31 #include <stdio.h>
31 #define __ARCH_WANT_RENAMEAT
32 #include "$input" 32 #include "$input"
33 int main(int argc, char *argv[]) 33 int main(int argc, char *argv[])
34 { 34 {
@@ -42,7 +42,7 @@ create_table_from_c()
42 printf "%s\n" " printf(\"#define SYSCALLTBL_ARM64_MAX_ID %d\\n\", __NR_$last_sc);" 42 printf "%s\n" " printf(\"#define SYSCALLTBL_ARM64_MAX_ID %d\\n\", __NR_$last_sc);"
43 printf "}\n" 43 printf "}\n"
44 44
45 } | $hostcc -o $create_table_exe -x c - 45 } | $hostcc -I $incpath/include/uapi -o $create_table_exe -x c -
46 46
47 $create_table_exe 47 $create_table_exe
48 48
diff --git a/tools/perf/arch/powerpc/util/sym-handling.c b/tools/perf/arch/powerpc/util/sym-handling.c
index 20e7d74d86cd..10a44e946f77 100644
--- a/tools/perf/arch/powerpc/util/sym-handling.c
+++ b/tools/perf/arch/powerpc/util/sym-handling.c
@@ -22,15 +22,16 @@ bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
22 22
23#endif 23#endif
24 24
25#if !defined(_CALL_ELF) || _CALL_ELF != 2
26int arch__choose_best_symbol(struct symbol *syma, 25int arch__choose_best_symbol(struct symbol *syma,
27 struct symbol *symb __maybe_unused) 26 struct symbol *symb __maybe_unused)
28{ 27{
29 char *sym = syma->name; 28 char *sym = syma->name;
30 29
30#if !defined(_CALL_ELF) || _CALL_ELF != 2
31 /* Skip over any initial dot */ 31 /* Skip over any initial dot */
32 if (*sym == '.') 32 if (*sym == '.')
33 sym++; 33 sym++;
34#endif
34 35
35 /* Avoid "SyS" kernel syscall aliases */ 36 /* Avoid "SyS" kernel syscall aliases */
36 if (strlen(sym) >= 3 && !strncmp(sym, "SyS", 3)) 37 if (strlen(sym) >= 3 && !strncmp(sym, "SyS", 3))
@@ -41,6 +42,7 @@ int arch__choose_best_symbol(struct symbol *syma,
41 return SYMBOL_A; 42 return SYMBOL_A;
42} 43}
43 44
45#if !defined(_CALL_ELF) || _CALL_ELF != 2
44/* Allow matching against dot variants */ 46/* Allow matching against dot variants */
45int arch__compare_symbol_names(const char *namea, const char *nameb) 47int arch__compare_symbol_names(const char *namea, const char *nameb)
46{ 48{
diff --git a/tools/perf/arch/x86/include/arch-tests.h b/tools/perf/arch/x86/include/arch-tests.h
index c1bd979b957b..613709cfbbd0 100644
--- a/tools/perf/arch/x86/include/arch-tests.h
+++ b/tools/perf/arch/x86/include/arch-tests.h
@@ -9,6 +9,7 @@ struct test;