event_update.c (05909cd9a0c8811731b38697af13075e8954314f) event_update.c (606e2c29334556797e1639115bd198aedb331f07)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/compiler.h>
3#include <perf/cpumap.h>
4#include <string.h>
5#include "cpumap.h"
6#include "evlist.h"
7#include "evsel.h"
8#include "header.h"

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

80 TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
81 TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
82 perf_cpu_map__put(map);
83 return 0;
84}
85
86int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused)
87{
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/compiler.h>
3#include <perf/cpumap.h>
4#include <string.h>
5#include "cpumap.h"
6#include "evlist.h"
7#include "evsel.h"
8#include "header.h"

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

80 TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
81 TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
82 perf_cpu_map__put(map);
83 return 0;
84}
85
86int test__event_update(struct test *test __maybe_unused, int subtest __maybe_unused)
87{
88 struct evlist *evlist;
89 struct evsel *evsel;
90 struct event_name tmp;
88 struct evsel *evsel;
89 struct event_name tmp;
90 struct evlist *evlist = evlist__new_default();
91
91
92 evlist = perf_evlist__new_default();
93 TEST_ASSERT_VAL("failed to get evlist", evlist);
94
95 evsel = evlist__first(evlist);
96
97 TEST_ASSERT_VAL("failed to allocate ids",
98 !perf_evsel__alloc_id(&evsel->core, 1, 1));
99
100 perf_evlist__id_add(&evlist->core, &evsel->core, 0, 0, 123);

--- 24 unchanged lines hidden ---
92 TEST_ASSERT_VAL("failed to get evlist", evlist);
93
94 evsel = evlist__first(evlist);
95
96 TEST_ASSERT_VAL("failed to allocate ids",
97 !perf_evsel__alloc_id(&evsel->core, 1, 1));
98
99 perf_evlist__id_add(&evlist->core, &evsel->core, 0, 0, 123);

--- 24 unchanged lines hidden ---