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

Function zap_leaf_stats

freebsd/contrib/openzfs/module/zfs/zap_leaf.c:808–849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808void
809zap_leaf_stats(zap_t *zap, zap_leaf_t *l, zap_stats_t *zs)
810{
811 int n = zap_f_phys(zap)->zap_ptrtbl.zt_shift -
812 zap_leaf_phys(l)->l_hdr.lh_prefix_len;
813 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
814 zs->zs_leafs_with_2n_pointers[n]++;
815
816
817 n = zap_leaf_phys(l)->l_hdr.lh_nentries/5;
818 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
819 zs->zs_blocks_with_n5_entries[n]++;
820
821 n = ((1<<FZAP_BLOCK_SHIFT(zap)) -
822 zap_leaf_phys(l)->l_hdr.lh_nfree * (ZAP_LEAF_ARRAY_BYTES+1))*10 /
823 (1<<FZAP_BLOCK_SHIFT(zap));
824 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
825 zs->zs_blocks_n_tenths_full[n]++;
826
827 for (int i = 0; i < ZAP_LEAF_HASH_NUMENTRIES(l); i++) {
828 int nentries = 0;
829 int chunk = zap_leaf_phys(l)->l_hash[i];
830
831 while (chunk != CHAIN_END) {
832 struct zap_leaf_entry *le =
833 ZAP_LEAF_ENTRY(l, chunk);
834
835 n = 1 + ZAP_LEAF_ARRAY_NCHUNKS(le->le_name_numints) +
836 ZAP_LEAF_ARRAY_NCHUNKS(le->le_value_numints *
837 le->le_value_intlen);
838 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
839 zs->zs_entries_using_n_chunks[n]++;
840
841 chunk = le->le_next;
842 nentries++;
843 }
844
845 n = nentries;
846 n = MIN(n, ZAP_HISTOGRAM_SIZE-1);
847 zs->zs_buckets_with_n_entries[n]++;
848 }
849}

Callers 1

zap_stats_ptrtblFunction · 0.85

Calls 2

zap_f_physFunction · 0.85
zap_leaf_physFunction · 0.50

Tested by

no test coverage detected