libsysactivity 0.6.2
src/common/disk.h
00001 /*
00002  * libsysactivity
00003  * http://sourceforge.net/projects/libsysactivity/
00004  * Copyright (c) 2009, 2010 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_DISK_H_
00026 #define SA_DISK_H_
00027 
00031 SA_EXPORT struct sa_disk {
00032 #ifdef SA_DISK_NAME
00033         char name[SA_DISK_NAME]; 
00034 #endif
00035 #ifdef SA_DISK_READS
00036         uint64_t reads; 
00037 #endif
00038 #ifdef SA_DISK_READS_MERGED
00039         uint64_t reads_merged; 
00040 #endif
00041 #ifdef SA_DISK_SECTORS_READ
00042         uint64_t sectors_read; 
00043 #endif
00044 #ifdef SA_DISK_TIME_SPENT_READING
00045         uint64_t time_spent_reading; 
00046 #endif
00047 #ifdef SA_DISK_WRITES
00048         uint64_t writes; 
00049 #endif
00050 #ifdef SA_DISK_SECTORS_WRITTEN
00051         uint64_t sectors_written; 
00052 #endif
00053 #ifdef SA_DISK_TIME_SPENT_WRITING
00054         uint64_t time_spent_writing; 
00055 #endif
00056 #ifdef SA_DISK_BYTES_READ
00057         uint64_t bytes_read; 
00058 #endif
00059 #ifdef SA_DISK_BYTES_WRITTEN
00060         uint64_t bytes_written; 
00061 #endif
00062 };
00063 
00064 #ifdef SA_OPEN_DISK
00065 
00071 int sa_open_disk(void) SA_EXPORT;
00072 #endif
00073 
00074 #ifdef SA_CLOSE_DISK
00075 
00081 int sa_close_disk(void) SA_EXPORT;
00082 #endif
00083 
00091 int sa_count_disks(uint16_t* number) SA_EXPORT SA_NONNULL;
00092 
00098 int sa_reset_disks() SA_EXPORT;
00099 
00109 int sa_get_disks_ids(char* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
00110 
00119 int sa_get_disk(char* name, struct sa_disk* dst) SA_EXPORT SA_NONNULL;
00120 
00130 int sa_get_disks(struct sa_disk* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
00131 
00133 #endif /* SA_DISK_H_ */
 All Data Structures Variables