diff options
Diffstat (limited to 'tools/perf/tests/event_update.c')
-rw-r--r-- | tools/perf/tests/event_update.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c index f14dcd613438..cac4290e233a 100644 --- a/tools/perf/tests/event_update.c +++ b/tools/perf/tests/event_update.c @@ -1,8 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/compiler.h> +#include <perf/cpumap.h> +#include <string.h> #include "evlist.h" #include "evsel.h" +#include "header.h" #include "machine.h" +#include "tool.h" #include "tests.h" #include "debug.h" @@ -11,7 +15,7 @@ static int process_event_unit(struct perf_tool *tool __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event *) event; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; TEST_ASSERT_VAL("wrong id", ev->id == 123); TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__UNIT); @@ -24,10 +28,10 @@ static int process_event_scale(struct perf_tool *tool __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event *) event; - struct event_update_event_scale *ev_data; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; + struct perf_record_event_update_scale *ev_data; - ev_data = (struct event_update_event_scale *) ev->data; + ev_data = (struct perf_record_event_update_scale *)ev->data; TEST_ASSERT_VAL("wrong id", ev->id == 123); TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__SCALE); @@ -46,7 +50,7 @@ static int process_event_name(struct perf_tool *tool, struct machine *machine __maybe_unused) { struct event_name *tmp = container_of(tool, struct event_name, tool); - struct event_update_event *ev = (struct event_update_event*) event; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; TEST_ASSERT_VAL("wrong id", ev->id == 123); TEST_ASSERT_VAL("wrong id", ev->type == PERF_EVENT_UPDATE__NAME); @@ -59,11 +63,11 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused) { - struct event_update_event *ev = (struct event_update_event*) event; - struct event_update_event_cpus *ev_data; - struct cpu_map *map; + struct perf_record_event_update *ev = (struct perf_record_event_update *)event; + struct perf_record_event_update_cpus *ev_data; + struct perf_cpu_map *map; - ev_data = (struct event_update_event_cpus*) ev->data; + ev_data = (struct perf_record_event_update_cpus *) ev->data; map = cpu_map__new_data(&ev_data->cpus); @@ -73,14 +77,14 @@ static int process_event_cpus(struct perf_tool *tool __maybe_unused, TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1); TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2); TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3); - cpu_map__put(map); + perf_cpu_map__put(map); return 0; } int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused) { - struct perf_evlist *evlist; - struct perf_evsel *evsel; + struct evlist *evlist; + struct evsel *evsel; struct event_name tmp; evlist = perf_evlist__new_default(); @@ -108,11 +112,11 @@ int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unu TEST_ASSERT_VAL("failed to synthesize attr update name", !perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name)); - evsel->own_cpus = cpu_map__new("1,2,3"); + evsel->core.own_cpus = perf_cpu_map__new("1,2,3"); TEST_ASSERT_VAL("failed to synthesize attr update cpus", !perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus)); - cpu_map__put(evsel->own_cpus); + perf_cpu_map__put(evsel->core.own_cpus); return 0; } |