def match_process(pid, name, cmdline, exe, cfg):
    if cfg['selfmon'] and pid == os.getpid():
        return True
    for exe_re in cfg['exe']:
        if exe_re.search(exe):
            return True
    for name_re in cfg['name']:
        if name_re.search(name):
            return True
    for cmdline_re in cfg['cmdline']:
        if cmdline_re.search(' '.join(cmdline)):
            return True
    return False
Decides whether a process matches with a given process descriptor
dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/processresources/processresources.py/match_process