Lines Matching defs:stat
187 BPFLOGD(BPF_TRUE, "failed to lookup pftrace stat");
190 struct pf_stat_t stat;
191 int err = (int) bpf_probe_read_kernel(&stat, sizeof(stat), stat_ptr);
193 BPFLOGD(BPF_TRUE, "failed to read pftrace stat");
196 u32 tot_duration = stat.tot_duration + duration;
197 u32 avg_duration = tot_duration / (stat.count + 1);
198 stat.dev_duration = (duration * duration + stat.count * stat.dev_duration
199 + stat.tot_duration * stat.avg_duration - tot_duration * avg_duration)
200 / (stat.count + 1);
201 ++stat.count;
202 stat.tot_duration = tot_duration;
203 stat.avg_duration = avg_duration;
204 if (duration < stat.min_duration) {
205 stat.min_duration = duration;
206 } else if (duration > stat.max_duration) {
207 stat.max_duration = duration;
209 err = (int) bpf_map_update_elem(&pftrace_stats_map, &type, &stat, BPF_ANY);
211 BPFLOGD(BPF_TRUE, "failed to update pftrace stat");