Lines Matching refs:bp
73 static void ptrace_hbptriggered(struct perf_event *bp, in ptrace_hbptriggered() argument
77 struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp); in ptrace_hbptriggered()
92 if (current->thread.debug.hbp_break[i] == bp) { in ptrace_hbptriggered()
99 if (current->thread.debug.hbp_watch[i] == bp) { in ptrace_hbptriggered()
143 struct perf_event *bp = ERR_PTR(-EINVAL); in ptrace_hbp_get_event() local
148 bp = tsk->thread.debug.hbp_break[idx]; in ptrace_hbp_get_event()
152 bp = tsk->thread.debug.hbp_watch[idx]; in ptrace_hbp_get_event()
156 return bp; in ptrace_hbp_get_event()
162 struct perf_event *bp) in ptrace_hbp_set_event() argument
169 tsk->thread.debug.hbp_break[idx] = bp; in ptrace_hbp_set_event()
175 tsk->thread.debug.hbp_watch[idx] = bp; in ptrace_hbp_set_event()
188 struct perf_event *bp; in ptrace_hbp_create() local
214 bp = register_user_hw_breakpoint(&attr, ptrace_hbptriggered, NULL, tsk); in ptrace_hbp_create()
215 if (IS_ERR(bp)) in ptrace_hbp_create()
216 return bp; in ptrace_hbp_create()
218 err = ptrace_hbp_set_event(note_type, tsk, idx, bp); in ptrace_hbp_create()
222 return bp; in ptrace_hbp_create()
287 struct perf_event *bp = ptrace_hbp_get_event(note_type, tsk, idx); in ptrace_hbp_get_ctrl() local
289 if (IS_ERR(bp)) in ptrace_hbp_get_ctrl()
290 return PTR_ERR(bp); in ptrace_hbp_get_ctrl()
292 *ctrl = bp ? encode_ctrl_reg(counter_arch_bp(bp)->ctrl) : 0; in ptrace_hbp_get_ctrl()
301 struct perf_event *bp = ptrace_hbp_get_event(note_type, tsk, idx); in ptrace_hbp_get_addr() local
303 if (IS_ERR(bp)) in ptrace_hbp_get_addr()
304 return PTR_ERR(bp); in ptrace_hbp_get_addr()
306 *addr = bp ? bp->attr.bp_addr : 0; in ptrace_hbp_get_addr()
314 struct perf_event *bp = ptrace_hbp_get_event(note_type, tsk, idx); in ptrace_hbp_get_initialised_bp() local
316 if (!bp) in ptrace_hbp_get_initialised_bp()
317 bp = ptrace_hbp_create(note_type, tsk, idx); in ptrace_hbp_get_initialised_bp()
319 return bp; in ptrace_hbp_get_initialised_bp()
328 struct perf_event *bp; in ptrace_hbp_set_ctrl() local
332 bp = ptrace_hbp_get_initialised_bp(note_type, tsk, idx); in ptrace_hbp_set_ctrl()
333 if (IS_ERR(bp)) { in ptrace_hbp_set_ctrl()
334 err = PTR_ERR(bp); in ptrace_hbp_set_ctrl()
338 attr = bp->attr; in ptrace_hbp_set_ctrl()
344 return modify_user_hw_breakpoint(bp, &attr); in ptrace_hbp_set_ctrl()
353 struct perf_event *bp; in ptrace_hbp_set_addr() local
356 bp = ptrace_hbp_get_initialised_bp(note_type, tsk, idx); in ptrace_hbp_set_addr()
357 if (IS_ERR(bp)) { in ptrace_hbp_set_addr()
358 err = PTR_ERR(bp); in ptrace_hbp_set_addr()
362 attr = bp->attr; in ptrace_hbp_set_addr()
364 err = modify_user_hw_breakpoint(bp, &attr); in ptrace_hbp_set_addr()