evsel.c (7b100989b4f6bce7090ef89badf4091b1730d14c) evsel.c (1eaf496ed386934f1c2439a120fe84a05194f91a)
1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h>
3#include <stdlib.h>
4#include "util/evsel.h"
5#include "util/env.h"
6#include "util/pmu.h"
1// SPDX-License-Identifier: GPL-2.0
2#include <stdio.h>
3#include <stdlib.h>
4#include "util/evsel.h"
5#include "util/env.h"
6#include "util/pmu.h"
7#include "util/pmus.h"
7#include "linux/string.h"
8#include "evsel.h"
9#include "util/debug.h"
10
11#define IBS_FETCH_L3MISSONLY (1ULL << 59)
12#define IBS_OP_L3MISSONLY (1ULL << 16)
13
14void arch_evsel__set_sample_weight(struct evsel *evsel)

--- 10 unchanged lines hidden (view full) ---

25 * The PERF_TYPE_RAW type is the core PMU type, e.g., "cpu" PMU
26 * on a non-hybrid machine, "cpu_core" PMU on a hybrid machine.
27 * The slots event is only available for the core PMU, which
28 * supports the perf metrics feature.
29 * Checking both the PERF_TYPE_RAW type and the slots event
30 * should be good enough to detect the perf metrics feature.
31 */
32 if ((evsel->core.attr.type == PERF_TYPE_RAW) &&
8#include "linux/string.h"
9#include "evsel.h"
10#include "util/debug.h"
11
12#define IBS_FETCH_L3MISSONLY (1ULL << 59)
13#define IBS_OP_L3MISSONLY (1ULL << 16)
14
15void arch_evsel__set_sample_weight(struct evsel *evsel)

--- 10 unchanged lines hidden (view full) ---

26 * The PERF_TYPE_RAW type is the core PMU type, e.g., "cpu" PMU
27 * on a non-hybrid machine, "cpu_core" PMU on a hybrid machine.
28 * The slots event is only available for the core PMU, which
29 * supports the perf metrics feature.
30 * Checking both the PERF_TYPE_RAW type and the slots event
31 * should be good enough to detect the perf metrics feature.
32 */
33 if ((evsel->core.attr.type == PERF_TYPE_RAW) &&
33 pmu_have_event(pmu_name, "slots"))
34 perf_pmus__have_event(pmu_name, "slots"))
34 return true;
35
36 return false;
37}
38
39bool arch_evsel__must_be_in_group(const struct evsel *evsel)
40{
41 if (!evsel__sys_has_perf_metrics(evsel))

--- 51 unchanged lines hidden (view full) ---

93 }
94 is_amd = 1;
95 }
96
97 evsel_pmu = evsel__find_pmu(evsel);
98 if (!evsel_pmu)
99 return;
100
35 return true;
36
37 return false;
38}
39
40bool arch_evsel__must_be_in_group(const struct evsel *evsel)
41{
42 if (!evsel__sys_has_perf_metrics(evsel))

--- 51 unchanged lines hidden (view full) ---

94 }
95 is_amd = 1;
96 }
97
98 evsel_pmu = evsel__find_pmu(evsel);
99 if (!evsel_pmu)
100 return;
101
101 ibs_fetch_pmu = perf_pmu__find("ibs_fetch");
102 ibs_op_pmu = perf_pmu__find("ibs_op");
102 ibs_fetch_pmu = perf_pmus__find("ibs_fetch");
103 ibs_op_pmu = perf_pmus__find("ibs_op");
103
104 if (ibs_fetch_pmu && ibs_fetch_pmu->type == evsel_pmu->type) {
105 if (attr->config & IBS_FETCH_L3MISSONLY) {
106 ibs_l3miss_warn();
107 warned_once = 1;
108 }
109 } else if (ibs_op_pmu && ibs_op_pmu->type == evsel_pmu->type) {
110 if (attr->config & IBS_OP_L3MISSONLY) {
111 ibs_l3miss_warn();
112 warned_once = 1;
113 }
114 }
115}
104
105 if (ibs_fetch_pmu && ibs_fetch_pmu->type == evsel_pmu->type) {
106 if (attr->config & IBS_FETCH_L3MISSONLY) {
107 ibs_l3miss_warn();
108 warned_once = 1;
109 }
110 } else if (ibs_op_pmu && ibs_op_pmu->type == evsel_pmu->type) {
111 if (attr->config & IBS_OP_L3MISSONLY) {
112 ibs_l3miss_warn();
113 warned_once = 1;
114 }
115 }
116}