diff options
Diffstat (limited to 'kernel/hw_breakpoint.c')
| -rw-r--r-- | kernel/hw_breakpoint.c | 29 | 
1 files changed, 27 insertions, 2 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index e9c5cfa1fd2..6f150095caf 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c @@ -586,10 +586,35 @@ static int hw_breakpoint_event_init(struct perf_event *bp)  	return 0;  } +static int hw_breakpoint_add(struct perf_event *bp, int flags) +{ +	if (!(flags & PERF_EF_START)) +		bp->hw.state = PERF_HES_STOPPED; + +	return arch_install_hw_breakpoint(bp); +} + +static void hw_breakpoint_del(struct perf_event *bp, int flags) +{ +	arch_uninstall_hw_breakpoint(bp); +} + +static void hw_breakpoint_start(struct perf_event *bp, int flags) +{ +	bp->hw.state = 0; +} + +static void hw_breakpoint_stop(struct perf_event *bp, int flags) +{ +	bp->hw.state = PERF_HES_STOPPED; +} +  static struct pmu perf_breakpoint = {  	.event_init	= hw_breakpoint_event_init, -	.enable		= arch_install_hw_breakpoint, -	.disable	= arch_uninstall_hw_breakpoint, +	.add		= hw_breakpoint_add, +	.del		= hw_breakpoint_del, +	.start		= hw_breakpoint_start, +	.stop		= hw_breakpoint_stop,  	.read		= hw_breakpoint_pmu_read,  };  |