Lines Matching +full:k +full:- +full:to +full:- +full:j

1 // SPDX-License-Identifier: GPL-2.0
11 #include "../perf-sys.h"
13 /* hw: cycles, sw: context-switch, uncore: [arch dependent] */
14 static int types[] = {0, 1, -1};
41 * initialized with disabled set to 1 and any child events are in event_open()
42 * initialized with disabled set to 0. Despite disabled being 0, in event_open()
46 attr.disabled = group_fd == -1 ? 1 : 0; in event_open()
48 return sys_perf_event_open(&attr, -1, 0, group_fd, 0); in event_open()
58 if (!strcmp(uncore_pmus[i].name, pmu->name)) { in setup_uncore_event()
59 pr_debug("Using %s for uncore pmu event\n", pmu->name); in setup_uncore_event()
60 types[2] = pmu->type; in setup_uncore_event()
70 fd = event_open(types[2], configs[2], -1); in setup_uncore_event()
72 return -1; in setup_uncore_event()
78 return -1; in setup_uncore_event()
81 static int run_test(int i, int j, int k) in run_test() argument
83 int erroneous = ((((1 << i) | (1 << j) | (1 << k)) & 5) == 5); in run_test()
86 group_fd = event_open(types[i], configs[i], -1); in run_test()
87 if (group_fd == -1) in run_test()
88 return -1; in run_test()
90 sibling_fd1 = event_open(types[j], configs[j], group_fd); in run_test()
91 if (sibling_fd1 == -1) { in run_test()
93 return erroneous ? 0 : -1; in run_test()
96 sibling_fd2 = event_open(types[k], configs[k], group_fd); in run_test()
97 if (sibling_fd2 == -1) { in run_test()
100 return erroneous ? 0 : -1; in run_test()
106 return erroneous ? -1 : 0; in run_test()
111 int i, j, k; in test__event_groups() local
116 if (ret || types[2] == -1) in test__event_groups()
121 for (j = 0; j < 3; j++) { in test__event_groups()
122 for (k = 0; k < 3; k++) { in test__event_groups()
123 r = run_test(i, j, k); in test__event_groups()
128 types[i], configs[i], types[j], configs[j], in test__event_groups()
129 types[k], configs[k], r ? "Fail" : "Pass"); in test__event_groups()