disk.h
/*
* libsysactivity
* http://sourceforge.net/projects/libsysactivity/
* Copyright (c) 2009, 2010 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_DISK_H_
#define SA_DISK_H_
struct sa_disk {
#ifdef SA_DISK_NAME
char name[SA_DISK_NAME];
#endif
#ifdef SA_DISK_READS
uint64_t reads;
#endif
#ifdef SA_DISK_READS_MERGED
uint64_t reads_merged;
#endif
#ifdef SA_DISK_SECTORS_READ
uint64_t sectors_read;
#endif
#ifdef SA_DISK_TIME_SPENT_READING
uint64_t time_spent_reading;
#endif
#ifdef SA_DISK_WRITES
uint64_t writes;
#endif
#ifdef SA_DISK_SECTORS_WRITTEN
uint64_t sectors_written;
#endif
#ifdef SA_DISK_TIME_SPENT_WRITING
uint64_t time_spent_writing;
#endif
#ifdef SA_DISK_BYTES_READ
uint64_t bytes_read;
#endif
#ifdef SA_DISK_BYTES_WRITTEN
uint64_t bytes_written;
#endif
};
#ifdef SA_OPEN_DISK
int sa_open_disk(void) SA_EXPORT;
#endif
#ifdef SA_CLOSE_DISK
int sa_close_disk(void) SA_EXPORT;
#endif
int sa_count_disks(uint16_t* number) SA_EXPORT SA_NONNULL;
int sa_reset_disks() SA_EXPORT;
int sa_get_disks_ids(char* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
int sa_get_disk(char* name, struct sa_disk* dst) SA_EXPORT SA_NONNULL;
int sa_get_disks(struct sa_disk* dst, uint16_t dst_size, uint16_t* written) SA_EXPORT SA_NONNULL;
#endif /* SA_DISK_H_ */
sa_disk::sectors_written
uint64_t sectors_written
Total number of sectors written.
Definition: disk.h:51
sa_disk::reads_merged
uint64_t reads_merged
Number of reads which are adjacent to each other and have been merged for efficiency.
Definition: disk.h:39
sa_close_disk
int sa_close_disk(void) SA_EXPORT
sa_disk::bytes_written
uint64_t bytes_written
Total number of bytes written.
Definition: disk.h:60
sa_get_disks_ids
int sa_get_disks_ids(char *dst, uint16_t dst_size, uint16_t *written) SA_EXPORT SA_NONNULL
sa_count_disks
int sa_count_disks(uint16_t *number) SA_EXPORT SA_NONNULL
sa_disk::bytes_read
uint64_t bytes_read
Total number of bytes read.
Definition: disk.h:57
sa_get_disks
int sa_get_disks(struct sa_disk *dst, uint16_t dst_size, uint16_t *written) SA_EXPORT SA_NONNULL
sa_disk::name
char name[SA_DISK_NAME]
Device's name. It's used as the unique identifier of the device.
Definition: disk.h:33
sa_get_disk
int sa_get_disk(char *name, struct sa_disk *dst) SA_EXPORT SA_NONNULL
sa_disk::time_spent_reading
uint64_t time_spent_reading
Number of seconds spent performing read operations.
Definition: disk.h:45
sa_disk
Definition: disk.h:31
sa_disk::reads
uint64_t reads
Number of reads.
Definition: disk.h:36
sa_disk::time_spent_writing
uint64_t time_spent_writing
Number of seconds spent performing write operations.
Definition: disk.h:54
sa_disk::writes
uint64_t writes
Number of writes.
Definition: disk.h:48
sa_reset_disks
int sa_reset_disks() SA_EXPORT
sa_open_disk
int sa_open_disk(void) SA_EXPORT
sa_disk::sectors_read
uint64_t sectors_read
Total number of sectors read.
Definition: disk.h:42