All Data Structures Functions Variables Enumerations Enumerator Groups Pages
cpu.h
/*
* libsysactivity
* http://sourceforge.net/projects/libsysactivity/
* Copyright (c) 2009-2011 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SA_CPU_H_
#define SA_CPU_H_
struct sa_cpu {
#ifdef SA_CPU_ID
uint16_t id;
#endif
#ifdef SA_CPU_USER
float user;
#endif
#ifdef SA_CPU_NICE
float nice;
#endif
#ifdef SA_CPU_SYSTEM
float system;
#endif
#ifdef SA_CPU_IDLE
float idle;
#endif
#ifdef SA_CPU_WAITING_FOR_IO
float waiting_for_io;
#endif
#ifdef SA_CPU_HARDWARE_IRQ
float hardware_irq;
#endif
#ifdef SA_CPU_SOFTWARE_IRQ
float software_irq;
#endif
#ifdef SA_CPU_STOLEN
float stolen;
#endif
#ifdef SA_CPU_INTR
float intr;
#endif
};
#ifdef SA_OPEN_CPU
int sa_open_cpu(void) SA_EXPORT;
#endif
#ifdef SA_CLOSE_CPU
int sa_close_cpu(void) SA_EXPORT;
#endif
int sa_reset_cpus() SA_EXPORT;
int sa_count_cpus(uint16_t* number) SA_EXPORT SA_NONNULL;
int sa_get_cpu(uint16_t index, struct sa_cpu* dst) SA_EXPORT SA_NONNULL;
int sa_get_cpus(struct sa_cpu* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
#endif /* SA_CPU_H_ */