Пример #1
0
def entry_size(cache: drgn.Object) -> int:
    assert cache.type_.type_name() == 'spl_kmem_cache_t *'
    if backed_by_linux_cache(cache):
        return slub.entry_size(cache.skc_linux_cache)
    ops = objs_per_slab(cache)
    if ops == 0:
        return 0
    return int(slab_size(cache) / objs_per_slab(cache))
Пример #2
0
def entry_size(cache: drgn.Object) -> int:
    assert sdb.type_canonical_name(cache.type_) == 'struct spl_kmem_cache *'
    if backed_by_linux_cache(cache):
        return slub.entry_size(cache.skc_linux_cache)
    ops = objs_per_slab(cache)
    if ops == 0:
        return 0
    return int(slab_size(cache) / objs_per_slab(cache))