Source
xxxxxxxxxx
/* collector layout is designed to be cache-friendly for updates and large number of CPUs */
/*
** Zabbix
** Copyright (C) 2001-2025 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.
**/
typedef struct
{
zbx_perf_counter_data_t **cpu_counter;
zbx_perf_counter_data_t *queue_counter;
int count;
}
ZBX_CPUS_STAT_DATA;
int get_cpu_perf_counter_value(int cpu_num, int interval, double *value, char **error);
/* not _WINDOWS */
typedef struct
{
zbx_uint64_t h_counter[ZBX_CPU_STATE_COUNT][MAX_COLLECTOR_HISTORY];
unsigned char h_status[MAX_COLLECTOR_HISTORY];
unsigned char padding0[8 - (MAX_COLLECTOR_HISTORY % 8)]; /* for 8-byte alignment */
int h_first;
int h_count;
int cpu_num;
int padding1; /* for 8-byte alignment */
}
ZBX_SINGLE_CPU_STAT_DATA;
typedef struct
{
ZBX_SINGLE_CPU_STAT_DATA *cpu;
int count;
}
ZBX_CPUS_STAT_DATA;