Re: [PATCH] Make modules work in Linus' tree on ARM

From: Linus Torvalds
Date: Thu Aug 14 2003 - 12:25:21 EST



On 14 Aug 2003, Alan Cox wrote:
>
> And why can't you put the pointer size at the start of the buffer ?

Historical aside: this was pretty much _exactly_ the bug that we used to
have in the old style timer tick profiler: it was impossible to figure out
what the "profile shift" value was. So you got a series of "unsigned int"
counts, but you didn't know what the granularity was for the hit counting.

That was fixed by just making read_profile() return the sample step size
as the first word. See

fs/proc/proc_misc.c: read_profile()

and note the small

while (p < sizeof(unsigned int) && count > 0) {
put_user(*((char *)(&sample_step)+p),buf);
buf++; p++; count--; read++;
}

loop (and a few "+1" things for adjusting size comparisons).

Linus

-
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/