Rafael.Vanoni wrote: >>>>> - since this routines is called at every interval, >>>>> wouldn't it make >>>>> sense to use have a turbo_info_t t_new, as opposed to >>>>> allocating/freeing it all the time? >>>> That's a good suggestion, but the current implementation makes the >>>> powertop.c cleaner, since we don't clobber it too much. Otherwise >>>> you have to add a variable to it. >>> I was suggesting making it a local variable to >>> pt_turbo_stat_collect(). >>> I don't see how that would clobber powertop.c.. am I missing >>> something ? >> >> It should be an array. How do you define its size? the size should >> be the number of cpus. Dynamical size is better here, I think. > > How about making a static pointer inside turbo.c and > allocating it once > during pt_turbo_init()? I'm trying to avoid alloc'ing and free'ing it > every time we take a snapshot. > > Thanks, > Rafael >
Better idea, I'll do the change, thanks! -Aubrey
