You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the collected parameters count exceeds a certain size, powertop stops collecting data.
The compile time constants below, defined in parameters.h
#define MAX_KEEP 700
#define MAX_PARAM 750
are used in persistent.ccp in void load_results(const char *filename)
to limit the amount of results loaded into "past_results"
overflow_index = 50 + (rand() % MAX_KEEP);
if (past_results.size() >= MAX_PARAM) {
/* memory leak, must free old one first */
past_results[overflow_index] = bundle;
} else {
past_results.push_back(bundle);
}
However, in parameters.cpp in int global_power_valid(void)
there is a condition which dynamically defines the desired number of measurements as a function of parameters size:
if (past_results.size() > 3 * all_parameters.parameters.size())
return 1;
without any consideration for the relation between MAX_PARAM and the calculated value.
Potential fixes:
accept MAX_PARAM measurements regardless of the parameter count
if (past_results.size() > min(3 * all_parameters.parameters.size(), MAX_PARAM-1))
return 1;
or increase the storage limits to
#define MAX_KEEP 974
#define MAX_PARAM 1024
This last approach allows powertop to finish its data collection and continue normally on my test platform where
the number of measurements needed is displayed as 907.
or any other approach which takes into account the relationship illustrated above.
The text was updated successfully, but these errors were encountered:
When the collected parameters count exceeds a certain size, powertop stops collecting data.
The compile time constants below, defined in parameters.h
are used in persistent.ccp in
void load_results(const char *filename)
to limit the amount of results loaded into "past_results"
However, in parameters.cpp in
int global_power_valid(void)
there is a condition which dynamically defines the desired number of measurements as a function of parameters size:
without any consideration for the relation between MAX_PARAM and the calculated value.
Potential fixes:
This last approach allows powertop to finish its data collection and continue normally on my test platform where
the number of measurements needed is displayed as 907.
The text was updated successfully, but these errors were encountered: