__pmparsetime(3) — Linux manual page

NAME | C SYNOPSIS | CAVEAT | DESCRIPTION | SEE ALSO | COLOPHON

PMPARSETIME(3)           Library Functions Manual          PMPARSETIME(3)

NAME         top

       __pmtimevalParse, __pmtimespecParse - parse time point
       specification

C SYNOPSIS         top

       #include "pmapi.h"
       #include "libpcp.h"

       int __pmtimevalParse(const char *string, struct timeval *logStart,
                            struct timeval *logEnd, struct timeval *rslt,
                            char **errMsg);
       int __pmtimespecParse(const char *string,
                             struct timespec *logStart,
                             struct timespec *logEnd,
                             struct timespec *rslt, char **errMsg);

       cc ... -lpcp

CAVEAT         top

       This  documentation  is intended for internal Performance Co-Pilot
       (PCP) developer use.

       These interfaces are not part of the PCP APIs that are  guaranteed
       to  remain  fixed  across  releases, and they may not work, or may
       provide different semantics at some point in the future.

DESCRIPTION         top

       __pmtimevalParse and __pmtimespecParse are designed to encapsulate
       the interpretation of a time point specification in  command  line
       switches for use by the PCP client tools.

       These  functions expects to be called with the time point specifi‐
       cation as string.  If the tool is running against PCP  archive(s),
       you also need to supply the start time of the first (only) archive
       as  logStart,  and  the  end of the last (only) archive as logEnd.
       See pmGetArchiveLabel(3) and pmGetArchiveEnd(3) for how to  obtain
       values  for  these  parameters.   If the tool is running against a
       live feed of performance data, logStart should be the current time
       (but could be aligned on the next second for example),  while  lo‐
       gEnd should have its tv_sec component set to PM_MAX_TIME_T.

       The  rslt  structure must be allocated before either calling __pm‐
       timevalParse or __pmtimespecParse.

       You also need to set the current PCP reporting time zone  to  cor‐
       rectly  reflect the -z and -Z command line parameters before call‐
       ing __pmtimevalParse or __pmtimespecParse.  See  pmUseZone(3)  and
       friends for information on how this is done.

       If  the  conversion is successful, both __pmtimevalParse and __pm‐
       timespecParse return 0, and fill in rslt with the time  value  de‐
       fined  by the input parameters.  If the argument strings could not
       be parsed, it returns -1 and a dynamically allocated error message
       string in errMsg.  Be sure to free(3) this error message string.

SEE ALSO         top

       PMAPI(3), __pmParseCtime(3), __pmtimespecConvert(3),  __pmtimeval‐
       Convert(3),        pmGetArchiveEnd(3),       pmGetArchiveLabel(3),
       pmNewContextZone(3),       pmNewZone(3),       pmParseInterval(3),
       pmParseTimeWindow(3) and pmUseZone(3).

COLOPHON         top

       This  page is part of the PCP (Performance Co-Pilot) project.  In‐
       formation 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 protected].  This page was obtained from the project's upstream
       Git repository ⟨https://github.com/performancecopilot/pcp.git⟩  on
       2025-08-11.   (At  that  time,  the date of the most recent commit
       that was found in the repository was 2025-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 [email protected]

Performance Co-Pilot               PCP                     PMPARSETIME(3)

Pages that refer to this page: __pmconverttime(3)__pmparsectime(3)