Blame SOURCES/kexec-tools-2.0.15-makedumpfile-Use-monotonic-clock-to-calculate-ETA-and-s.patch

cf4a81
From 0f4e25c5d7c031201fa7ad384cd9562b9c9c6004 Mon Sep 17 00:00:00 2001
cf4a81
From: Petr Tesarik <ptesarik@suse.com>
cf4a81
Date: Wed, 20 Jun 2018 11:50:18 +0200
cf4a81
Subject: [PATCH 1/2] [PATCH 1/2] Use monotonic clock to calculate ETA and
cf4a81
 stats
cf4a81
cf4a81
Execution time should be always measured by a monotonic clock,
cf4a81
because the system clock may be affected by discontinuous jumps,
cf4a81
e.g. when time is set manually by an admin.
cf4a81
cf4a81
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
cf4a81
---
cf4a81
 makedumpfile.c | 84 +++++++++++++++++++++++++++++-----------------------------
cf4a81
 print_info.c   | 30 +++++++++++----------
cf4a81
 print_info.h   |  6 ++---
cf4a81
 3 files changed, 61 insertions(+), 59 deletions(-)
cf4a81
cf4a81
diff --git a/makedumpfile-1.6.2/makedumpfile.c b/makedumpfile-1.6.2/makedumpfile.c
cf4a81
index 1ed3d61..abe7a2b 100644
cf4a81
--- a/makedumpfile-1.6.2/makedumpfile.c
cf4a81
+++ b/makedumpfile-1.6.2/makedumpfile.c
cf4a81
@@ -5364,7 +5364,7 @@ _exclude_free_page(struct cycle *cycle)
cf4a81
 {
cf4a81
 	int i, nr_zones, num_nodes, node;
cf4a81
 	unsigned long node_zones, zone, spanned_pages, pgdat;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 
cf4a81
 	if ((node = next_online_node(0)) < 0) {
cf4a81
 		ERRMSG("Can't get next online node.\n");
cf4a81
@@ -5374,7 +5374,7 @@ _exclude_free_page(struct cycle *cycle)
cf4a81
 		ERRMSG("Can't get pgdat list.\n");
cf4a81
 		return FALSE;
cf4a81
 	}
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	for (num_nodes = 1; num_nodes <= vt.numnodes; num_nodes++) {
cf4a81
 
cf4a81
@@ -5420,7 +5420,7 @@ _exclude_free_page(struct cycle *cycle)
cf4a81
 	 * print [100 %]
cf4a81
 	 */
cf4a81
 	print_progress(PROGRESS_FREE_PAGES, vt.numnodes, vt.numnodes, NULL);
cf4a81
-	print_execution_time(PROGRESS_FREE_PAGES, &tv_start);
cf4a81
+	print_execution_time(PROGRESS_FREE_PAGES, &ts_start);
cf4a81
 
cf4a81
 	return TRUE;
cf4a81
 }
cf4a81
@@ -5567,7 +5567,7 @@ create_1st_bitmap_file(void)
cf4a81
  	char buf[info->page_size];
cf4a81
 	mdf_pfn_t pfn, pfn_start, pfn_end, pfn_bitmap1;
cf4a81
 	unsigned long long phys_start, phys_end;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 	off_t offset_page;
cf4a81
 
cf4a81
 	if (info->flag_refiltering)
cf4a81
@@ -5597,7 +5597,7 @@ create_1st_bitmap_file(void)
cf4a81
 		offset_page += info->page_size;
cf4a81
 	}
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	/*
cf4a81
 	 * If page is on memory hole, set bit on the 1st-bitmap.
cf4a81
@@ -5629,7 +5629,7 @@ create_1st_bitmap_file(void)
cf4a81
 	 */
cf4a81
 	if (!info->flag_mem_usage) {
cf4a81
 		print_progress(PROGRESS_HOLES, info->max_mapnr, info->max_mapnr, NULL);
cf4a81
-		print_execution_time(PROGRESS_HOLES, &tv_start);
cf4a81
+		print_execution_time(PROGRESS_HOLES, &ts_start);
cf4a81
 	}
