From: Alexander Aring Date: Thu, 2 Mar 2023 12:14:35 -0500 Subject: [Cluster-devel] [PATCH dlm-tool 08/14] dlm_controld: enable nanosec logging In-Reply-To: <20230302171441.1509914-1-aahringo@redhat.com> References: <20230302171441.1509914-1-aahringo@redhat.com> Message-ID: <20230302171441.1509914-8-aahringo@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Current scope of logging are the seconds since dlm_controld started. This patch adds nanosecond scope which are requested from the os anyway. --- dlm_controld/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlm_controld/main.c b/dlm_controld/main.c index 8e8d4038..fdfebd1f 100644 --- a/dlm_controld/main.c +++ b/dlm_controld/main.c @@ -128,11 +128,13 @@ int do_write(int fd, void *buf, size_t count) return 0; } +enum { NS_PER_SECOND = 1000000000 }; + uint64_t monotime(void) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return ts.tv_sec; + return (ts.tv_sec * NS_PER_SECOND) + ts.tv_nsec; } static void client_alloc(void) -- 2.31.1