config: convert 'summary_interval' to the new scheme.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2015-08-15 14:24:33 +02:00
parent 2816133b5e
commit f2da3cc484
4 changed files with 2 additions and 9 deletions

View File

@ -882,7 +882,7 @@ struct clock *clock_create(struct config *config, int phc_index,
return NULL;
}
c->nrr = 1.0;
c->stats_interval = dds->stats_interval;
c->stats_interval = config_get_int(config, NULL, "summary_interval");
c->stats.offset = stats_create();
c->stats.freq = stats_create();
c->stats.delay = stats_create();

View File

@ -123,6 +123,7 @@ struct config_item config_tab[] = {
GLOB_ITEM_DBL("pi_proportional_norm_max", 0.7, DBL_MIN, 1.0),
GLOB_ITEM_DBL("pi_proportional_scale", 0.0, 0.0, DBL_MAX),
GLOB_ITEM_DBL("step_threshold", 0.0, 0.0, DBL_MAX),
GLOB_ITEM_INT("summary_interval", 0, INT_MIN, INT_MAX),
PORT_ITEM_INT("syncReceiptTimeout", 0, 0, UINT8_MAX),
PORT_ITEM_INT("transportSpecific", 0, 0, 0x0F),
GLOB_ITEM_INT("tx_timestamp_timeout", 1, 1, INT_MAX),
@ -552,12 +553,6 @@ static enum parser_result parse_global_setting(const char *option,
for (i = 0; i < OUI_LEN; i++)
cfg->dds.clock_desc.manufacturerIdentity[i] = oui[i];
} else if (!strcmp(option, "summary_interval")) {
r = get_ranged_int(value, &val, INT_MIN, INT_MAX);
if (r != PARSED_OK)
return r;
cfg->dds.stats_interval = val;
} else if (!strcmp(option, "kernel_leap")) {
r = get_ranged_int(value, &val, 0, 1);
if (r != PARSED_OK)

1
ds.h
View File

@ -52,7 +52,6 @@ struct clock_description {
struct default_ds {
struct defaultDS dds;
int stats_interval; /*log seconds*/
int kernel_leap;
int sanity_freq_limit;
int time_source;

View File

@ -52,7 +52,6 @@ static struct config cfg_settings = {
.priority2 = 128,
.domainNumber = 0,
},
.stats_interval = 0,
.kernel_leap = 1,
.sanity_freq_limit = 200000000,
.time_source = INTERNAL_OSCILLATOR,