Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\hw_breakpoint.c Create Date:2022-07-28 07:45:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Install a perf counter breakpoint.* We seek a free debug address register and use it for this* breakpoint. Eventually we enable it in the debug control register.* Atomic: we hold the counter->ctx->lock and we only handle variables

Proto:int arch_install_hw_breakpoint(struct perf_event *bp)

Type:int

Parameter:

TypeParameterName
struct perf_event *bp
96  info = counter_arch_bp(bp)
100  When i < Total number of available HW breakpoint registers cycle
101  slot = this_cpu_ptr( & Stores the breakpoints currently in use on each breakpoint address* register for each cpus[i])
103  If Not slot Then
104  slot = bp
105  Break
109  If WARN_ONCE(i == Total number of available HW breakpoint registers , "Can't find any breakpoint slot") Then Return -EBUSY
112  set_debugreg(address, i)
113  __this_cpu_write(Per cpu debug address registers values [i], address)
115  dr7 = this_cpu_ptr( & Per cpu debug control register value )
116  dr7 |= Encode the length, type, Exact, and Enable bits for a particular breakpoint* as stored in debug register 7.
118  set_debugreg( * dr7, 7)
119  If mask Then set_dr_addr_mask(mask, i)
122  Return 0
Caller
NameDescribe
kgdb_correct_hw_break