/* Walk through every ptrace breakpoints for this thread and build the dr7 value on top of their attributes.  */
static unsigned long ptrace_get_dr7(struct perf_event *bp[])
/* Walk through every ptrace breakpoints for this thread and build the dr7 value on top of their attributes.  */
static unsigned long ptrace_get_dr7(struct perf_event *bp[])
{
	int i;
	int dr7 = 0;
	struct arch_hw_breakpoint *info;
	for (i = 0; i < HBP_NUM; i++) {
		if (bp[i] && !bp[i]->attr.disabled) {
			info = counter_arch_bp(bp[i]);
			dr7 |= encode_dr7(i, info->len, info->type);
		}
	}
	return dr7;
}