[ltt-dev] [PATCH] LTTng optimize write to page function

KOSAKI Motohiro kosaki.motohiro at jp.fujitsu.com
Tue Feb 3 23:34:46 EST 2009


Hi

> +static inline void ltt_relay_do_copy(void *dest, const void *src, size_t len)
> +{
> +	switch (len) {
> +	case 1:	*(u8 *)dest = *(const u8 *)src;
> +		break;
> +	case 2:	*(u16 *)dest = *(const u16 *)src;
> +		break;
> +	case 4:	*(u32 *)dest = *(const u32 *)src;
> +		break;
> +#if (BITS_PER_LONG == 64)
> +	case 8:	*(u64 *)dest = *(const u64 *)src;
> +		break;
> +#endif
> +	default:
> +		memcpy(dest, src, len);
> +	}
> +}

hm, interesting.

IIRC, few month ago, linus said this optimization is not optimazation.
lastest gcc does this inlining automatically.
(but I can't point its url, sorry)

Is this result gcc version independent? and can you send
the difference of gcc assembly outout?






More information about the lttng-dev mailing list