libcpumf: Detect PMU pai_nnpa

Add a check to detect Processor Activity Instrumentation (PAI)
Extension 1 facility unit. This covers the counter set for
Neural Network Processing Assist (NNPA) counters.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Thomas Richter
2022-05-05 10:54:38 +02:00
committed by Jan Höppner
parent d7b1cbad8b
commit 130880159a
3 changed files with 19 additions and 0 deletions
+2
View File
@@ -83,5 +83,7 @@ int main(void)
printf("PMU type 10 PMU name %s\n", pmuname);
free(pmuname);
}
printf("PAI NNPA support %d\n", libcpumf_have_pai_nnpa());
return EXIT_SUCCESS;
}
+7
View File
@@ -146,3 +146,10 @@ bool libcpumf_have_pai_crypto(void)
return (stat(S390_SYSFS_PAI_CRYPTO, &statbuf) == -1) ? false : true;
}
bool libcpumf_have_pai_nnpa(void)
{
struct stat statbuf;
return (stat(S390_SYSFS_PAI_NNPA, &statbuf) == -1) ? false : true;
}