summaryrefslogtreecommitdiffstats
path: root/sys/dev/scc
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2006-07-24 15:42:04 +0000
committerdwmalone <dwmalone@FreeBSD.org>2006-07-24 15:42:04 +0000
commit998baf5362641bed23387aa9efb4cfe280885ba2 (patch)
tree136dd3ba109658d9318157a47c75fe77703cf8bb /sys/dev/scc
parent40868fda8a777cd2639ad89e252401b8b27c8c91 (diff)
downloadFreeBSD-src-998baf5362641bed23387aa9efb4cfe280885ba2.zip
FreeBSD-src-998baf5362641bed23387aa9efb4cfe280885ba2.tar.gz
Rather than calling mircotime() in catchpacket(), make catchpacket()
take a timeval indicating when the packet was captured. Move microtime() to the calling functions and grab the timestamp as soon as we know that we're going to call catchpacket at least once. This means that we call microtime() once per matched packet, as opposed to once per matched packet per bpf listener. It also means that we return the same timestamp to all bpf listeners, rather than slightly different ones. It would be more accurate to call microtime() even earlier for all packets, as you have to grab (1+#listener) locks before you can determine if the packet will be logged. You could always grab a timestamp before the locks, but microtime() can be costly, so this didn't seem like a good idea. (I guess most ethernet interfaces will have a bpf listener these days because of dhclient. That means that we could be doing two bpf locks on most packets going through the interface.) PR: 71711
Diffstat (limited to 'sys/dev/scc')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud