libsysactivity  0.6.4
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
disk.h
1 /*
2  * libsysactivity
3  * http://sourceforge.net/projects/libsysactivity/
4  * Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
25 #ifndef SA_DISK_H_
26 #define SA_DISK_H_
27 
31 SA_EXPORT struct sa_disk {
32 #ifdef SA_DISK_NAME
33  char name[SA_DISK_NAME];
34 #endif
35 #ifdef SA_DISK_READS
36  uint64_t reads;
37 #endif
38 #ifdef SA_DISK_READS_MERGED
39  uint64_t reads_merged;
40 #endif
41 #ifdef SA_DISK_SECTORS_READ
42  uint64_t sectors_read;
43 #endif
44 #ifdef SA_DISK_TIME_SPENT_READING
45  uint64_t time_spent_reading;
46 #endif
47 #ifdef SA_DISK_WRITES
48  uint64_t writes;
49 #endif
50 #ifdef SA_DISK_SECTORS_WRITTEN
51  uint64_t sectors_written;
52 #endif
53 #ifdef SA_DISK_TIME_SPENT_WRITING
54  uint64_t time_spent_writing;
55 #endif
56 #ifdef SA_DISK_BYTES_READ
57  uint64_t bytes_read;
58 #endif
59 #ifdef SA_DISK_BYTES_WRITTEN
60  uint64_t bytes_written;
61 #endif
62 };
63 
64 #ifdef SA_OPEN_DISK
65 
71 int sa_open_disk(void) SA_EXPORT;
72 #endif
73 
74 #ifdef SA_CLOSE_DISK
75 
81 int sa_close_disk(void) SA_EXPORT;
82 #endif
83 
91 int sa_count_disks(uint16_t* number) SA_EXPORT SA_NONNULL;
92 
98 int sa_reset_disks() SA_EXPORT;
99 
109 int sa_get_disks_ids(char* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
110 
119 int sa_get_disk(char* name, struct sa_disk* dst) SA_EXPORT SA_NONNULL;
120 
130 int sa_get_disks(struct sa_disk* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
131 
133 #endif /* SA_DISK_H_ */