Things still look a bit fishy to me.
In apic.c:
int prof_multiplier[NR_CPUS] = { 1, };
int prof_old_multiplier[NR_CPUS] = { 1, };
DEFINE_PER_CPU(int, prof_counter) = 1;
This means that all the prof_counter values are set to 1, but the multiplier
arrays have 1 in the zeroeth entry, and zero in the remaining entries.
The zero multipliers remain in place until someone runs
setup_profiling_timer().
One approach would be to initialise all members:
int prof_multiplier[NR_CPUS] = { [ 0 ... NR_CPUS-1 ] = 1 };
But I think it would be better to put the multipliers into per-cpu memory as
well. Something like:
struct profiling_info {
int multiplier;
int old_multiplier;
int counter;
};
DEFINE_PER_CPU(struct profiling_info, profiling_info) = {1, 1, 1};
Perhaps?
Also bits and pieces of the profiling code seem to be randomly splattered all
over the place. Consolidating it all into the one .c file would be nice.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/