Re: [PATCH 2/5] ftrace: use code patching for ftrace graph tracer



On Wed, 26 Nov 2008 00:27:04 -0800 Harvey Harrison <harvey.harrison@xxxxxxxxx> wrote:

if (code[0] != 0xe9 || old_offset != load32_noalign(&code[1]))

This is similar to the new API in -mm load_le32_noalign, but I
don't think it would be worth load_u32_noalign...load32 should
be enough.

+ return -EINVAL;
+
+ *(int *)(&code[1]) = new_offset;

Might be able to use put_unaligned_foo() here.


put_unaligned(new_offset, (int *)(&code[1]));


In a similar vein to above, this becomes:

store32_noalign(&code[1], new_offset);


yes, that's much better than the party tricks with magical sizeof,
which forces you to run around and check the types of everything.

I've seen people doing get_user() on `long' types and such things
occasionally.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: LKML Summary Podcast
    ... to date with the last two week's worth of episodes and expect to do a ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] sound/ad1848: fix printk format
    ... Some patches are really ... worth to be in 2.6.24. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] isp1760: Flush the D-cache for the pipe-in transfer buffers
    ... maybe trying to define something like a pio_* ... API would work better. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: VIA IRQ quirk missing PCI ids since 2.6.16.17
    ... When it gets moved to the PCI layer, I wonder if it'd be worth ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] Fix SH DMA API so it works with PVR cascade
    ... API to work properly for the PVR2 DMA cascade. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)