MMV_INC_VALUE(3)
π MMV_INC_VALUE(3) β Library Functions Manual π
okay bestie, sit down, hydrate, and let me tell you about mmv_inc, mmv_inc_value, and mmv_inc_atomvalue β the lil trio that updates a value in a Memory Mapped Value file. yes, that's the whole vibe. and no, we're not being normal about it. π
β¨ NAME β¨
mmv_inc, mmv_inc_value, mmv_inc_atomvalue β update a value in a Memory Mapped Value file π¦
like. the entire job. update a value. in a Memory Mapped Value file. iconic behaviour, honestly.
πΈ C SYNOPSIS πΈ
first, the summoning circle (a.k.a. the includes):
#include <pcp/pmapi.h>
#include <pcp/mmv_stats.h>
then the actual queens:
void mmv_inc_value(void *addr, pmAtomValue *av, double inc);
void mmv_inc_atomvalue(void *addr, pmAtomValue *av, pmAtomValue *inc);
and don't forget to link the girlies in, or she will not compile, and you will cry:
cc ... -lpcp_mmv -lpcp
π DESCRIPTION π
so mmv_inc_value and mmv_inc_atomvalue are literally just β¨convenientβ¨ little shortcuts for updating a metric av that you already got handed to you earlier by the mmv_lookup_value_desc(3) interface. no cap. and addr? that's the address that came back from mmv_stats_init(3). she's the address, bestie, respect her. π«Ά
now β these interfaces are most commonly used with counter type metrics. if you're out here doing instantaneous or discrete metrics instead, go read mmv_set_value(3) because that's the mechanism built for that job. different girl, different skillset, okay? π
π the two flavours π
mmv_inc_atomvalueβ with this one, the value you pass through theincpointer must match the type of the metric. must. match. it gets added to the previous value of the metric. periodt.mmv_inc_valueβ with this one, the value ofincgets internally cast to match the type of the metric, and then it's added to the previous value of the metric. she does the type-wrangling for you. main character energy, honestly. π
lowkey important: type matching is not a suggestion, it's the law.mmv_inc_atomvaluedoes not cast for you. onlymmv_inc_valuedoes. iykyk. π
π₯ SEE ALSO π₯
the whole friend group, in order, fr fr:
and that's the tea, bestie π go forth and increment responsibly. this page comes to you courtesy of Performance Co-Pilot β MMV_INC_VALUE(3) β mwah, love u, bye πβ¨π§π
π¦ 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: libpcp-mmv1-dev 7.1.1-1
- ubuntu stonking: libpcp-mmv1-dev 7.2.1-2build1
- Copyright (c) 2021 Red Hat
- Copyright (c) 2009 Max Matveev
- Copyright (c) 2009 Aconex. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms