Commit 18213532 authored by Athira Rajeev's avatar Athira Rajeev Committed by Michael Ellerman
Browse files

selftests/powerpc: Update bhrb filter sampling test for multiple branch filters



For PERF_SAMPLE_BRANCH_STACK sample type, different branch_sample_type,
ie branch filters are supported. The testcase "bhrb_filter_map_test"
tests the valid and invalid filter maps in different powerpc platforms.
Update this testcase to include scenario to cover multiple branch
filters at sametime. Since powerpc doesn't support multiple filters at
sametime, expect failure during perf_event_open.

Reported-by: default avatarDisha Goel <disgoel@linux.vnet.ibm.com>
Signed-off-by: default avatarAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Reviewed-by: default avatarKajol Jain <kjain@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220921145255.20972-3-atrajeev@linux.vnet.ibm.com
parent b9c00127
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -96,6 +96,15 @@ static int bhrb_filter_map_test(void)
		}
	}

	/*
	 * Combine filter maps which includes a valid branch filter and an invalid branch
	 * filter. Example: any ( PERF_SAMPLE_BRANCH_ANY) and any_call
	 * (PERF_SAMPLE_BRANCH_ANY_CALL).
	 * The perf_event_open should fail in this case.
	 */
	event.attr.branch_sample_type = PERF_SAMPLE_BRANCH_ANY | PERF_SAMPLE_BRANCH_ANY_CALL;
	FAIL_IF(!event_open(&event));

	return 0;
}