Brooklyn/tools/perf/arch/x86/util/evlist.c

20 lines
699 B
C
Raw Normal View History

2021-05-26 19:09:36 +00:00
// SPDX-License-Identifier: GPL-2.0
#include <stdio.h>
#include "util/pmu.h"
#include "util/evlist.h"
#include "util/parse-events.h"
#define TOPDOWN_L1_EVENTS "{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound}"
2021-07-22 16:18:54 +00:00
#define TOPDOWN_L2_EVENTS "{slots,topdown-retiring,topdown-bad-spec,topdown-fe-bound,topdown-be-bound,topdown-heavy-ops,topdown-br-mispredict,topdown-fetch-lat,topdown-mem-bound}"
2021-05-26 19:09:36 +00:00
int arch_evlist__add_default_attrs(struct evlist *evlist)
{
if (!pmu_have_event("cpu", "slots"))
return 0;
2021-07-22 16:18:54 +00:00
if (pmu_have_event("cpu", "topdown-heavy-ops"))
return parse_events(evlist, TOPDOWN_L2_EVENTS, NULL);
else
return parse_events(evlist, TOPDOWN_L1_EVENTS, NULL);
2021-05-26 19:09:36 +00:00
}