cf4a81
 
cf4a81
 	if (!sync_1st_bitmap())
cf4a81
@@ -5731,7 +5731,7 @@ create_bitmap_from_memhole(struct cycle *cycle, struct dump_bitmap *bitmap, int
cf4a81
 	mdf_pfn_t pfn_start_roundup, pfn_end_round;
cf4a81
 	unsigned long pfn_start_byte, pfn_end_byte;
cf4a81
 	unsigned int num_pt_loads = get_num_pt_loads();
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 
cf4a81
 	/*
cf4a81
 	 * At first, clear all the bits on the bitmap.
cf4a81
@@ -5741,7 +5741,7 @@ create_bitmap_from_memhole(struct cycle *cycle, struct dump_bitmap *bitmap, int
cf4a81
 	/*
cf4a81
 	 * If page is on memory hole, set bit on the bitmap.
cf4a81
 	 */
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 	for (i = 0; get_pt_load(i, &phys_start, &phys_end, NULL, NULL); i++) {
cf4a81
 		pfn_start = MAX(paddr_to_pfn(phys_start), cycle->start_pfn);
cf4a81
 		pfn_end = MIN(paddr_to_pfn(phys_end), cycle->end_pfn);
cf4a81
@@ -5786,7 +5786,7 @@ create_bitmap_from_memhole(struct cycle *cycle, struct dump_bitmap *bitmap, int
cf4a81
 	 * print 100 %
cf4a81
 	 */
cf4a81
 	print_progress(PROGRESS_HOLES, info->max_mapnr, info->max_mapnr, NULL);
cf4a81
-	print_execution_time(PROGRESS_HOLES, &tv_start);
cf4a81
+	print_execution_time(PROGRESS_HOLES, &ts_start);
cf4a81
 
cf4a81
 	return TRUE;
cf4a81
 }
cf4a81
@@ -6045,14 +6045,14 @@ exclude_unnecessary_pages(struct cycle *cycle)
cf4a81
 {
cf4a81
 	unsigned int mm;
cf4a81
 	struct mem_map_data *mmd;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 
cf4a81
 	if (is_xen_memory() && !info->dom0_mapnr) {
cf4a81
 		ERRMSG("Can't get max domain-0 PFN for excluding pages.\n");
cf4a81
 		return FALSE;
cf4a81
 	}
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	for (mm = 0; mm < info->num_mem_map; mm++) {
cf4a81
 
cf4a81
@@ -6076,7 +6076,7 @@ exclude_unnecessary_pages(struct cycle *cycle)
cf4a81
 	 */
cf4a81
 	if (!info->flag_mem_usage) {
cf4a81
 		print_progress(PROGRESS_UNN_PAGES, info->num_mem_map, info->num_mem_map, NULL);
cf4a81
-		print_execution_time(PROGRESS_UNN_PAGES, &tv_start);
cf4a81
+		print_execution_time(PROGRESS_UNN_PAGES, &ts_start);
cf4a81
 	}
cf4a81
 
cf4a81
 	return TRUE;
cf4a81
@@ -7474,7 +7474,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
cf4a81
 	unsigned long frac_head, frac_tail;
cf4a81
 	off_t off_seg_load, off_memory;
cf4a81
 	Elf64_Phdr load;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 	struct cycle cycle = {0};
cf4a81
 
cf4a81
 	if (!info->flag_elf_dumpfile)
cf4a81
@@ -7499,7 +7499,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
cf4a81
 	if (!(phnum = get_phnum_memory()))
cf4a81
 		return FALSE;
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	for (i = 0; i < phnum; i++) {
cf4a81
 		if (!get_phdr_memory(i, &load))
cf4a81
@@ -7547,7 +7547,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
cf4a81
 				}
cf4a81
 
cf4a81
 				if ((num_dumped % per) == 0)
cf4a81
-					print_progress(PROGRESS_COPY, num_dumped, num_dumpable, &tv_start);
cf4a81
+					print_progress(PROGRESS_COPY, num_dumped, num_dumpable, &ts_start);
cf4a81
 
cf4a81
 				num_dumped++;
cf4a81
 
cf4a81
@@ -7666,8 +7666,8 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
cf4a81
 	/*
cf4a81
 	 * print [100 %]
cf4a81
 	 */
cf4a81
-	print_progress(PROGRESS_COPY, num_dumpable, num_dumpable, &tv_start);
cf4a81
-	print_execution_time(PROGRESS_COPY, &tv_start);
cf4a81
+	print_progress(PROGRESS_COPY, num_dumpable, num_dumpable, &ts_start);
cf4a81
+	print_execution_time(PROGRESS_COPY, &ts_start);
cf4a81
 	PROGRESS_MSG("\n");
cf4a81
 
cf4a81
 	return TRUE;
cf4a81
@@ -8008,8 +8008,8 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header,
cf4a81
 	mdf_pfn_t per;
cf4a81
 	mdf_pfn_t start_pfn, end_pfn;
cf4a81
 	struct page_desc pd;
cf4a81
-	struct timeval tv_start;
cf4a81
-	struct timeval last, new;
cf4a81
+	struct timespec ts_start;
cf4a81
+	struct timespec last, new;
cf4a81
 	pthread_t **threads = NULL;
cf4a81
 	struct thread_args *kdump_thread_args = NULL;
cf4a81
 	void *thread_result;
cf4a81
@@ -8047,7 +8047,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header,
cf4a81
 	per = info->num_dumpable / 10000;
cf4a81
 	per = per ? per : 1;
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	start_pfn = cycle->start_pfn;
cf4a81
 	end_pfn   = cycle->end_pfn;
cf4a81
@@ -8095,7 +8095,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header,
cf4a81
 		 * The next pfn is smallest pfn in all page_flag_buf.
cf4a81
 		 */
cf4a81
 		sem_wait(&info->page_flag_buf_sem);
cf4a81
-		gettimeofday(&last, NULL);
cf4a81
+		clock_gettime(CLOCK_MONOTONIC, &last);
cf4a81
 		while (1) {
cf4a81
 			current_pfn = end_pfn;
cf4a81
 
cf4a81
@@ -8138,7 +8138,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header,
cf4a81
 			 * So we should recheck.
cf4a81
 			 */
cf4a81
 			if (info->page_flag_buf[consuming]->ready != FLAG_READY) {
cf4a81
-				gettimeofday(&new, NULL);
cf4a81
+				clock_gettime(CLOCK_MONOTONIC, &new;;
cf4a81
 				if (new.tv_sec - last.tv_sec > WAIT_TIME) {
cf4a81
 					ERRMSG("Can't get data of pfn.\n");
cf4a81
 					goto out;
cf4a81
@@ -8151,7 +8151,7 @@ write_kdump_pages_parallel_cyclic(struct cache_data *cd_header,
cf4a81
 		}
cf4a81
 
cf4a81
 		if ((num_dumped % per) == 0)
cf4a81
-			print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &tv_start);
cf4a81
+			print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &ts_start);
cf4a81
 
cf4a81
 		num_dumped++;
cf4a81
 
cf4a81
@@ -8187,8 +8187,8 @@ finish:
cf4a81
 	/*
cf4a81
 	 * print [100 %]
cf4a81
 	 */
cf4a81
-	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &tv_start);
cf4a81
-	print_execution_time(PROGRESS_COPY, &tv_start);
cf4a81
+	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &ts_start);
cf4a81
+	print_execution_time(PROGRESS_COPY, &ts_start);
cf4a81
 	PROGRESS_MSG("\n");
cf4a81
 
cf4a81
 out:
cf4a81
@@ -8238,7 +8238,7 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
cf4a81
 	struct page_desc pd;
cf4a81
 	unsigned char buf[info->page_size], *buf_out = NULL;
cf4a81
 	unsigned long len_buf_out;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 	const off_t failed = (off_t)-1;
cf4a81
 	unsigned long len_buf_out_zlib, len_buf_out_lzo, len_buf_out_snappy;
cf4a81
 
cf4a81
@@ -8299,12 +8299,12 @@ write_kdump_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_pag
cf4a81
 			end_pfn = info->split_end_pfn;
cf4a81
 	}
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	for (pfn = start_pfn; pfn < end_pfn; pfn++) {
cf4a81
 
cf4a81
 		if ((num_dumped % per) == 0)
cf4a81
-			print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &tv_start);
cf4a81
+			print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &ts_start);
cf4a81
 
cf4a81
 		/*
cf4a81
 		 * Check the excluded page.
cf4a81
@@ -8384,8 +8384,8 @@ out:
cf4a81
 		free(wrkmem);
cf4a81
 #endif
cf4a81
 
cf4a81
-	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &tv_start);
cf4a81
-	print_execution_time(PROGRESS_COPY, &tv_start);
cf4a81
+	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &ts_start);
cf4a81
+	print_execution_time(PROGRESS_COPY, &ts_start);
cf4a81
 
cf4a81
 	return ret;
cf4a81
 }
cf4a81
@@ -8747,7 +8747,7 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
cf4a81
 	off_t offset_data=0;
cf4a81
 	struct disk_dump_header *dh = info->dump_header;
cf4a81
 	unsigned char buf[info->page_size];
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 
cf4a81
 	cd_header->offset
cf4a81
 		= (DISKDUMP_HEADER_BLOCKS + dh->sub_hdr_size + dh->bitmap_blocks)
cf4a81
@@ -8829,7 +8829,7 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
cf4a81
 	}
cf4a81
 	free_bitmap2_buffer();
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	/*
cf4a81
 	 * Write the remainder.
cf4a81
@@ -8842,8 +8842,8 @@ write_kdump_pages_and_bitmap_cyclic(struct cache_data *cd_header, struct cache_d
cf4a81
 	/*
cf4a81
 	 * print [100 %]
cf4a81
 	 */
cf4a81
-	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &tv_start);
cf4a81
-	print_execution_time(PROGRESS_COPY, &tv_start);
cf4a81
+	print_progress(PROGRESS_COPY, num_dumped, info->num_dumpable, &ts_start);
cf4a81
+	print_execution_time(PROGRESS_COPY, &ts_start);
cf4a81
 	PROGRESS_MSG("\n");
cf4a81
 
cf4a81
 	return TRUE;
cf4a81
@@ -9563,10 +9563,10 @@ exclude_xen4_user_domain(void)
cf4a81
 int
cf4a81
 exclude_xen_user_domain(void)
cf4a81
 {
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 	int ret;
cf4a81
 
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 
cf4a81
 	if (info->xen_crash_info.com &&
cf4a81
 	    info->xen_crash_info.com->xen_major_version >= 4)
cf4a81
@@ -9578,7 +9578,7 @@ exclude_xen_user_domain(void)
cf4a81
 	 * print [100 %]
cf4a81
 	 */
cf4a81
 	print_progress(PROGRESS_XEN_DOMAIN, 1, 1, NULL);
cf4a81
-	print_execution_time(PROGRESS_XEN_DOMAIN, &tv_start);
cf4a81
+	print_execution_time(PROGRESS_XEN_DOMAIN, &ts_start);
cf4a81
 
cf4a81
 	return ret;
cf4a81
 }
cf4a81
@@ -10502,7 +10502,7 @@ reassemble_kdump_pages(void)
cf4a81
 	struct disk_dump_header dh;
cf4a81
 	struct page_desc pd, pd_zero;
cf4a81
 	struct cache_data cd_pd, cd_data;
cf4a81
-	struct timeval tv_start;
cf4a81
+	struct timespec ts_start;
cf4a81
 	char *data = NULL;
cf4a81
 	unsigned long data_buf_size = info->page_size;
cf4a81
 
cf4a81
@@ -10538,7 +10538,7 @@ reassemble_kdump_pages(void)
cf4a81
 	/*
cf4a81
 	 * Write page header of zero-filled page.
cf4a81
 	 */
cf4a81
-	gettimeofday(&tv_start, NULL);
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_start);
cf4a81
 	if (info->dump_level & DL_EXCLUDE_ZERO) {
cf4a81
 		/*
cf4a81
 		 * makedumpfile outputs the data of zero-filled page at first
cf4a81
@@ -10573,7 +10573,7 @@ reassemble_kdump_pages(void)
cf4a81
 
cf4a81
 			num_dumped++;
cf4a81
 
cf4a81
-			print_progress(PROGRESS_COPY, num_dumped, num_dumpable, &tv_start);
cf4a81
+			print_progress(PROGRESS_COPY, num_dumped, num_dumpable, &ts_start);
cf4a81
 
cf4a81
 			if (lseek(fd, offset_ph_org, SEEK_SET) < 0) {
cf4a81
 				ERRMSG("Can't seek a file(%s). %s\n",
cf4a81
@@ -10670,8 +10670,8 @@ reassemble_kdump_pages(void)
cf4a81
 						    size_eraseinfo))
cf4a81
 			goto out;
cf4a81
 	}
cf4a81
-	print_progress(PROGRESS_COPY, num_dumpable, num_dumpable, &tv_start);
cf4a81
-	print_execution_time(PROGRESS_COPY, &tv_start);
cf4a81
+	print_progress(PROGRESS_COPY, num_dumpable, num_dumpable, &ts_start);
cf4a81
+	print_execution_time(PROGRESS_COPY, &ts_start);
cf4a81
 
cf4a81
 	ret = TRUE;
cf4a81
 out:
cf4a81
diff --git a/makedumpfile-1.6.2/print_info.c b/makedumpfile-1.6.2/print_info.c
cf4a81
index 6bfcd11..732d5b8 100644
cf4a81
--- a/makedumpfile-1.6.2/print_info.c
cf4a81
+++ b/makedumpfile-1.6.2/print_info.c
cf4a81
@@ -19,6 +19,8 @@
cf4a81
 
cf4a81
 #define PROGRESS_MAXLEN		"50"
cf4a81
 
cf4a81
+#define NSEC_PER_SEC		1000000000L
cf4a81
+
cf4a81
 int message_level;
cf4a81
 int flag_strerr_message;
cf4a81
 int flag_ignore_r_char; /* 0: '\r' is effective. 1: not effective. */
cf4a81
@@ -338,16 +340,16 @@ print_usage(void)
cf4a81
 	MSG("\n");
cf4a81
 }
