On Wed, Feb 03, 2010 at 12:09:32PM +0530, Mahesh Salgaonkar wrote: > +static void ptrace_triggered(struct perf_event *bp, int nmi, > + struct perf_sample_data *data, > + struct pt_regs *regs) > +{ > + struct thread_struct *thread = &(current->thread); > + > + thread->ptrace_bps[0] = bp; > +} Hmm, I don't understand what happens here. You only set up the thread->ptrace_bps here? So if it never triggers it will never be freed? Also how do you handle the signal? > + > +static void ptrace_set_breakpoint(struct task_struct *task, int disabled) > +{ > + per_struct *per_info; > + struct perf_event *bp; > + struct thread_struct *t = &task->thread; > + struct perf_event_attr attr; > + > + hw_breakpoint_init(&attr); > + per_info = (per_struct *) &task->thread.per_info; > + > + if (per_info->single_step | per_info->instruction_fetch) > + attr.bp_type = HW_BREAKPOINT_X; > + else if (per_info->storage_alteration) > + attr.bp_type = HW_BREAKPOINT_W; > + else { > + ptrace_remove_breakpoint(task); > + return; > + } > + > + attr.disabled = disabled; > + attr.bp_addr = get_per_addr(per_info); > + attr.bp_len = get_per_len(per_info); > + > + if (!t->ptrace_bps[0]) { > + bp = register_user_hw_breakpoint(&attr, ptrace_triggered, task); > + if (!IS_ERR(bp)) > + t->ptrace_bps[0] = bp; Hmm, and you actually set it up here before. I'm not sure what's the point of doing the same in ptrace_triggered() -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html