pmParseUnitsStr is designed to encapsulate the interpretation of a
units (dimension and scale) specification in command line switches
for use by the PCP client tools.
This function expects to be called with the unit/scale specification
as string. This specification takes the general form produced by
pmUnitsStr(3). Briefly, the format allows /-separated divisor and
dividend, each listing space-separated dimensions/scales along the
space, time, and count axes. There are also a few extra
First, multiple equivalent sets of keywords are accepted for the time
and space dimensions, insensitive to case. For example,
"microseconds", "microsecond", "microsec", "us" are considered
synonymous, as are "kilobytes", "KB", "KiB", "kiloByte", and so on.
Second, units may be offered in any order, e.g., ms kb count x 10^3
or count x 10^3 kb ms. They may not be repeated within the
denominator or within the numerator. Each scale/unit keyword may be
immediately followed by positive or negative exponents, e.g., ^-4.
Third, numerical scaling factors may be supplied. These are factored
together with implicit scale conversions into the final outMult
The out and outMult values must both be allocated before calling
pmParseUnitsStr(3). If the conversion is successful, pmParseUnitsStr
returns 0, and fills in out and outMult with the unit/scales defined
by the input parameter. If the argument strings could not be parsed,
it returns a negative status code.
For backward compatibility, this interface interprets several
traditional computer science interpretations of space units
incorrectly by the International System of Units (SI) standard.
The accepted unit string - in either singular or plural form - and
the pmParseUnitsStr interpretation for each are: megabyte(mebibyte),
gigabyte(gibibyte), terabyte(tebibyte), petabyte(pebibyte),
exabyte(exbibyte), zettabyte(zebibyte) and yottabyte(yobibyte).
This page is part of the PCP (Performance Co-Pilot) project.
Information about the project can be found at ⟨http://www.pcp.io/⟩.
If you have a bug report for this manual page, send it to
email@example.com. This page was obtained from the project's upstream
Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on
2020-08-13. (At that time, the date of the most recent commit that
was found in the repository was 2020-08-11.) If you discover any
rendering problems in this HTML version of the page, or you believe
there is a better or more up-to-date source for the page, or you have
corrections or improvements to the information in this COLOPHON
(which is not part of the original manual page), send a mail to
Performance Co-Pilot PCP PMPARSEUNITSSTR(3)