cf4a81
 
cf4a81
-static void calc_delta(struct timeval *tv_start, struct timeval *delta)
cf4a81
+static void calc_delta(struct timespec *ts_start, struct timespec *delta)
cf4a81
 {
cf4a81
-	struct timeval tv_end;
cf4a81
+	struct timespec ts_end;
cf4a81
 
cf4a81
-	gettimeofday(&tv_end, NULL);
cf4a81
-	delta->tv_sec = tv_end.tv_sec - tv_start->tv_sec;
cf4a81
-	delta->tv_usec = tv_end.tv_usec - tv_start->tv_usec;
cf4a81
-	if (delta->tv_usec < 0) {
cf4a81
+	clock_gettime(CLOCK_MONOTONIC, &ts_end);
cf4a81
+	delta->tv_sec = ts_end.tv_sec - ts_start->tv_sec;
cf4a81
+	delta->tv_nsec = ts_end.tv_nsec - ts_start->tv_nsec;
cf4a81
+	if (delta->tv_nsec < 0) {
cf4a81
 		delta->tv_sec--;
cf4a81
-		delta->tv_usec += 1000000;
cf4a81
+		delta->tv_nsec += NSEC_PER_SEC;
cf4a81
 	}
cf4a81
 }
cf4a81
 
cf4a81
@@ -371,14 +373,14 @@ static int eta_to_human_short (unsigned long secs, char* msg)
cf4a81
 
cf4a81
 
cf4a81
 void
cf4a81
-print_progress(const char *msg, unsigned long current, unsigned long end, struct timeval *start)
cf4a81
+print_progress(const char *msg, unsigned long current, unsigned long end, struct timespec *start)
cf4a81
 {
cf4a81
 	unsigned progress;	/* in promilles (tenths of a percent) */
cf4a81
 	time_t tm;
cf4a81
 	static time_t last_time = 0;
cf4a81
 	static unsigned int lapse = 0;
cf4a81
 	static const char *spinner = "/|\\-";
cf4a81
-	struct timeval delta;
cf4a81
+	struct timespec delta;
cf4a81
 	unsigned long eta;
cf4a81
 	char eta_msg[16] = " ";
cf4a81
 
cf4a81
@@ -393,7 +395,7 @@ print_progress(const char *msg, unsigned long current, unsigned long end, struct
cf4a81
 
cf4a81
 	if (start != NULL && progress != 0) {
cf4a81
 		calc_delta(start, &delta);
cf4a81
-		eta = 1000 * delta.tv_sec + delta.tv_usec / 1000;
cf4a81
+		eta = 1000 * delta.tv_sec + delta.tv_nsec / (NSEC_PER_SEC / 1000);
cf4a81
 		eta = eta / progress - delta.tv_sec;
cf4a81
 		eta_to_human_short(eta, eta_msg);
cf4a81
 	}
cf4a81
@@ -411,12 +413,12 @@ print_progress(const char *msg, unsigned long current, unsigned long end, struct
cf4a81
 }
cf4a81
 
cf4a81
 void
cf4a81
-print_execution_time(char *step_name, struct timeval *tv_start)
cf4a81
+print_execution_time(char *step_name, struct timespec *ts_start)
cf4a81
 {
cf4a81
-	struct timeval delta;
cf4a81
+	struct timespec delta;
cf4a81
 
cf4a81
-	calc_delta(tv_start, &delta);
cf4a81
+	calc_delta(ts_start, &delta);
cf4a81
 	REPORT_MSG("STEP [%s] : %ld.%06ld seconds\n",
cf4a81
-		   step_name, delta.tv_sec, delta.tv_usec);
cf4a81
+		   step_name, delta.tv_sec, delta.tv_nsec / 1000);
cf4a81
 }
cf4a81
 
cf4a81
diff --git a/makedumpfile-1.6.2/print_info.h b/makedumpfile-1.6.2/print_info.h
cf4a81
index 1ce3593..49b70f4 100644
cf4a81
--- a/makedumpfile-1.6.2/print_info.h
cf4a81
+++ b/makedumpfile-1.6.2/print_info.h
cf4a81
@@ -17,7 +17,7 @@
cf4a81
 #define _PRINT_INFO_H
cf4a81
 
cf4a81
 #include <stdio.h>
cf4a81
-#include <sys/time.h>
cf4a81
+#include <time.h>
cf4a81
 
cf4a81
 extern int message_level;
cf4a81
 extern int flag_strerr_message;
cf4a81
@@ -25,9 +25,9 @@ extern int flag_ignore_r_char;
cf4a81
 
cf4a81
 void show_version(void);
cf4a81
 void print_usage(void);
cf4a81
-void print_progress(const char *msg, unsigned long current, unsigned long end, struct timeval *start);
cf4a81
+void print_progress(const char *msg, unsigned long current, unsigned long end, struct timespec *start);
cf4a81
 
cf4a81
-void print_execution_time(char *step_name, struct timeval *tv_start);
cf4a81
+void print_execution_time(char *step_name, struct timespec *ts_start);
cf4a81
 
cf4a81
 /*
cf4a81
  * Message texts
cf4a81
-- 
cf4a81
2.9.5
cf4a81