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

Linus Torvalds
2003-08-14T17:19:28Z

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