int main(int argc, char *argv[]) { int ret_val = 1; #ifndef __i386__ tst_brkm(TCONF, NULL, "This test suite can only execute on i386 architecture."); #else ret_val = check_ht_capability(); #endif return ret_val; }
// return 0 means Pass, return 1 means Fail int main(int argc, char *argv[]) { tst_resm(TINFO, "Begin: HyperThreading Affinity"); #ifndef ARCH_i386 tst_brkm(TCONF, NULL, "This test suite can only excute on i386 architecture."); #else if (!check_ht_capability()) { if(HT_GetAffinity()) tst_resm(TPASS, "System call getaffinity() is OK."); else tst_resm(TFAIL, "System call getaffinity() is error."); printf("\n"); if(HT_InheritAffinity()) tst_resm(TPASS, "Inheritance of affinity is OK."); else tst_resm(TFAIL, "Inheritance of affinity is error."); printf("\n"); if(HT_SetAffinity()) tst_resm(TPASS, "System call setaffinity() is OK."); else tst_resm(TFAIL, "System call setaffinity() is error."); } else { tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); } #endif tst_resm(TINFO, "End: HyperThreading Affinity"); return 0; }
// return 0 means Pass, return 1 means Fail. int main(int argc, char *argv[]) { tst_resm(TINFO, "Begin: HyperThreading Interrupt"); #if (!defined __i386__ && !defined __x86_64__) tst_brkm(TCONF, NULL, "This test suite can only execute on x86 architecture."); #else if (!check_ht_capability()) { if (HT_InterruptDistribution()) tst_resm(TPASS, "Interrupt distribution is balanceable."); else tst_resm(TFAIL, "Interrupt distribution is not balanceable."); } else { tst_brkm(TCONF, NULL, "HT is not enabled or not supported."); } #endif tst_resm(TINFO, "End: HyperThreading Interrupt"); tst_exit(); }