MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bpfstats_fill_xbpf

Function bpfstats_fill_xbpf

freebsd/net/bpf.c:2903–2932  ·  view source on GitHub ↗

* Fill filter statistics */

Source from the content-addressed store, hash-verified

2901 * Fill filter statistics
2902 */
2903static void
2904bpfstats_fill_xbpf(struct xbpf_d *d, struct bpf_d *bd)
2905{
2906
2907 BPF_LOCK_ASSERT();
2908 bzero(d, sizeof(*d));
2909 d->bd_structsize = sizeof(*d);
2910 d->bd_immediate = bd->bd_immediate;
2911 d->bd_promisc = bd->bd_promisc;
2912 d->bd_hdrcmplt = bd->bd_hdrcmplt;
2913 d->bd_direction = bd->bd_direction;
2914 d->bd_feedback = bd->bd_feedback;
2915 d->bd_async = bd->bd_async;
2916 d->bd_rcount = counter_u64_fetch(bd->bd_rcount);
2917 d->bd_dcount = counter_u64_fetch(bd->bd_dcount);
2918 d->bd_fcount = counter_u64_fetch(bd->bd_fcount);
2919 d->bd_sig = bd->bd_sig;
2920 d->bd_slen = bd->bd_slen;
2921 d->bd_hlen = bd->bd_hlen;
2922 d->bd_bufsize = bd->bd_bufsize;
2923 d->bd_pid = bd->bd_pid;
2924 strlcpy(d->bd_ifname,
2925 bd->bd_bif->bif_ifp->if_xname, IFNAMSIZ);
2926 d->bd_locked = bd->bd_locked;
2927 d->bd_wcount = counter_u64_fetch(bd->bd_wcount);
2928 d->bd_wdcount = counter_u64_fetch(bd->bd_wdcount);
2929 d->bd_wfcount = counter_u64_fetch(bd->bd_wfcount);
2930 d->bd_zcopy = counter_u64_fetch(bd->bd_zcopy);
2931 d->bd_bufmode = bd->bd_bufmode;
2932}
2933
2934/*
2935 * Handle `netstat -B' stats request

Callers 1

bpf_stats_sysctlFunction · 0.85

Calls 3

bzeroFunction · 0.85
counter_u64_fetchFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected