Commit 8cf978bb authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

tests/perf_pmu: Make the invalid-init failure place more obvious

Put the values into the assert so we know which step failed.
Signed-off-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent 6ea85cc7
......@@ -661,7 +661,6 @@ multi_client(int gem_fd, const struct intel_execution_engine2 *e)
static void invalid_init(void)
{
struct perf_event_attr attr;
int pid, cpu;
#define ATTR_INIT() \
do { \
......@@ -674,21 +673,15 @@ do { \
ATTR_INIT();
attr.sample_period = 100;
pid = -1;
cpu = 0;
igt_assert_eq(perf_event_open(&attr, pid, cpu, -1, 0), -1);
igt_assert_eq(perf_event_open(&attr, -1, 0, -1, 0), -1);
igt_assert_eq(errno, EINVAL);
ATTR_INIT();
pid = 0;
cpu = 0;
igt_assert_eq(perf_event_open(&attr, pid, cpu, -1, 0), -1);
igt_assert_eq(perf_event_open(&attr, 0, 0, -1, 0), -1);
igt_assert_eq(errno, EINVAL);
ATTR_INIT();
pid = -1;
cpu = 1;
igt_assert_eq(perf_event_open(&attr, pid, cpu, -1, 0), -1);
igt_assert_eq(perf_event_open(&attr, -1, 1, -1, 0), -1);
igt_assert_eq(errno, ENODEV);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment