selftests/resctrl: Clean up resctrl features check

Checking resctrl features call strcmp() to compare feature strings
(e.g. "mba", "cat" etc). The checkings are error prone and don't have
good coding style. Define the constant strings in macros and call
strncmp() to solve the potential issues.

Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Tested-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Fenghua Yu
2021-03-17 02:22:38 +00:00
committed by Shuah Khan
parent 896016d2ad
commit 2428673638
10 changed files with 41 additions and 35 deletions
@@ -62,6 +62,11 @@ struct resctrl_val_param {
int (*setup)(int num, ...);
};
#define MBM_STR "mbm"
#define MBA_STR "mba"
#define CQM_STR "cqm"
#define CAT_STR "cat"
extern pid_t bm_pid, ppid;
extern int tests_run;