bin/123774: [patch] kdump time_t printing issues

Matthew Luckie mjl at luckie.org.nz
Sun May 18 02:40:03 UTC 2008


>Number:         123774
>Category:       bin
>Synopsis:       [patch] kdump time_t printing issues
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 18 02:40:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Luckie
>Release:        FreeBSD 7.0-RELEASE-p1 arm
>Organization:
>Environment:
System: FreeBSD vinyl.luckie.org.nz 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #4: Sun May 18 08:49:48 NZST 2008     root at rayon.luckie.org.nz:/usr/obj/arm/usr/src/sys/vinyl  arm

>Description:
On systems with 64-bit time_t values, such as arm, kdump -T prints the
following:

   988 ktrace   0.1211060384 RET   ktrace 0

where you would otherwise expect to see

   988 ktrace   1211060384.667338 RET   ktrace 0

>How-To-Repeat:
ktrace / kdump on a system with a 64-bit time_t
>Fix:

There is no non-kludge solution that I am aware of.

http://lists.freebsd.org/pipermail/freebsd-ports/2006-January/028656.html

--- patch-kdump.c begins here ---
--- kdump.c.orig	2008-01-12 13:07:50.000000000 +1300
+++ kdump.c	2008-05-18 14:14:30.000000000 +1200
@@ -290,8 +290,9 @@
 			timevalsub(&kth->ktr_time, &prevtime);
 			prevtime = temp;
 		}
-		(void)printf("%ld.%06ld ",
-		    kth->ktr_time.tv_sec, kth->ktr_time.tv_usec);
+		(void)printf("%lld.%06ld ",
+		    (long long int)kth->ktr_time.tv_sec,
+		    kth->ktr_time.tv_usec);
 	}
 	(void)printf("%s  ", type);
 }
--- patch-kdump.c ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list