topdown.c (9c3a985f88fa4de82bf4bda906095ce6444e9039) topdown.c (1eaf496ed386934f1c2439a120fe84a05194f91a)
1// SPDX-License-Identifier: GPL-2.0
2#include "api/fs/fs.h"
3#include "util/evsel.h"
4#include "util/pmu.h"
1// SPDX-License-Identifier: GPL-2.0
2#include "api/fs/fs.h"
3#include "util/evsel.h"
4#include "util/pmu.h"
5#include "util/pmus.h"
5#include "util/topdown.h"
6#include "topdown.h"
7#include "evsel.h"
8
9/* Check whether there is a PMU which supports the perf metrics. */
10bool topdown_sys_has_perf_metrics(void)
11{
12 static bool has_perf_metrics;

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

17 return has_perf_metrics;
18
19 /*
20 * The perf metrics feature is a core PMU feature.
21 * The PERF_TYPE_RAW type is the type of a core PMU.
22 * The slots event is only available when the core PMU
23 * supports the perf metrics feature.
24 */
6#include "util/topdown.h"
7#include "topdown.h"
8#include "evsel.h"
9
10/* Check whether there is a PMU which supports the perf metrics. */
11bool topdown_sys_has_perf_metrics(void)
12{
13 static bool has_perf_metrics;

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

18 return has_perf_metrics;
19
20 /*
21 * The perf metrics feature is a core PMU feature.
22 * The PERF_TYPE_RAW type is the type of a core PMU.
23 * The slots event is only available when the core PMU
24 * supports the perf metrics feature.
25 */
25 pmu = perf_pmu__find_by_type(PERF_TYPE_RAW);
26 if (pmu && pmu_have_event(pmu->name, "slots"))
26 pmu = perf_pmus__find_by_type(PERF_TYPE_RAW);
27 if (pmu && perf_pmu__have_event(pmu, "slots"))
27 has_perf_metrics = true;
28
29 cached = true;
30 return has_perf_metrics;
31}
32
33#define TOPDOWN_SLOTS 0x0400
34

--- 16 unchanged lines hidden ---
28 has_perf_metrics = true;
29
30 cached = true;
31 return has_perf_metrics;
32}
33
34#define TOPDOWN_SLOTS 0x0400
35

--- 16 unchanged lines hidden ---