sources: improve debug messages
Print source status as char and print the name instead of index in combining.
This commit is contained in:
parent
55717c1ccd
commit
f2e341b5ed
1 changed files with 7 additions and 5 deletions
12
sources.c
12
sources.c
|
@ -189,6 +189,7 @@ static void slew_sources(struct timespec *raw, struct timespec *cooked, double d
|
||||||
double doffset, LCL_ChangeType change_type, void *anything);
|
double doffset, LCL_ChangeType change_type, void *anything);
|
||||||
static void add_dispersion(double dispersion, void *anything);
|
static void add_dispersion(double dispersion, void *anything);
|
||||||
static char *source_to_string(SRC_Instance inst);
|
static char *source_to_string(SRC_Instance inst);
|
||||||
|
static char get_status_char(SRC_Status status);
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* Initialisation function */
|
/* Initialisation function */
|
||||||
|
@ -642,9 +643,10 @@ mark_source(SRC_Instance inst, SRC_Status status)
|
||||||
{
|
{
|
||||||
inst->status = status;
|
inst->status = status;
|
||||||
|
|
||||||
DEBUG_LOG("%s status=%d options=%x reach=%o/%d updates=%d distant=%d leap=%d vote=%d lo=%f hi=%f",
|
DEBUG_LOG("%s status=%c options=%x reach=%o/%d updates=%d distant=%d leap=%d vote=%d lo=%f hi=%f",
|
||||||
source_to_string(inst), (int)inst->status, (unsigned int)inst->sel_options,
|
source_to_string(inst), get_status_char(inst->status),
|
||||||
(unsigned int)inst->reachability, inst->reachability_size, inst->updates,
|
(unsigned int)inst->sel_options, (unsigned int)inst->reachability,
|
||||||
|
inst->reachability_size, inst->updates,
|
||||||
inst->distant, (int)inst->leap, inst->leap_vote,
|
inst->distant, (int)inst->leap, inst->leap_vote,
|
||||||
inst->sel_info.lo_limit, inst->sel_info.hi_limit);
|
inst->sel_info.lo_limit, inst->sel_info.hi_limit);
|
||||||
}
|
}
|
||||||
|
@ -723,8 +725,8 @@ combine_sources(int n_sel_sources, struct timespec *ref_time, double *offset,
|
||||||
offset_weight = 1.0 / sources[index]->sel_info.root_distance;
|
offset_weight = 1.0 / sources[index]->sel_info.root_distance;
|
||||||
frequency_weight = 1.0 / SQUARE(src_frequency_sd);
|
frequency_weight = 1.0 / SQUARE(src_frequency_sd);
|
||||||
|
|
||||||
DEBUG_LOG("combining index=%d oweight=%e offset=%e osd=%e fweight=%e freq=%e fsd=%e skew=%e",
|
DEBUG_LOG("combining %s oweight=%e offset=%e osd=%e fweight=%e freq=%e fsd=%e skew=%e",
|
||||||
index, offset_weight, src_offset, src_offset_sd,
|
source_to_string(sources[index]), offset_weight, src_offset, src_offset_sd,
|
||||||
frequency_weight, src_frequency, src_frequency_sd, src_skew);
|
frequency_weight, src_frequency, src_frequency_sd, src_skew);
|
||||||
|
|
||||||
sum_offset_weight += offset_weight;
|
sum_offset_weight += offset_weight;
|
||||||
|
|
Loading…
Reference in a new issue