Beispiel #1
0
def reset_first_10_frames_in_config(path):
    """
    Reset the first 10 frames of the config
    """
    num_frames = 10
    cfg = status.FileBasedConfiguration(path, num_frames, frame.FrameStatus)
    with cfg.open() as s:
        for idx in xrange(0, num_frames):
            stat = s[idx]
            stat.last_successful_test = 0
            stat.last_failed_test = idx

    with cfg.open() as s:
        for idx in xrange(0, num_frames):
            stat = s[idx]
            if (stat.last_successful_test != 0) or (stat.last_failed_test !=
                                                    idx):
                print("Error @%d: got %s" % (idx, stat))
Beispiel #2
0
    path = options.status_file

    timestamping = status.TimestampingFacility()

    pageflags = kpage.FlagsDataSource('flags', "/proc/kpageflags").open()
    pagecount = kpage.CountDataSource('count', "/proc/kpagecount").open()

    num_frames = pageflags.num_frames()

    if "frame-by-frame" == options.strategy:
        frame_config_class = scheduling.simple.get_frame_config_class()
    elif "blockwise" == options.strategy:
        frame_config_class = scheduling.blockwise.get_frame_config_class()

    cfg = status.FileBasedConfiguration(path, num_frames, frame_config_class)

    device_name = "/dev/phys_mem"
    physmem_dev = physmem.Physmem(device_name)

    allowed_sources = physmem.SOURCE_FREE_BUDDY_PAGE

    if "linear" == options.algorithm:
        test = tester.LinearScanner(PrintTestReporting())
    elif "quadratic" == options.algorithm:
        test = tester.QuadraticScanner(PrintTestReporting())

    reporting = PrintSchedulerReporting(options.report_every)

    if "frame-by-frame" == options.strategy:
        scheduler_factory = scheduling.simple.SimpleSchedulerFactory(