-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'tracing/hw-breakpoints' into perf/core
Conflicts: arch/x86/kernel/kprobes.c kernel/trace/Makefile Merge reason: hw-breakpoints perf integration is looking good in testing and in reviews, plus conflicts are mounting up - so merge & resolve. Signed-off-by: Ingo Molnar <mingo@elte.hu>
- Loading branch information
Showing
39 changed files
with
2,512 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#ifndef _I386_HW_BREAKPOINT_H | ||
#define _I386_HW_BREAKPOINT_H | ||
|
||
#ifdef __KERNEL__ | ||
#define __ARCH_HW_BREAKPOINT_H | ||
|
||
/* | ||
* The name should probably be something dealt in | ||
* a higher level. While dealing with the user | ||
* (display/resolving) | ||
*/ | ||
struct arch_hw_breakpoint { | ||
char *name; /* Contains name of the symbol to set bkpt */ | ||
unsigned long address; | ||
u8 len; | ||
u8 type; | ||
}; | ||
|
||
#include <linux/kdebug.h> | ||
#include <linux/percpu.h> | ||
#include <linux/list.h> | ||
|
||
/* Available HW breakpoint length encodings */ | ||
#define X86_BREAKPOINT_LEN_1 0x40 | ||
#define X86_BREAKPOINT_LEN_2 0x44 | ||
#define X86_BREAKPOINT_LEN_4 0x4c | ||
#define X86_BREAKPOINT_LEN_EXECUTE 0x40 | ||
|
||
#ifdef CONFIG_X86_64 | ||
#define X86_BREAKPOINT_LEN_8 0x48 | ||
#endif | ||
|
||
/* Available HW breakpoint type encodings */ | ||
|
||
/* trigger on instruction execute */ | ||
#define X86_BREAKPOINT_EXECUTE 0x80 | ||
/* trigger on memory write */ | ||
#define X86_BREAKPOINT_WRITE 0x81 | ||
/* trigger on memory read or write */ | ||
#define X86_BREAKPOINT_RW 0x83 | ||
|
||
/* Total number of available HW breakpoint registers */ | ||
#define HBP_NUM 4 | ||
|
||
struct perf_event; | ||
struct pmu; | ||
|
||
extern int arch_check_va_in_userspace(unsigned long va, u8 hbp_len); | ||
extern int arch_validate_hwbkpt_settings(struct perf_event *bp, | ||
struct task_struct *tsk); | ||
extern int hw_breakpoint_exceptions_notify(struct notifier_block *unused, | ||
unsigned long val, void *data); | ||
|
||
|
||
int arch_install_hw_breakpoint(struct perf_event *bp); | ||
void arch_uninstall_hw_breakpoint(struct perf_event *bp); | ||
void hw_breakpoint_pmu_read(struct perf_event *bp); | ||
void hw_breakpoint_pmu_unthrottle(struct perf_event *bp); | ||
|
||
extern void | ||
arch_fill_perf_breakpoint(struct perf_event *bp); | ||
|
||
unsigned long encode_dr7(int drnum, unsigned int len, unsigned int type); | ||
int decode_dr7(unsigned long dr7, int bpnum, unsigned *len, unsigned *type); | ||
|
||
extern int arch_bp_generic_fields(int x86_len, int x86_type, | ||
int *gen_len, int *gen_type); | ||
|
||
extern struct pmu perf_ops_bp; | ||
|
||
#endif /* __KERNEL__ */ | ||
#endif /* _I386_HW_BREAKPOINT_H */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.