PMPARSETIME(3)
π PMPARSETIME(3) β like, the manual page for parsing time point specs π
Library Functions Manual Β· PCP Β· bestie, we're going internal-dev deep today π«Ά
β¨ NAME β¨
__pmtimevalParse, __pmtimespecParse β parse a time point specification, no cap πΈ
π C SYNOPSIS π
#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
okay so you gotta link against -lpcp, that part is not optional bestie π
π CAVEAT π
READ THIS. FOR REAL. NOT ME DROPPING A CAVEAT FOR DRAMA.
This documentation is intended for internal Performance Co-Pilot (PCP) developer use. It's giving backstage pass, not main-stage.
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. π So like... don't build your whole personality on them, iykyk.
π¦ DESCRIPTION π¦
__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. They're the little translators so the tools don't have to do it themselves, and honestly? Slay. π
These functions expect to be called with the time point specification as string. Literally just hand over the string, that's the vibe.
If the tool is running against PCP archive(s), you also need to supply:
- the start time of the first (only) archive as logStart
- 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 logEnd should have its tv_sec component set to PM_MAX_TIME_T. Yes, uppercase, exactly like that. β
The rslt structure must be allocated before either calling __pmtimevalParse or __pmtimespecParse. Not allocated? That's on you, bestie, the function is not gonna do it for you π
You also need to set the current PCP reporting time zone to correctly reflect the -z and -Z command line parameters before calling __pmtimevalParse or __pmtimespecParse. See pmUseZone(3) and friends for information on how this is done. The time zone thing is lowkey the part people forget and then they're confused, so don't be that person. π
π what you get back π
- If the conversion is successful, both
__pmtimevalParseand__pmtimespecParsereturn0, and fill in rslt with the time value defined by the input parameters. Periodt. β¨ - If the argument strings could not be parsed, it returns
-1and a dynamically allocated error message string in errMsg.
Be sure to free(3) this error message string. It's dynamically allocated, so it's your responsibility now. Free it. Let it go. π
πΈ SEE ALSO πΈ
PMAPI(3)__pmParseCtime(3)__pmtimespecConvert(3)__pmtimevalConvert(3)pmGetArchiveEnd(3)pmGetArchiveLabel(3)pmNewContextZone(3)pmNewZone(3)pmParseInterval(3)pmParseTimeWindow(3)pmUseZone(3)
Like, the whole friend group, fr fr. Go read them, they're iconic. πβ¨
Performance Co-Pilot Β· PCP Β· PMPARSETIME(3)
That's the whole page bestie, from the Performance Co-Pilot girlies at PCP. Mwah, go parse some time, you absolute main character. ππ¦π
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2022 Red Hat
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms