def perfctr(self, cmd, group='<STR_LIT>', code_markers=True):
<EOL>if find_executable('<STR_LIT>') is None:<EOL><INDENT>print("<STR_LIT>",<EOL>file=sys.stderr)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>perf_cmd = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', group]<EOL>cpu = '<STR_LIT>'<EOL>if self._args.cores > <NUM_LIT:1>:<EOL><INDENT>cpu += '<STR_LIT:->'+str(self._args.cores-<NUM_LIT:1>)<EOL><DEDENT>perf_cmd += ['<STR_LIT>', cpu]<EOL>perf_cmd.append('<STR_LIT>')<EOL>perf_cmd += cmd<EOL>if self.verbose > <NUM_LIT:1>:<EOL><INDENT>print('<STR_LIT:U+0020>'.join(perf_cmd))<EOL><DEDENT>try:<EOL><INDENT>with fix_env_variable('<STR_LIT>', None):<EOL><INDENT>output = subprocess.check_output(perf_cmd).decode('<STR_LIT:utf-8>').split('<STR_LIT:\n>')<EOL><DEDENT><DEDENT>except subprocess.CalledProcessError as e:<EOL><INDENT>print("<STR_LIT>".format(e), file=sys.stderr)<EOL>sys.exit(<NUM_LIT:1>)<EOL><DEDENT>results = {}<EOL>for line in output:<EOL><INDENT>line = line.split('<STR_LIT:U+002C>')<EOL>try:<EOL><INDENT>results[line[<NUM_LIT:0>]] = float(line[<NUM_LIT:1>])<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT>except IndexError:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>if line[<NUM_LIT:2>] == '<STR_LIT:->' or line[<NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>counter_value = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>counter_value = int(line[<NUM_LIT:2>])<EOL><DEDENT>if re.fullmatch(r'<STR_LIT>', line[<NUM_LIT:0>]) and re.fullmatch(r'<STR_LIT>', line[<NUM_LIT:1>]):<EOL><INDENT>results.setdefault(line[<NUM_LIT:0>], {})<EOL>results[line[<NUM_LIT:0>]][line[<NUM_LIT:1>]] = counter_value<EOL><DEDENT><DEDENT>except (IndexError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return results<EOL>
Run *cmd* with likwid-perfctr and returns result as dict.

*group* may be a performance group known to likwid-perfctr or an event string.

if CLI argument cores > 1, running with multi-core, otherwise single-core