# Path: src/python/bcc/libbcc.py
# _RAW_CB_TYPE = ct.CFUNCTYPE(None, ct.py_object, ct.c_void_p, ct.c_int)
# _LOST_CB_TYPE = ct.CFUNCTYPE(None, ct.py_object, ct.c_ulonglong)
# _RINGBUF_CB_TYPE = ct.CFUNCTYPE(ct.c_int, ct.c_void_p, ct.c_void_p, ct.c_int)
# _SYM_CB_TYPE = ct.CFUNCTYPE(ct.c_int, ct.c_char_p, ct.c_ulonglong)
#     NONE = 0x0
#     CONSTANT = 0x1
#     DEREF_OFFSET = 0x2
#     DEREF_IDENT = 0x4
#     BASE_REGISTER_NAME = 0x8
#     INDEX_REGISTER_NAME = 0x10
#     SCALE = 0x20
# _USDT_CB = ct.CFUNCTYPE(None, ct.POINTER(bcc_usdt))
# _USDT_PROBE_CB = ct.CFUNCTYPE(None, ct.c_char_p, ct.c_char_p,
#                               ct.c_ulonglong, ct.c_int)
# class bcc_perf_buffer_opts(ct.Structure):
# class bcc_symbol(ct.Structure):
# class bcc_ip_offset_union(ct.Union):
# class bcc_stacktrace_build_id(ct.Structure):
# class bcc_symbol_option(ct.Structure):
# class bcc_usdt(ct.Structure):
# class bcc_usdt_location(ct.Structure):
# class BCC_USDT_ARGUMENT_FLAGS(object):
# class bcc_usdt_argument(ct.Structure):


    from collections.abc import MutableMapping
    from collections import MutableMapping
from time import strftime
from functools import reduce
from .libbcc import lib, _RAW_CB_TYPE, _LOST_CB_TYPE, _RINGBUF_CB_TYPE, bcc_perf_buffer_opts
from .utils import get_online_cpus
from .utils import get_possible_cpus
import ctypes as ct
import os
import errno
import re
import sys
        'char'              : ct.c_char,
        's8'                : ct.c_char,
        'unsigned char'     : ct.c_ubyte,
        'u8'                : ct.c_ubyte,
        'u8 *'              : ct.c_char_p,
        'char *'            : ct.c_char_p,
        'short'             : ct.c_short,
        's16'               : ct.c_short,
        'unsigned short'    : ct.c_ushort,
        'u16'               : ct.c_ushort,
        'int'               : ct.c_int,
        's32'               : ct.c_int,
        'enum'              : ct.c_int,
        'unsigned int'      : ct.c_uint,
        'u32'               : ct.c_uint,
        'long'              : ct.c_long,
        'unsigned long'     : ct.c_ulong,
        'long long'         : ct.c_longlong,
        's64'               : ct.c_longlong,
        'unsigned long long': ct.c_ulonglong,
        'u64'               : ct.c_ulonglong,
        '__int128'          : (ct.c_longlong * 2),
        'unsigned __int128' : (ct.c_ulonglong * 2),
        'void *'            : ct.c_void_p,
    }

    # handle array types e.g. "int [16]" or "char[16]"
    array_type = re.compile(r"([^ ]+) ?\[([0-9]+)\]$")

    fields = []

# Path: src/python/bcc/libbcc.py
# _RAW_CB_TYPE = ct.CFUNCTYPE(None, ct.py_object, ct.c_void_p, ct.c_int)
# _LOST_CB_TYPE = ct.CFUNCTYPE(None, ct.py_object, ct.c_ulonglong)
# _RINGBUF_CB_TYPE = ct.CFUNCTYPE(ct.c_int, ct.c_void_p, ct.c_void_p, ct.c_int)
# _SYM_CB_TYPE = ct.CFUNCTYPE(ct.c_int, ct.c_char_p, ct.c_ulonglong)
#     NONE = 0x0
#     CONSTANT = 0x1
#     DEREF_OFFSET = 0x2
#     DEREF_IDENT = 0x4
#     BASE_REGISTER_NAME = 0x8
#     INDEX_REGISTER_NAME = 0x10
#     SCALE = 0x20
# _USDT_CB = ct.CFUNCTYPE(None, ct.POINTER(bcc_usdt))
# _USDT_PROBE_CB = ct.CFUNCTYPE(None, ct.c_char_p, ct.c_char_p,
#                               ct.c_ulonglong, ct.c_int)
# class bcc_perf_buffer_opts(ct.Structure):
# class bcc_symbol(ct.Structure):
# class bcc_ip_offset_union(ct.Union):
# class bcc_stacktrace_build_id(ct.Structure):
# class bcc_symbol_option(ct.Structure):
# class bcc_usdt(ct.Structure):
# class bcc_usdt_location(ct.Structure):
# class BCC_USDT_ARGUMENT_FLAGS(object):
# class bcc_usdt_argument(ct.Structure):


# Path: src/python/bcc/table.py
    from collections.abc import MutableMapping
    from collections import MutableMapping
from time import strftime
from functools import reduce
from .libbcc import lib, _RAW_CB_TYPE, _LOST_CB_TYPE, _RINGBUF_CB_TYPE, bcc_perf_buffer_opts
from .utils import get_online_cpus
from .utils import get_possible_cpus
import ctypes as ct
import os
import errno
import re
import sys

        'char'              : ct.c_char,
        's8'                : ct.c_char,
        'unsigned char'     : ct.c_ubyte,
        'u8'                : ct.c_ubyte,
        'u8 *'              : ct.c_char_p,
        'char *'            : ct.c_char_p,
        'short'             : ct.c_short,
        's16'               : ct.c_short,
        'unsigned short'    : ct.c_ushort,
        'u16'               : ct.c_ushort,
        'int'               : ct.c_int,
        's32'               : ct.c_int,
        'enum'              : ct.c_int,
        'unsigned int'      : ct.c_uint,
        'u32'               : ct.c_uint,
        'long'              : ct.c_long,
        'unsigned long'     : ct.c_ulong,
        'long long'         : ct.c_longlong,
        's64'               : ct.c_longlong,
        'unsigned long long': ct.c_ulonglong,
        'u64'               : ct.c_ulonglong,
        '__int128'          : (ct.c_longlong * 2),
        'unsigned __int128' : (ct.c_ulonglong * 2),
        'void *'            : ct.c_void_p,
    }

    # handle array types e.g. "int [16]" or "char[16]"
    array_type = re.compile(r"([^ ]+) ?\[([0-9]+)\]$")

    fields = []

    num_fields = lib.bpf_perf_event_fields(event_map.bpf.module, event_map._name)