Source
SET_UI64_RESULT(result, m.numperm << ZBX_PERFSTAT_PAGE_SHIFT); /* number of pages used for files */
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static perfstat_memory_total_t m;
/* 4 KB */
static int vm_memory_total(AGENT_RESULT *result)
{
ZBX_PERFSTAT_MEMORY_TOTAL();
/* total real memory in pages */
SET_UI64_RESULT(result, m.real_total << ZBX_PERFSTAT_PAGE_SHIFT);
return SYSINFO_RET_OK;
}
static int vm_memory_pinned(AGENT_RESULT *result)
{
ZBX_PERFSTAT_MEMORY_TOTAL();
/* real memory which is pinned in pages */
SET_UI64_RESULT(result, m.real_pinned << ZBX_PERFSTAT_PAGE_SHIFT);
return SYSINFO_RET_OK;
}
static int vm_memory_free(AGENT_RESULT *result)
{
ZBX_PERFSTAT_MEMORY_TOTAL();
/* free real memory in pages */
SET_UI64_RESULT(result, m.real_free << ZBX_PERFSTAT_PAGE_SHIFT);