[PATCH v3 3/9] powerpc/kprobes/optprobes: Move over to patch_instruction

Balbir Singh bsingharora at gmail.com
Wed Jun 7 15:46:05 AEST 2017


On Wed, 2017-06-07 at 00:42 +0530, Naveen N. Rao wrote:
> On 2017/06/06 02:29PM, Balbir Singh wrote:
> > With text moving to read-only migrate optprobes to using
> > the patch_instruction infrastructure. Without this optprobes
> > will fail and complain.
> > 
<snip>
> > +	/* We can optimize this via patch_instruction_window later */
> 
> This probably needs a TODO just so it's clear. I do think this would be 
> good to add since we copy many instructions while setting up the 
> optprobe, so this is quite slow as it exists today.

I made it read like a TODO, with a TOOD:

> 
> > +	size = (TMPL_END_IDX * sizeof(kprobe_opcode_t)) / sizeof(int);
> 
> That's just TMPL_END_IDX.
>

The entire kprobe_opcode_t and int types thing is a bit messy. The size
calculation assumes nothing for now in terms of sizes, but I guess the
patch_instruction does. Another TODO?

Thanks for the review
Balbir Singh.



More information about the Linuxppc-dev mailing list