Introduce utils_parse_time_suffix
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 17 Jun 2015 18:07:58 +0000 (14:07 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Mar 2018 02:10:43 +0000 (22:10 -0400)
commit7010c0332387eea98b52f301458d481f151840a6
tree0550d9b6d47e494e02d790a3db98c7e700b868cd
parent22a1b9316f04f95a904ea724ad51aabcc389aca0
Introduce utils_parse_time_suffix

This function is based on utils_parse_size_suffix, but is to parse
(relatively short) time suffixes. It returns the time in microseconds.
So far, it supports:

 - u/us: microseconds, x1, same as no suffix
 - m/ms: milliseconds, x1 000
 - s: seconds, x1 000 000

 For example:

 - 32u becomes 32
 - 32us becomes 32
 - 32m becomes 32 000
 - 32ms becomes 32 000
 - 32s becomes 32 000 000

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/enable_channels.c
src/common/utils.c
src/common/utils.h
tests/unit/Makefile.am
tests/unit/test_utils_parse_time_suffix.c [new file with mode: 0644]
This page took 0.02605 seconds and 4 git commands to generate.