Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) #include "tests.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #include "debug.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) #include "evlist.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #include "cgroup.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) #include "rblist.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include "metricgroup.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include "parse-events.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include "pmu-events/pmu-events.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "pfm.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <subcmd/parse-options.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <stdio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <stdlib.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <string.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) static int test_expand_events(struct evlist *evlist,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) 			      struct rblist *metric_events)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) 	int i, ret = TEST_FAIL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 	int nr_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 	bool was_group_event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 	int nr_members;  /* for the first evsel only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	const char cgrp_str[] = "A,B,C";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 	const char *cgrp_name[] = { "A", "B", "C" };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	int nr_cgrps = ARRAY_SIZE(cgrp_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 	char **ev_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 	struct evsel *evsel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	TEST_ASSERT_VAL("evlist is empty", !perf_evlist__empty(evlist));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 	nr_events = evlist->core.nr_entries;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	ev_name = calloc(nr_events, sizeof(*ev_name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	if (ev_name == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 		pr_debug("memory allocation failure\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 		return TEST_FAIL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	i = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	evlist__for_each_entry(evlist, evsel) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 		ev_name[i] = strdup(evsel->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 		if (ev_name[i] == NULL) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 			pr_debug("memory allocation failure\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 			goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 		i++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	/* remember grouping info */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	was_group_event = evsel__is_group_event(evlist__first(evlist));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	nr_members = evlist__first(evlist)->core.nr_members;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	ret = evlist__expand_cgroup(evlist, cgrp_str, metric_events, false);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		pr_debug("failed to expand events for cgroups\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	ret = TEST_FAIL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	if (evlist->core.nr_entries != nr_events * nr_cgrps) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 		pr_debug("event count doesn't match\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	i = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	evlist__for_each_entry(evlist, evsel) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		if (strcmp(evsel->name, ev_name[i % nr_events])) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 			pr_debug("event name doesn't match:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 			pr_debug("  evsel[%d]: %s\n  expected: %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 				 i, evsel->name, ev_name[i % nr_events]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 			goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		if (strcmp(evsel->cgrp->name, cgrp_name[i / nr_events])) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 			pr_debug("cgroup name doesn't match:\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 			pr_debug("  evsel[%d]: %s\n  expected: %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 				 i, evsel->cgrp->name, cgrp_name[i / nr_events]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 			goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		if ((i % nr_events) == 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 			if (evsel__is_group_event(evsel) != was_group_event) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 				pr_debug("event group doesn't match: got %s, expect %s\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 					 evsel__is_group_event(evsel) ? "true" : "false",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 					 was_group_event ? "true" : "false");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 				goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 			if (evsel->core.nr_members != nr_members) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 				pr_debug("event group member doesn't match: %d vs %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 					 evsel->core.nr_members, nr_members);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 				goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		i++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	ret = TEST_OK;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) out:	for (i = 0; i < nr_events; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 		free(ev_name[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	free(ev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) static int expand_default_events(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	struct evlist *evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	struct rblist metric_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	evlist = perf_evlist__new_default();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	TEST_ASSERT_VAL("failed to get evlist", evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	rblist__init(&metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	ret = test_expand_events(evlist, &metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	evlist__delete(evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) static int expand_group_events(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	struct evlist *evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	struct rblist metric_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	struct parse_events_error err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	const char event_str[] = "{cycles,instructions}";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	symbol_conf.event_group = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	evlist = evlist__new();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	TEST_ASSERT_VAL("failed to get evlist", evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	ret = parse_events(evlist, event_str, &err);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 		pr_debug("failed to parse event '%s', err %d, str '%s'\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 			 event_str, ret, err.str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 		parse_events_print_error(&err, event_str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	rblist__init(&metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	ret = test_expand_events(evlist, &metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	evlist__delete(evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) static int expand_libpfm_events(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	struct evlist *evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	struct rblist metric_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	const char event_str[] = "CYCLES";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	struct option opt = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		.value = &evlist,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	symbol_conf.event_group = true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	evlist = evlist__new();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	TEST_ASSERT_VAL("failed to get evlist", evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	ret = parse_libpfm_events_option(&opt, event_str, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		pr_debug("failed to parse libpfm event '%s', err %d\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			 event_str, ret);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	if (perf_evlist__empty(evlist)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 		pr_debug("libpfm was not enabled\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	rblist__init(&metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	ret = test_expand_events(evlist, &metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 	evlist__delete(evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) static int expand_metric_events(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	struct evlist *evlist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	struct rblist metric_events;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 	const char metric_str[] = "CPI";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	struct pmu_event pme_test[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 		{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 			.metric_expr	= "instructions / cycles",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 			.metric_name	= "IPC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 			.metric_expr	= "1 / IPC",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 			.metric_name	= "CPI",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		{
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 			.metric_expr	= NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 			.metric_name	= NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 		},
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	struct pmu_events_map ev_map = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 		.cpuid		= "test",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 		.version	= "1",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 		.type		= "core",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		.table		= pme_test,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	evlist = evlist__new();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	TEST_ASSERT_VAL("failed to get evlist", evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	rblist__init(&metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 	ret = metricgroup__parse_groups_test(evlist, &ev_map, metric_str,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 					     false, false, &metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	if (ret < 0) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 		pr_debug("failed to parse '%s' metric\n", metric_str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	ret = test_expand_events(evlist, &metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 	metricgroup__rblist_exit(&metric_events);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	evlist__delete(evlist);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) int test__expand_cgroup_events(struct test *test __maybe_unused,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			       int subtest __maybe_unused)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	int ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	ret = expand_default_events();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 	TEST_ASSERT_EQUAL("failed to expand default events", ret, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 	ret = expand_group_events();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 	TEST_ASSERT_EQUAL("failed to expand event group", ret, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	ret = expand_libpfm_events();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 	TEST_ASSERT_EQUAL("failed to expand event group", ret, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 	ret = expand_metric_events();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 	TEST_ASSERT_EQUAL("failed to expand metric events", ret, 0);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) }