summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_tc.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-06-15 19:28:44 +0000
committerjkim <jkim@FreeBSD.org>2010-06-15 19:28:44 +0000
commit14f08fd6272b6042eef9e52239ed552feb9c126c (patch)
tree7fbda1d0820b3e7d313b910158875757fdde63ff /sys/kern/kern_tc.c
parent3571902304966f5edad4bceddc7fb3170f4ff982 (diff)
downloadFreeBSD-src-14f08fd6272b6042eef9e52239ed552feb9c126c.zip
FreeBSD-src-14f08fd6272b6042eef9e52239ed552feb9c126c.tar.gz
Implement flexible BPF timestamping framework.
- Allow setting format, resolution and accuracy of BPF time stamps per listener. Previously, we were only able to use microtime(9). Now we can set various resolutions and accuracies with ioctl(2) BIOCSTSTAMP command. Similarly, we can get the current resolution and accuracy with BIOCGTSTAMP command. Document all supported options in bpf(4) and their uses. - Introduce new time stamp 'struct bpf_ts' and header 'struct bpf_xhdr'. The new time stamp has both 64-bit second and fractional parts. bpf_xhdr has this time stamp instead of 'struct timeval' for bh_tstamp. The new structures let us use bh_tstamp of same size on both 32-bit and 64-bit platforms without adding additional shims for 32-bit binaries. On 64-bit platforms, size of BPF header does not change compared to bpf_hdr as its members are already all 64-bit long. On 32-bit platforms, the size may increase by 8 bytes. For backward compatibility, struct bpf_hdr with struct timeval is still the default header unless new time stamp format is explicitly requested. However, the behaviour may change in the future and all relevant code is wrapped around "#ifdef BURN_BRIDGES" for now. - Add experimental support for tagging mbufs with time stamps from a lower layer, e.g., device driver. Currently, mbuf_tags(9) is used to tag mbufs. The time stamps must be uptime in 'struct bintime' format as binuptime(9) and getbinuptime(9) do. Reviewed by: net@
Diffstat (limited to 'sys/kern/kern_tc.c')
-rw-r--r--sys/kern/kern_tc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c
index 48dc4f8..be2aacb 100644
--- a/sys/kern/kern_tc.c
+++ b/sys/kern/kern_tc.c
@@ -90,7 +90,7 @@ static struct timecounter *timecounters = &dummy_timecounter;
time_t time_second = 1;
time_t time_uptime = 1;
-static struct bintime boottimebin;
+struct bintime boottimebin;
struct timeval boottime;
static int sysctl_kern_boottime(SYSCTL_HANDLER_ARGS);
SYSCTL_PROC(_kern, KERN_BOOTTIME, boottime, CTLTYPE_STRUCT|CTLFLAG_RD,
OpenPOWER on IntegriCloud