void ResultParser::_PrintTarget()

in ResultParser/ResultParser.cpp [455:674]


void ResultParser::_PrintTarget(const Target &target, bool fUseThreadsPerFile, bool fUseRequestsPerFile, bool fCompletionRoutines)
{
    if (target.GetPath().c_str()[0] == TEMPLATE_TARGET_PREFIX)
    {
        _Print("\tpath: template target '%s'\n", target.GetPath().c_str() + 1);
    }
    else
    {
        _Print("\tpath: '%s'\n", target.GetPath().c_str());
    }
    _Print("\t\tthink time: %ums\n", target.GetThinkTime());
    _Print("\t\tburst size: %u\n", target.GetBurstSize());
    // TODO: completion routines/ports

    switch (target.GetCacheMode())
    {
        case TargetCacheMode::Cached:
            _Print("\t\tusing software cache\n");
            break;
        case TargetCacheMode::DisableLocalCache:
            _Print("\t\tlocal software cache disabled, remote cache enabled\n");
            break;
        case TargetCacheMode::DisableOSCache:
            _Print("\t\tsoftware cache disabled\n");
            break;
    }

    if (target.GetWriteThroughMode() == WriteThroughMode::On)
    {
        // context-appropriate comment on writethrough
        // if sw cache is disabled, commenting on sw write cache is possibly confusing
        switch (target.GetCacheMode())
        {
        case TargetCacheMode::Cached:
        case TargetCacheMode::DisableLocalCache:
            _Print("\t\thardware and software write caches disabled, writethrough on\n");
            break;
        case TargetCacheMode::DisableOSCache:
            _Print("\t\thardware write cache disabled, writethrough on\n");
            break;
        }
    }
    else
    {
        _Print("\t\tusing hardware write cache, writethrough off\n");
    }

    if (target.GetMemoryMappedIoMode() == MemoryMappedIoMode::On)
    {
        _Print("\t\tmemory mapped I/O enabled");
        switch(target.GetMemoryMappedIoFlushMode())
        {
        case MemoryMappedIoFlushMode::ViewOfFile:
            _Print(", flush mode: FlushViewOfFile");
            break;
        case MemoryMappedIoFlushMode::NonVolatileMemory:
            _Print(", flush mode: FlushNonVolatileMemory");
            break;
        case MemoryMappedIoFlushMode::NonVolatileMemoryNoDrain:
            _Print(", flush mode: FlushNonVolatileMemory with no drain");
            break;
        }
        _Print("\n");
    }

    if (target.GetZeroWriteBuffers())
    {
        _Print("\t\tzeroing write buffers\n");
    }

    if (target.GetRandomDataWriteBufferSize() > 0)
    {
        _Print("\t\twrite buffer size: ");
        _DisplayFileSize(target.GetRandomDataWriteBufferSize());
        _Print("\n");

        string sWriteBufferSourcePath = target.GetRandomDataWriteBufferSourcePath();
        if (!sWriteBufferSourcePath.empty())
        {
            _Print("\t\twrite buffer source: '%s'\n", sWriteBufferSourcePath.c_str());
        }
        else
        {
            _Print("\t\twrite buffer source: random fill\n");
        }
    }

    if (target.GetUseParallelAsyncIO())
    {
        _Print("\t\tusing parallel async I/O\n");
    }

    if (target.GetWriteRatio() == 0)
    {
        _Print("\t\tperforming read test\n");
    }
    else if (target.GetWriteRatio() == 100)
    {
        _Print("\t\tperforming write test\n");
    }
    else
    {
        _Print("\t\tperforming mix test (read/write ratio: %d/%d)\n", 100 - target.GetWriteRatio(), target.GetWriteRatio());
    }

    _Print("\t\tblock size: ");
    _DisplayFileSize(target.GetBlockSizeInBytes());
    _Print("\n");

    if (target.GetRandomRatio() == 100)
    {
        _Print("\t\tusing random I/O (alignment: ");
    }
    else
    {
        if (target.GetRandomRatio() > 0)
        {
            _Print("\t\tusing mixed random/sequential I/O (%u%% random) (alignment/stride: ", target.GetRandomRatio());
        }
        else
        {
            _Print("\t\tusing%s sequential I/O (stride: ", target.GetUseInterlockedSequential() ? " interlocked":"");
        }
    }
    _DisplayFileSize(target.GetBlockAlignmentInBytes());
    _Print(")\n");

    if (fUseRequestsPerFile)
    {
        _Print("\t\tnumber of outstanding I/O operations per thread: %d\n", target.GetRequestCount());
    }
    else
    {
        _Print("\t\trelative IO weight in thread pool: %u\n", target.GetWeight());
    }

    if (0 != target.GetBaseFileOffsetInBytes())
    {
        _Print("\t\tbase file offset: ");
        _DisplayFileSize(target.GetBaseFileOffsetInBytes());
        _Print("\n");
    }

    if (0 != target.GetMaxFileSize())
    {
        _Print("\t\tmax file size: ");
        _DisplayFileSize(target.GetMaxFileSize());
        _Print("\n");
    }

    if (0 != target.GetThreadStrideInBytes())
    {
        _Print("\t\tthread stride size: ");
        _DisplayFileSize(target.GetThreadStrideInBytes());
        _Print("\n");
    }

    if (target.GetSequentialScanHint())
    {
        _Print("\t\tusing FILE_FLAG_SEQUENTIAL_SCAN hint\n");
    }

    if (target.GetRandomAccessHint())
    {
        _Print("\t\tusing FILE_FLAG_RANDOM_ACCESS hint\n");
    }

    if (target.GetTemporaryFileHint())
    {
        _Print("\t\tusing FILE_ATTRIBUTE_TEMPORARY hint\n");
    }

    if (fUseThreadsPerFile)
    {
        _Print("\t\tthreads per file: %d\n", target.GetThreadsPerFile());
    }
    if (target.GetRequestCount() > 1 && fUseThreadsPerFile)
    {
        if (fCompletionRoutines)
        {
            _Print("\t\tusing completion routines (ReadFileEx/WriteFileEx)\n");
        }
        else
        {
            _Print("\t\tusing I/O Completion Ports\n");
        }
    }

    if (target.GetIOPriorityHint() == IoPriorityHintVeryLow)
    {
        _Print("\t\tIO priority: very low\n");
    }
    else if (target.GetIOPriorityHint() == IoPriorityHintLow)
    {
        _Print("\t\tIO priority: low\n");
    }
    else if (target.GetIOPriorityHint() == IoPriorityHintNormal)
    {
        _Print("\t\tIO priority: normal\n");
    }
    else
    {
        _Print("\t\tIO priority: unknown\n");
    }

    if (target.GetThroughputIOPS())
    {
        _Print("\t\tthroughput rate-limited to %u IOPS\n", target.GetThroughputIOPS());
    }
    else if (target.GetThroughputInBytesPerMillisecond())
    {
        _Print("\t\tthroughput rate-limited to %u B/ms\n", target.GetThroughputInBytesPerMillisecond());
    }

    if (target.GetDistributionRange().size())
    {
        _Print("\t\tIO Distribution:\n");
        _PrintDistribution(target.GetDistributionType(), target.GetDistributionRange(), "\t\t");
    }
}