libsysactivity 0.6.2
src/common/cpu.h
00001 /*
00002  * libsysactivity
00003  * http://sourceforge.net/projects/libsysactivity/
00004  * Copyright (c) 2009-2011 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00025 #ifndef SA_CPU_H_
00026 #define SA_CPU_H_
00027 
00031 SA_EXPORT struct sa_cpu {
00032 #ifdef SA_CPU_ID
00033         uint16_t id; 
00034 #endif
00035 #ifdef SA_CPU_USER
00036         float user; 
00037 #endif
00038 #ifdef SA_CPU_NICE
00039         float nice; 
00040 #endif
00041 #ifdef SA_CPU_SYSTEM
00042         float system; 
00043 #endif
00044 #ifdef SA_CPU_IDLE
00045         float idle; 
00046 #endif
00047 #ifdef SA_CPU_WAITING_FOR_IO
00048         float waiting_for_io; 
00049 #endif
00050 #ifdef SA_CPU_HARDWARE_IRQ
00051         float hardware_irq; 
00052 #endif
00053 #ifdef SA_CPU_SOFTWARE_IRQ
00054         float software_irq; 
00055 #endif
00056 #ifdef SA_CPU_STOLEN
00057         float stolen; 
00058 #endif
00059 #ifdef SA_CPU_INTR
00060         float intr;
00061 #endif
00062 };
00063 
00064 #ifdef SA_OPEN_CPU
00065 
00070 int sa_open_cpu(void) SA_EXPORT;
00071 #endif
00072 
00073 #ifdef SA_CLOSE_CPU
00074 
00079 int sa_close_cpu(void) SA_EXPORT;
00080 #endif
00081 
00087 int sa_reset_cpus() SA_EXPORT;
00088 
00095 int sa_count_cpus(uint16_t* number) SA_EXPORT SA_NONNULL;
00096 
00105 int sa_get_cpu(uint16_t index, struct sa_cpu* dst) SA_EXPORT SA_NONNULL;
00106 
00116 int sa_get_cpus(struct sa_cpu* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
00117 
00119 #endif /* SA_CPU_H_ */
 All Data Structures Variables