Lines Matching refs:zone

67 def ZoneName(zone, zone_security):  argument
76 return "{:s}{:s}".format(names[int(zone_security.z_kheap_id)], zone.z_name)
231 with O.table("Element {:4d}: {:<#20x} ({:<s})".format(i, mo.elem_addr, mo.zone.name)):
272 def GetZoneCacheCPUSummary(zone, zone_security, O): argument
286 recirc_elem_count = zone.z_recirc.zd_full * mag_capacity
287 free_elem_count = zone.z_elems_free + recirc_elem_count
290 if zone.z_pcpu_cache:
294 for cache in IterateZPerCPU(zone.z_pcpu_cache):
306 for stats in IterateZPerCPU(zone.z_stats):
309 print(O.format(format_string, ZoneName(zone, zone_security),
311 used=zone.z_elems_avail - cache_elem_count - free_elem_count,
312 min_wma = (zone.z_elems_free_wma - zone.z_recirc_full_wma * mag_capacity) // 256,
313 cont=float(zone.z_recirc_cont_wma) / 256.,
315 zone=zone, cpuinfo = cpu_info))
329 zone = kern.GetValueFromAddress(cmd_args[0], 'struct zone *')
331 zid = zone_array.index(zone)
333 GetZoneCacheCPUSummary(zone, zone_security, O);
389 zone = {}
391 zone["page_count"] = unsigned(zone_val.z_wired_cur) * pcpu_scale
392 zone["allfree_page_count"] = unsigned(zone_val.z_wired_empty)
406 zone["alloc_fail_count"] = alloc_fail_count
408 zone["size"] = zone["page_count"] * pagesize
409 zone["submap_idx"] = unsigned(zs_val.z_submap_idx)
411 zone["free_size"] = free_elem_count * zone_val.z_elem_size * pcpu_scale
412 zone["cached_size"] = cache_elem_count * zone_val.z_elem_size * pcpu_scale
413 zone["used_size"] = zone["size"] - zone["free_size"] - zone["cached_size"]
415 zone["element_count"] = zone_val.z_elems_avail - zone_val.z_elems_free - cache_elem_count
416 zone["cache_element_count"] = cache_elem_count
417 zone["free_element_count"] = free_elem_count
420 zone["allocation_size"] = unsigned(pagesize)
421 zone["allocation_ncpu"] = unsigned(zone_val.z_chunk_pages)
423 zone["allocation_size"] = unsigned(zone_val.z_chunk_pages * pagesize)
424 zone["allocation_ncpu"] = 1
425 zone["allocation_count"] = unsigned(zone["allocation_size"]) // unsigned(zone_val.z_elem_size)
426zone["allocation_waste"] = (zone["allocation_size"] % zone_val.z_elem_size) * zone["allocation_ncp…
428 zone["destroyed"] = bool(getattr(zone_val, 'z_self', None))
432 zone[mark] = int(zone_val.z_wired_max) != 0xffffffff
434 zone[mark] = bool(getattr(zone_val, mark, None))
437 zone[mark] = bool(getattr(zone_val, mark, None))
439 zone["name"] = ZoneName(zone_val, zs_val)
441 zone["sequester_page_count"] = (unsigned(zone_val.z_va_cur) -
443 zone["page_count_max"] = unsigned(zone_val.z_wired_max) * pcpu_scale
446 json.dumps(zone)
447 return zone
464 zone = GetZone(zone_val, zs_val, marks, security_marks)
478 markings += "I" if zone["destroyed"] else " "
490 markings += "%" if zone["submap_idx"] == 1 else " "
492 alloc_size_kb = zone["allocation_size"] // 1024
493 out_string += format_string.format(zone=zone_val, zd=zone,
497 alloc_size_kb=alloc_size_kb, markings=markings, zone_name=zone["name"])
499 if zone["exhaustible"] :
500 out_string += " (max: {:d})".format(zone["page_count_max"] * pagesize)
502 if zone["sequester_page_count"] != 0 :
503 out_string += " (sequester: {:d})".format(zone["sequester_page_count"])
505 stats["cur_size"] += zone["size"]
506 stats["used_size"] += zone["used_size"]
507 stats["cached_size"] += zone["cached_size"]
508 stats["free_size"] += zone["free_size"]
509 stats["cur_pages"] += zone["page_count"]
510 stats["free_pages"] += zone["allfree_page_count"]
511 stats["seq_pages"] += zone["sequester_page_count"]
699 zone = kalloc_type_zarray[i]
700 if zone and zone.z_elem_size == size:
701 while zone:
702 print("Zone: %s (0x%x)" % (zone.z_name, zone))
703 PrintTypes(zone)
704 zone = zone.z_kt_next
711 zone = kalloc_type_zarray[i]
712 while zone:
713 print("Zone: %s (0x%x)" % (zone.z_name, zone))
714 PrintTypes(zone)
715 zone = zone.z_kt_next
733 zone = GetZoneByName(zone_arg)
734 if not zone:
736 zone = kern.GetValueFromAddress(zone_arg, 'struct zone *')
740 zname = str(zone.z_name)
745 PrintTypes(zone)
747 zid = zone_array.index(zone)
749 if "data.kalloc." in ZoneName(zone, zone_security):
766 zone = ktv.kt_zv.zv_zone
768 if zone & 0xf == 0:
769 print("View is in zone %s\n" % zone.z_name)
791 def GetZoneChunk(zone, meta, queue, O=None): argument
798 chunk = zone.chunk_pages
803 pgs = zone.chunk_pages - meta_sbv.xGetIntegerByName('zm_page_index')
819 alloc_count = meta_sbv.xGetIntegerByName('zm_alloc_size') // zone.elem_outer_size
820 avail_count = chunk * zone.kmem.page_size // zone.elem_outer_size
822 return O.format(format_string, zone=zone, meta=meta,
826 def ShowZChunksImpl(zone, extra_addr=None, cmd_options={}, O=None): argument
828 cached = zone.cached()
829 recirc = zone.recirc()
833 for i, e in enumerate(meta.iter_all(zone)):
834 if not meta.is_allocated(zone, e):
849 for meta in zone.iter_page_queue('z_pageq_' + name)
852 print(GetZoneChunk(zone, meta, name, O))
858 if zone.kmem.meta_range.contains(extra_addr):
864 print(GetZoneChunk(zone, meta, "N/A", O))
883 zone = kmemory.Zone(ArgumentStringToInt(cmd_args[0]))
886 ShowZChunksImpl(zone, cmd_options=cmd_options, O=O)
888 … ShowZChunksImpl(zone, extra_addr=ArgumentStringToInt(cmd_args[1]), cmd_options=cmd_options, O=O)
3907 zone = kern.GetValueFromAddress(cmd_args[0], 'struct zone *')
3909 …index = (unsigned(zone) - array.GetSBValue().GetLoadAddress()) // gettype('struct zone').GetByteSi…