libcpumf: Detect PMU named pai_ext

Add a check to detect Processor Activity Instrumentation (PAI)
Extension 1 facility unit.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Thomas Richter
2022-06-21 13:02:46 +02:00
committed by Jan Höppner
parent dc73c77d73
commit 15158ee0ca
3 changed files with 18 additions and 1 deletions
+1
View File
@@ -85,5 +85,6 @@ int main(void)
}
printf("PAI NNPA support %d\n", libcpumf_have_pai_nnpa());
printf("PAI EXTENSION support %d\n", libcpumf_have_pai_ext());
return EXIT_SUCCESS;
}
+7
View File
@@ -147,6 +147,13 @@ bool libcpumf_have_pai_crypto(void)
return (stat(S390_SYSFS_PAI_CRYPTO, &statbuf) == -1) ? false : true;
}
bool libcpumf_have_pai_ext(void)
{
struct stat statbuf;
return (stat(S390_SYSFS_PAI_EXT, &statbuf) == -1) ? false : true;
}
bool libcpumf_have_pai_nnpa(void)
{
struct stat statbuf;