diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 23:47:30 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-11 23:47:30 -0500 |
| commit | 6f696eb17be741668810fe1f798135c7cf6733e2 (patch) | |
| tree | f9bcfe5831dfcaaad50ca68d7f04d80d8236fa56 /samples | |
| parent | c4e194e3b71ff4fed01d727c32ee1071921d28a3 (diff) | |
| parent | 125580380f418000b1a06d9a54700f1191b6e561 (diff) | |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (57 commits)
x86, perf events: Check if we have APIC enabled
perf_event: Fix variable initialization in other codepaths
perf kmem: Fix unused argument build warning
perf symbols: perf_header__read_build_ids() offset'n'size should be u64
perf symbols: dsos__read_build_ids() should read both user and kernel buildids
perf tools: Align long options which have no short forms
perf kmem: Show usage if no option is specified
sched: Mark sched_clock() as notrace
perf sched: Add max delay time snapshot
perf tools: Correct size given to memset
perf_event: Fix perf_swevent_hrtimer() variable initialization
perf sched: Fix for getting task's execution time
tracing/kprobes: Fix field creation's bad error handling
perf_event: Cleanup for cpu_clock_perf_event_update()
perf_event: Allocate children's perf_event_ctxp at the right time
perf_event: Clean up __perf_event_init_context()
hw-breakpoints: Modify breakpoints without unregistering them
perf probe: Update perf-probe document
perf probe: Support --del option
trace-kprobe: Support delete probe syntax
...
Diffstat (limited to 'samples')
| -rw-r--r-- | samples/hw_breakpoint/data_breakpoint.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/samples/hw_breakpoint/data_breakpoint.c b/samples/hw_breakpoint/data_breakpoint.c index 29525500df00..c69cbe9b2426 100644 --- a/samples/hw_breakpoint/data_breakpoint.c +++ b/samples/hw_breakpoint/data_breakpoint.c | |||
| @@ -41,7 +41,9 @@ module_param_string(ksym, ksym_name, KSYM_NAME_LEN, S_IRUGO); | |||
| 41 | MODULE_PARM_DESC(ksym, "Kernel symbol to monitor; this module will report any" | 41 | MODULE_PARM_DESC(ksym, "Kernel symbol to monitor; this module will report any" |
| 42 | " write operations on the kernel symbol"); | 42 | " write operations on the kernel symbol"); |
| 43 | 43 | ||
| 44 | static void sample_hbp_handler(struct perf_event *temp, void *data) | 44 | static void sample_hbp_handler(struct perf_event *bp, int nmi, |
| 45 | struct perf_sample_data *data, | ||
| 46 | struct pt_regs *regs) | ||
| 45 | { | 47 | { |
| 46 | printk(KERN_INFO "%s value is changed\n", ksym_name); | 48 | printk(KERN_INFO "%s value is changed\n", ksym_name); |
| 47 | dump_stack(); | 49 | dump_stack(); |
| @@ -51,8 +53,9 @@ static void sample_hbp_handler(struct perf_event *temp, void *data) | |||
| 51 | static int __init hw_break_module_init(void) | 53 | static int __init hw_break_module_init(void) |
| 52 | { | 54 | { |
| 53 | int ret; | 55 | int ret; |
| 54 | DEFINE_BREAKPOINT_ATTR(attr); | 56 | struct perf_event_attr attr; |
| 55 | 57 | ||
| 58 | hw_breakpoint_init(&attr); | ||
| 56 | attr.bp_addr = kallsyms_lookup_name(ksym_name); | 59 | attr.bp_addr = kallsyms_lookup_name(ksym_name); |
| 57 | attr.bp_len = HW_BREAKPOINT_LEN_4; | 60 | attr.bp_len = HW_BREAKPOINT_LEN_4; |
| 58 | attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; | 61 | attr.bp_type = HW_BREAKPOINT_W | HW_BREAKPOINT_R; |
