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

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 .