From 77f9c721963e764ec1b23016f35d15f6cdd2eefe Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 1 Jan 2022 18:51:47 +0000 Subject: [PATCH] Fix some debug messages. --- nqptp-clock-sources.c | 2 +- nqptp-message-handlers.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/nqptp-clock-sources.c b/nqptp-clock-sources.c index 4274e48..ef41700 100644 --- a/nqptp-clock-sources.c +++ b/nqptp-clock-sources.c @@ -526,7 +526,7 @@ void update_master(int client_id) { // no master clock // if (old_master != -1) { // but there was a master clock, so remove it - debug(1, "Remove master clock information from interface %s.", get_client_name(client_id)); + debug(2, "Remove master clock information from interface %s.", get_client_name(client_id)); update_master_clock_info(client_id, 0, NULL, 0, 0, 0); //} if (timing_peer_count == 0) diff --git a/nqptp-message-handlers.c b/nqptp-message-handlers.c index acdf684..6e2dce2 100644 --- a/nqptp-message-handlers.c +++ b/nqptp-message-handlers.c @@ -93,7 +93,6 @@ void handle_control_port_messages(char *buf, ssize_t recv_len, if (t == -1) t = create_clock_source_record(new_ip, clock_private_info); if (t != -1) { // if the clock table is not full, show it's a timing peer - clock_private_info[t].flags |= (1 << clock_is_a_timing_peer); clock_private_info[t].client_flags[client_id] |= (1 << clock_is_a_timing_peer); } // otherwise, drop it @@ -274,19 +273,18 @@ void handle_announce(char *buf, ssize_t recv_len, clock_source_private_data *clo if ((clock_private_info->client_flags[temp_client_id] & (1 << clock_is_a_timing_peer)) != 0) { debug(1, - "clock_is_qualified %" PRIx64 - " at %s -- updating clock mastership for client \"%s\"", + "best_clock_update_needed because %" PRIx64 + "%s has changed -- updating clock mastership for client \"%s\"", clock_private_info->clock_id, clock_private_info->ip, get_client_name(temp_client_id)); update_master(temp_client_id); } } - update_master(0); // TODO -- won't be needed } } else { if ((clock_private_info->flags & (1 << clock_is_qualified)) != 0) // if it was qualified, but now isn't - debug(2, + debug(1, "clock_id %" PRIx64 " on ip: %s \"Announce\" message is not Qualified -- See 9.3.2.5.", clock_private_info->clock_id, clock_private_info->ip); @@ -357,7 +355,7 @@ void handle_follow_up(char *buf, __attribute__((unused)) ssize_t recv_len, for (temp_client_id = 0; temp_client_id < MAX_CLIENTS; temp_client_id++) { if ((clock_private_info->client_flags[temp_client_id] & (1 << clock_is_becoming_master)) != 0) { - debug(1, + debug(2, "clock_is_becoming_master %" PRIx64 " at %s -- changing to clock_is_master for client \"%s\"", clock_private_info->clock_id, clock_private_info->ip, @@ -428,7 +426,7 @@ void handle_follow_up(char *buf, __attribute__((unused)) ssize_t recv_len, } if ((clock_is_a_master_somewhere != 0) && (clock_private_info->last_sync_time == 0)) - debug(1, "Synchronising master clock %" PRIx64 " at %s.", clock_private_info->clock_id, + debug(2, "Synchronising master clock %" PRIx64 " at %s.", clock_private_info->clock_id, clock_private_info->ip); if ((clock_is_a_master_somewhere != 0) && (clock_private_info->last_sync_time != 0)) debug(1, "Resynchronising master clock %" PRIx64 " at %s.", clock_private_info->clock_id, -- 2.47.2