Skip to content

Commit

Permalink
DISKSPD 2.1 (#152)
Browse files Browse the repository at this point in the history
DISKSPD 2.1 7/1/2021

* New `-g<n>i` form allowing throughput limit specification in units of IOPS (per specified blocksize)
* New `-rs<pct>` to specify mixed random/sequential operation (pct random); geometric distribution of run lengths
* New `-rd<distribution>` to specify non-uniform IO distributions across target
  * `pct` by target percentage
  * `abs` by absolute offset
* New `-Rp<text|xml>` to show specified parameter set in indicated profile output form; works with -X XML profiles and conventional command line
* XML results/profiles are now indented for ease of review
* Text result output updates
  * now shows values in size units (K/M/G, and now TiB) to two decimals
  * thread stride no longer shown unless specified
  * -F/-O threadpool parameters shown
* XML profiles can now be built more generically
  * XML profiles can be stated in terms of templated target names (*1, *2), replaced in order from command line invocation
  * the command line now allows options alongside -X: -v, -z, -R and -W/-d/-C along with template target specs

Co-authored-by: Dan Lovinger <[email protected]>
  • Loading branch information
dl2n and Dan Lovinger authored Sep 20, 2021
1 parent c60b6ea commit 733042c
Show file tree
Hide file tree
Showing 39 changed files with 6,794 additions and 1,959 deletions.
1,188 changes: 856 additions & 332 deletions CmdLineParser/CmdLineParser.cpp

Large diffs are not rendered by default.

50 changes: 22 additions & 28 deletions CmdRequestCreator/CmdRequestCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,6 @@ static HANDLE g_hAbortEvent = NULL; // handle to the 'abort' event
static HANDLE g_hEventStarted = NULL; // event signalled to notify that the actual (measured) test is to be started
static HANDLE g_hEventFinished = NULL; // event signalled to notify that the actual test has finished

/*****************************************************************************/
// wrapper for printf. printf cannot be used directly, because IORequestGenerator.dll
// may be consumed by gui app which doesn't have stdout
void WINAPI PrintOut(const char *format, va_list args)
{
vprintf(format, args);
}

/*****************************************************************************/
// wrapper for fprintf. fprintf cannot be used directly, because IORequestGenerator.dll
// may be consumed by gui app which doesn't have stdout
void WINAPI PrintError(const char *format, va_list args)
{
vfprintf(stderr, format, args);
}

/*****************************************************************************/
BOOL WINAPI ctrlCRoutine(DWORD dwCtrlType)
{
Expand Down Expand Up @@ -123,6 +107,27 @@ int __cdecl main(int argc, const char* argv[])
return ERROR_PARSE_CMD_LINE;
}

// Instantiate parsers
ResultParser resultParser;
XmlResultParser xmlResultParser;
IResultParser *pResultParser = nullptr;
if (profile.GetResultsFormat() == ResultsFormat::Xml)
{
pResultParser = &xmlResultParser;
}
else
{
pResultParser = &resultParser;
}

// Profile only? If so, complete now.
if (profile.GetProfileOnly())
{
string s = pResultParser->ParseProfile(profile);
printf("%s", s.c_str());
return 0;
}

synch.pfnCallbackTestStarted = TestStarted;
synch.pfnCallbackTestFinished = TestFinished;

Expand Down Expand Up @@ -157,20 +162,9 @@ int __cdecl main(int argc, const char* argv[])
//
// call IO request generator
//
ResultParser resultParser;
XmlResultParser xmlResultParser;
IResultParser *pResultParser = nullptr;
if (profile.GetResultsFormat() == ResultsFormat::Xml)
{
pResultParser = &xmlResultParser;
}
else
{
pResultParser = &resultParser;
}

IORequestGenerator ioGenerator;
if (!ioGenerator.GenerateRequests(profile, *pResultParser, (PRINTF)PrintOut, (PRINTF)PrintError, (PRINTF)PrintOut, &synch))
if (!ioGenerator.GenerateRequests(profile, *pResultParser, &synch))
{
if (profile.GetResultsFormat() == ResultsFormat::Xml)
{
Expand Down
16 changes: 12 additions & 4 deletions Common/CmdLineParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,26 @@ class CmdLineParser
bool ParseCmdLine(const int argc, const char *argv[], Profile *pProfile, struct Synchronization *synch, SystemInformation *pSystem = nullptr);

private:
bool _ReadParametersFromCmdLine(const int argc, const char *argv[], Profile *pProfile, struct Synchronization *synch);
bool _ReadParametersFromXmlFile(const char *pszPath, Profile *pProfile);
bool _ReadParametersFromCmdLine(const int argc, const char *argv[], Profile *pProfile, struct Synchronization *synch, bool& fXMLProfile);
bool _ReadParametersFromXmlFile(const char *pszPath, Profile *pProfile, vector<Target> *pvSubstTargets);

bool _ParseETWParameter(const char *arg, Profile *pProfile);
bool _ParseFlushParameter(const char *arg, MemoryMappedIoFlushMode *FlushMode );
bool _ParseAffinity(const char *arg, TimeSpan *pTimeSpan);
bool _ParseRandomDistribution(const char *arg, vector<Target>& vTargets);

void _DisplayUsageInfo(const char *pszFilename) const;
bool _GetSizeInBytes(const char *pszSize, UINT64& ullSize) const;
bool _GetSizeInBytes(const char *pszSize, UINT64& ullSize, const char **pszRest) const;
bool _GetRandomDataWriteBufferData(const string& sArg, UINT64& cb, string& sPath);

// variables that used to be global
static bool _IsSwitchChar(const char c) { return (c == '/' || c == '-'); }
enum class ParseState {
Unknown,
True,
False,
Bad
};

DWORD _dwBlockSize; // block size; other parameters may be stated in blocks
// so the block size is needed to process them

Expand Down
Loading

0 comments on commit 733042c

Please sign in to comment.