MCPcopy Index your code
hub / github.com/nodejs/node / Descriptor

Class Descriptor

deps/v8/tools/profiling/ll_prof.py:456–480  ·  view source on GitHub ↗

Descriptor of a structure in the binary trace log.

Source from the content-addressed store, hash-verified

454
455
456class Descriptor(object):
457 """Descriptor of a structure in the binary trace log."""
458
459 CTYPE_MAP = {
460 "u16": ctypes.c_uint16,
461 "u32": ctypes.c_uint32,
462 "u64": ctypes.c_uint64
463 }
464
465 def __init__(self, fields):
466 class TraceItem(ctypes.Structure):
467 _fields_ = Descriptor.CtypesFields(fields)
468
469 def __str__(self):
470 return ", ".join("%s: %s" % (field, self.__getattribute__(field))
471 for field, _ in TraceItem._fields_)
472
473 self.ctype = TraceItem
474
475 def Read(self, trace, offset):
476 return self.ctype.from_buffer(trace, offset)
477
478 @staticmethod
479 def CtypesFields(fields):
480 return [(field, Descriptor.CTYPE_MAP[format]) for (field, format) in fields]
481
482
483# Please see http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;f=tools/perf

Callers 2

ll_prof.pyFile · 0.70
_SampleEventBodyDescMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected