git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hw-breakpoints: Use struct perf_event_attr to define kernel breakpoints
[safe/jmp/linux-2.6]
/
samples
/
hw_breakpoint
/
data_breakpoint.c
diff --git
a/samples/hw_breakpoint/data_breakpoint.c
b/samples/hw_breakpoint/data_breakpoint.c
index
ee7f9fb
..
2952550
100644
(file)
--- a/
samples/hw_breakpoint/data_breakpoint.c
+++ b/
samples/hw_breakpoint/data_breakpoint.c
@@
-51,13
+51,13
@@
static void sample_hbp_handler(struct perf_event *temp, void *data)
static int __init hw_break_module_init(void)
{
int ret;
static int __init hw_break_module_init(void)
{
int ret;
-
unsigned long addr
;
+
DEFINE_BREAKPOINT_ATTR(attr)
;
- addr = kallsyms_lookup_name(ksym_name);
+ attr.bp_addr = kallsyms_lookup_name(ksym_name);
+ attr.bp_len = HW_BREAKPOINT_LEN_4;
+ attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R;
- sample_hbp = register_wide_hw_breakpoint(addr, HW_BREAKPOINT_LEN_4,
- HW_BREAKPOINT_W | HW_BREAKPOINT_R,
- sample_hbp_handler, true);
+ sample_hbp = register_wide_hw_breakpoint(&attr, sample_hbp_handler);
if (IS_ERR(sample_hbp)) {
ret = PTR_ERR(sample_hbp);
goto fail;
if (IS_ERR(sample_hbp)) {
ret = PTR_ERR(sample_hbp);
goto fail;