示例#1
0
文件: TESTS.py 项目: zzz845zz/pmdk
    def create_match(self, variant, oper, store_type):
        match = ""
        if variant == VARIANT_LIBC:
            if oper == "C" or oper == "M":
                match = "memmove_nodrain_libc"
            elif oper == "S":
                match = "memset_nodrain_libc"
            return match

        if variant == VARIANT_GENERIC:
            if oper == "C" or oper == "M":
                match = "memmove_nodrain_generic"
            elif oper == "S":
                match = "memset_nodrain_generic"
            return match

        if oper in ("C", "M"):
            match += "memmove_mov"
        elif oper == "S":
            match += "memset_mov"
        else:
            raise futils.Fail("Operation: {} not supported.".format(oper))

        if store_type == "nt":
            match += store_type

        if variant == VARIANT_SSE2:
            match += "_sse2"
        elif variant == VARIANT_AVX:
            match += "_avx"
        else:
            match += "_avx512f"

        return match
示例#2
0
    def create_match(self, oper, store_type):
        match = ""
        if "PMEM_NO_MOVNT" in self.envs:
            if "PMEM_NO_GENERIC_MEMCPY" in self.envs:
                if oper == "C" or oper == "M":
                    match = "memmove_nodrain_libc"
                elif oper == "S":
                    match = "memset_nodrain_libc"
            else:
                if oper == "C" or oper == "M":
                    match = "memmove_nodrain_generic"
                elif oper == "S":
                    match = "memset_nodrain_generic"
            return match

        if oper in ("C", "M"):
            match += "memmove_mov"
        elif oper == "S":
            match += "memset_mov"
        else:
            raise futils.Fail("Operation: {} not supported.".format(oper))

        if store_type == "nt":
            match += store_type

        if "PMEM_AVX" in self.envs:
            match += "_avx"
        elif "PMEM_AVX512F" in self.envs:
            match += "_avx512f"
        else:
            match += "_sse2"

        return match
示例#3
0
文件: TESTS.py 项目: zzz845zz/pmdk
    def check_log(self, ctx, match, type, flag):
        with open(self.log_files['pmem2'], 'r') as f:
            str_val = f.read()

            # count function match, only one log should occur at the time
            count = str_val.count(match)
            if count != 1:
                raise futils.Fail("Pattern: {} occurs {} times. One expected. "
                                  "Type: {} Flag id: {}".format(
                                      match, count, type, flag))