Renamed procdiskio to procio

This commit is contained in:
Robert Roth
2017-05-12 05:08:41 +03:00
parent c29d7de9a0
commit 1bf16bfffd
25 changed files with 86 additions and 86 deletions

View File

@@ -3,7 +3,7 @@
#endif #endif
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/procdiskio.h> #include <glibtop/procio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -11,13 +11,13 @@
static void show_diskio(pid_t pid) static void show_diskio(pid_t pid)
{ {
glibtop_proc_diskio diskio; glibtop_proc_io io;
glibtop_get_proc_diskio (&diskio, pid); glibtop_get_proc_io (&io, pid);
printf("<%ld>\t", (long)pid); printf("<%ld>\t", (long)pid);
printf("flags: %08lx rchar : %lu, wchar : %lu, read_bytes : %lu, write_bytes : %lu\n", (unsigned long)diskio.flags, diskio.rchar, diskio.wchar, diskio.rbytes, diskio.wbytes); printf("flags: %08lx rchar : %lu, wchar : %lu, read_bytes : %lu, write_bytes : %lu\n", (unsigned long)io.flags, io.rchar, io.wchar, io.rbytes, io.wbytes);
} }

View File

@@ -95,7 +95,7 @@ main (int argc, char *argv [])
"\tproc_segment:\t%d\t0x%08lx\n" "\tproc_segment:\t%d\t0x%08lx\n"
"\tproc_args:\t%d\t0x%08lx\n" "\tproc_args:\t%d\t0x%08lx\n"
"\tproc_map:\t%d\t0x%08lx\n" "\tproc_map:\t%d\t0x%08lx\n"
"\tproc_diskio:\t%d\t0x%08lx\n\n" "\tproc_io:\t%d\t0x%08lx\n\n"
"\tmountlist:\t%d\t0x%08lx\n" "\tmountlist:\t%d\t0x%08lx\n"
"\tfsusage:\t%d\t0x%08lx\n\n" "\tfsusage:\t%d\t0x%08lx\n\n"
"\tnetload:\t%d\t0x%08lx\n" "\tnetload:\t%d\t0x%08lx\n"
@@ -138,8 +138,8 @@ main (int argc, char *argv [])
(unsigned long) sysdeps.proc_args, (unsigned long) sysdeps.proc_args,
FEATURE_CHECK(PROC_MAP), FEATURE_CHECK(PROC_MAP),
(unsigned long) sysdeps.proc_map, (unsigned long) sysdeps.proc_map,
FEATURE_CHECK(PROC_DISKIO), FEATURE_CHECK(PROC_IO),
(unsigned long) sysdeps.proc_diskio, (unsigned long) sysdeps.proc_io,
FEATURE_CHECK(MOUNTLIST), FEATURE_CHECK(MOUNTLIST),
(unsigned long) sysdeps.mountlist, (unsigned long) sysdeps.mountlist,
FEATURE_CHECK(FSUSAGE), FEATURE_CHECK(FSUSAGE),

View File

@@ -416,7 +416,7 @@ main (int argc, char *argv [])
getrusage (RUSAGE_SELF, &rusage_start); getrusage (RUSAGE_SELF, &rusage_start);
for (c = 0; c < PROFILE_COUNT; c++) for (c = 0; c < PROFILE_COUNT; c++)
glibtop_get_proc_diskio (&data.proc_diskio, pid); glibtop_get_proc_io (&data.proc_io, pid);
getrusage (RUSAGE_SELF, &rusage_end); getrusage (RUSAGE_SELF, &rusage_end);
@@ -426,8 +426,8 @@ main (int argc, char *argv [])
libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime, libgtop_timersub (&rusage_end.ru_stime, &rusage_start.ru_stime,
&elapsed_stime); &elapsed_stime);
printf ("Proc_DiskIo (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n", printf ("Proc_Io (0x%08lx): %7lu - %9.2Lf - %9.2Lf\n",
(unsigned long) data.proc_diskio.flags, PROFILE_COUNT, (unsigned long) data.proc_io.flags, PROFILE_COUNT,
(long double) ELAPSED_UTIME / PROFILE_COUNT, (long double) ELAPSED_UTIME / PROFILE_COUNT,
(long double) ELAPSED_STIME / PROFILE_COUNT); (long double) ELAPSED_STIME / PROFILE_COUNT);

View File

@@ -24,5 +24,5 @@ void|ppp|ushort(device)
char **|netlist char **|netlist
char **|proc_wd|pid_t(pid) char **|proc_wd|pid_t(pid)
guint16*|proc_affinity|pid_t(pid) guint16*|proc_affinity|pid_t(pid)
void|proc_diskio|pid_t(pid) void|proc_io|pid_t(pid)

View File

@@ -9,7 +9,7 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
parameter.h mountlist.h fsusage.h procmap.h signal.h \ parameter.h mountlist.h fsusage.h procmap.h signal.h \
sysinfo.h ppp.h procargs.h netload.h \ sysinfo.h ppp.h procargs.h netload.h \
procwd.h procaffinity.h \ procwd.h procaffinity.h \
procdiskio.h \ procio.h \
netlist.h procopenfiles.h open.h netlist.h procopenfiles.h open.h
noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h machine.h \ noinst_HEADERS = error.h write.h read_data.h read.h init_hooks.h machine.h \

View File

@@ -59,7 +59,7 @@ G_BEGIN_DECLS
#define GLIBTOP_CMND_PROC_OPEN_FILES 25 #define GLIBTOP_CMND_PROC_OPEN_FILES 25
#define GLIBTOP_CMND_PROC_WD 26 #define GLIBTOP_CMND_PROC_WD 26
#define GLIBTOP_CMND_PROC_AFFINITY 27 #define GLIBTOP_CMND_PROC_AFFINITY 27
#define GLIBTOP_CMND_PROC_DISKIO 28 #define GLIBTOP_CMND_PROC_IO 28
#define GLIBTOP_MAX_CMND 29 #define GLIBTOP_MAX_CMND 29

View File

@@ -19,27 +19,27 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#ifndef __GLIBTOP_PROCDISKIO_H__ #ifndef __GLIBTOP_PROCIO_H__
#define __GLIBTOP_PROCDISKIO_H__ #define __GLIBTOP_PROCIO_H__
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/global.h> #include <glibtop/global.h>
G_BEGIN_DECLS G_BEGIN_DECLS
#define GLIBTOP_PROC_DISKIO_RCHAR 0 #define GLIBTOP_PROC_IO_RCHAR 0
#define GLIBTOP_PROC_DISKIO_WCHAR 1 #define GLIBTOP_PROC_IO_WCHAR 1
#define GLIBTOP_PROC_DISKIO_RBYTES 2 #define GLIBTOP_PROC_IO_RBYTES 2
#define GLIBTOP_PROC_DISKIO_WBYTES 3 #define GLIBTOP_PROC_IO_WBYTES 3
#define GLIBTOP_MAX_PROC_DISKIO 3 #define GLIBTOP_MAX_PROC_IO 3
typedef struct _glibtop_proc_diskio glibtop_proc_diskio; typedef struct _glibtop_proc_io glibtop_proc_io;
/* Time section */ /* Time section */
/** /**
* glibtop_proc_diskio: * glibtop_proc_io:
* @rchar: The number of bytes which this task has caused to be read from storage. This * @rchar: The number of bytes which this task has caused to be read from storage. This
* is simply the sum of bytes which this process passed to read() and pread(), also including tty IO, * is simply the sum of bytes which this process passed to read() and pread(), also including tty IO,
* and it is unaffected by whether or not actual physical disk IO was required. * and it is unaffected by whether or not actual physical disk IO was required.
@@ -51,10 +51,10 @@ typedef struct _glibtop_proc_diskio glibtop_proc_diskio;
* @wbytes: Attempt to count the number of bytes which this process caused to be sent to * @wbytes: Attempt to count the number of bytes which this process caused to be sent to
* the storage layer. This is done at page-dirtying time. * the storage layer. This is done at page-dirtying time.
* *
* Process disk io data filled by glibtop_get_proc_diskio(). * Process disk io data filled by glibtop_get_proc_io().
* *
*/ */
struct _glibtop_proc_diskio struct _glibtop_proc_io
{ {
/*< private >*/ /*< private >*/
guint64 flags; guint64 flags;
@@ -66,22 +66,22 @@ struct _glibtop_proc_diskio
}; };
void glibtop_get_proc_diskio (glibtop_proc_diskio *buf, pid_t pid); void glibtop_get_proc_io (glibtop_proc_io *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_DISKIO #if GLIBTOP_SUID_PROC_IO
#define glibtop_get_proc_diskio_r glibtop_get_proc_diskio_p #define glibtop_get_proc_io_r glibtop_get_proc_io_p
#else #else
#define glibtop_get_proc_diskio_r glibtop_get_proc_diskio_s #define glibtop_get_proc_io_r glibtop_get_proc_io_s
#endif #endif
void glibtop_get_proc_diskio_l (glibtop *server, glibtop_proc_diskio *buf, pid_t pid); void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid);
#if GLIBTOP_SUID_PROC_DISKIO #if GLIBTOP_SUID_PROC_IO
void _glibtop_init_proc_diskio_p (glibtop *server); void _glibtop_init_proc_io_p (glibtop *server);
void glibtop_get_proc_diskio_p (glibtop *server, glibtop_proc_diskio *buf, pid_t pid); void glibtop_get_proc_io_p (glibtop *server, glibtop_proc_io *buf, pid_t pid);
#else #else
void _glibtop_init_proc_diskio_s (glibtop *server); void _glibtop_init_proc_io_s (glibtop *server);
void glibtop_get_proc_diskio_s (glibtop *server, glibtop_proc_diskio *buf, pid_t pid); void glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid);
#endif #endif

View File

@@ -53,7 +53,7 @@ G_BEGIN_DECLS
#define GLIBTOP_SYSDEPS_PROC_OPEN_FILES 24 #define GLIBTOP_SYSDEPS_PROC_OPEN_FILES 24
#define GLIBTOP_SYSDEPS_PROC_WD 25 #define GLIBTOP_SYSDEPS_PROC_WD 25
#define GLIBTOP_SYSDEPS_PROC_AFFINITY 26 #define GLIBTOP_SYSDEPS_PROC_AFFINITY 26
#define GLIBTOP_SYSDEPS_PROC_DISKIO 27 #define GLIBTOP_SYSDEPS_PROC_IO 27
#define GLIBTOP_MAX_SYSDEPS 28 #define GLIBTOP_MAX_SYSDEPS 28
@@ -94,7 +94,7 @@ struct _glibtop_sysdeps
guint64 ppp; /* glibtop_ppp */ guint64 ppp; /* glibtop_ppp */
guint64 proc_wd; /* glibtop_proc_wd */ guint64 proc_wd; /* glibtop_proc_wd */
guint64 proc_affinity; /* glibtop_proc_affinity */ guint64 proc_affinity; /* glibtop_proc_affinity */
guint64 proc_diskio; /* glibtop_proc_diskio */ guint64 proc_io; /* glibtop_proc_io */
}; };
void glibtop_get_sysdeps (glibtop_sysdeps *buf); void glibtop_get_sysdeps (glibtop_sysdeps *buf);

View File

@@ -44,7 +44,7 @@
#include <glibtop/procopenfiles.h> #include <glibtop/procopenfiles.h>
#include <glibtop/procwd.h> #include <glibtop/procwd.h>
#include <glibtop/procaffinity.h> #include <glibtop/procaffinity.h>
#include <glibtop/procdiskio.h> #include <glibtop/procio.h>
#include <glibtop/mountlist.h> #include <glibtop/mountlist.h>
#include <glibtop/fsusage.h> #include <glibtop/fsusage.h>
@@ -85,7 +85,7 @@ union _glibtop_union
glibtop_proc_open_files proc_open_files; glibtop_proc_open_files proc_open_files;
glibtop_proc_wd proc_wd; glibtop_proc_wd proc_wd;
glibtop_proc_affinity proc_affinity; glibtop_proc_affinity proc_affinity;
glibtop_proc_diskio proc_diskio; glibtop_proc_io proc_io;
}; };
G_END_DECLS G_END_DECLS

View File

@@ -35,7 +35,7 @@ introspection_sources = $(libgtop_2_0_la_SOURCES) lib.c ../glibtop.h ../libgtopc
../include/glibtop/procsignal.h ../include/glibtop/union.h ../include/glibtop/gnuserv.h \ ../include/glibtop/procsignal.h ../include/glibtop/union.h ../include/glibtop/gnuserv.h \
../include/glibtop/parameter.h ../include/glibtop/mountlist.h ../include/glibtop/fsusage.h ../include/glibtop/procmap.h ../include/glibtop/signal.h \ ../include/glibtop/parameter.h ../include/glibtop/mountlist.h ../include/glibtop/fsusage.h ../include/glibtop/procmap.h ../include/glibtop/signal.h \
../include/glibtop/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.h \ ../include/glibtop/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.h \
../include/glibtop/procwd.h ../include/glibtop/procaffinity.h ../include/glibtop/procdiskio.h \ ../include/glibtop/procwd.h ../include/glibtop/procaffinity.h ../include/glibtop/procio.h \
../include/glibtop/netlist.h ../include/glibtop/procopenfiles.h ../include/glibtop/open.h ../include/glibtop/netlist.h ../include/glibtop/procopenfiles.h ../include/glibtop/open.h
GTop-2.0.gir: libgtop-2.0.la GTop-2.0.gir: libgtop-2.0.la

View File

@@ -68,7 +68,7 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size,
CHECK_CMND(GLIBTOP_CMND_PROC_OPEN_FILES); CHECK_CMND(GLIBTOP_CMND_PROC_OPEN_FILES);
CHECK_CMND(GLIBTOP_CMND_PROC_WD); CHECK_CMND(GLIBTOP_CMND_PROC_WD);
CHECK_CMND(GLIBTOP_CMND_PROC_AFFINITY); CHECK_CMND(GLIBTOP_CMND_PROC_AFFINITY);
CHECK_CMND(GLIBTOP_CMND_PROC_DISKIO); CHECK_CMND(GLIBTOP_CMND_PROC_IO);
default: default:
glibtop_error_r(server, "CALL: command UNKNOWN(%d) sending %lu bytes", command, (unsigned long)send_size); break; glibtop_error_r(server, "CALL: command UNKNOWN(%d) sending %lu bytes", command, (unsigned long)send_size); break;
} }

View File

@@ -52,8 +52,8 @@ glibtop_get_shm_limits
glibtop_get_shm_limits_l glibtop_get_shm_limits_l
glibtop_get_proc_affinity glibtop_get_proc_affinity
glibtop_get_proc_affinity_l glibtop_get_proc_affinity_l
glibtop_get_proc_diskio glibtop_get_proc_io
glibtop_get_proc_diskio_l glibtop_get_proc_io_l
glibtop_get_swap glibtop_get_swap
glibtop_get_swap_l glibtop_get_swap_l
glibtop_get_sysdeps glibtop_get_sysdeps

View File

@@ -49,7 +49,7 @@ GLIBTOP_SUID_NETLIST +
GLIBTOP_SUID_PROC_WD + GLIBTOP_SUID_PROC_WD +
GLIBTOP_SUID_PROC_AFFINITY + GLIBTOP_SUID_PROC_AFFINITY +
GLIBTOP_SUID_PPP + GLIBTOP_SUID_PPP +
GLIBTOP_SUID_PROC_DISKIO; GLIBTOP_SUID_PROC_IO;
const _glibtop_init_func_t _glibtop_init_hook_s [] = { const _glibtop_init_func_t _glibtop_init_hook_s [] = {
#if !GLIBTOP_SUID_CPU #if !GLIBTOP_SUID_CPU
@@ -121,8 +121,8 @@ const _glibtop_init_func_t _glibtop_init_hook_s [] = {
#if !GLIBTOP_SUID_PPP #if !GLIBTOP_SUID_PPP
_glibtop_init_ppp_s, _glibtop_init_ppp_s,
#endif #endif
#if !GLIBTOP_SUID_PROC_DISKIO #if !GLIBTOP_SUID_PROC_IO
_glibtop_init_proc_diskio_s, _glibtop_init_proc_io_s,
#endif #endif
NULL NULL
}; };
@@ -197,8 +197,8 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_PPP #if GLIBTOP_SUID_PPP
_glibtop_init_ppp_p, _glibtop_init_ppp_p,
#endif #endif
#if GLIBTOP_SUID_PROC_DISKIO #if GLIBTOP_SUID_PROC_IO
_glibtop_init_proc_diskio_p, _glibtop_init_proc_io_p,
#endif #endif
NULL NULL
}; };

View File

@@ -221,10 +221,10 @@ handle_parent_connection (int s)
do_output (s, resp, _offset_data (fsusage), do_output (s, resp, _offset_data (fsusage),
0, NULL); 0, NULL);
break; break;
case GLIBTOP_CMND_PROC_DISKIO: case GLIBTOP_CMND_PROC_IO:
glibtop_get_proc_diskio_l glibtop_get_proc_io_l
(server, &resp->u.data.proc_diskio, parameter); (server, &resp->u.data.proc_io, parameter);
do_output (s, resp, _offset_data (proc_diskio), do_output (s, resp, _offset_data (proc_io),
0, NULL); 0, NULL);
break; break;
case GLIBTOP_CMND_PPP: case GLIBTOP_CMND_PPP:

View File

@@ -209,11 +209,11 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
resp->offset = _offset_data (proc_time); resp->offset = _offset_data (proc_time);
break; break;
#endif #endif
#if GLIBTOP_SUID_PROC_DISKIO #if GLIBTOP_SUID_PROC_IO
case GLIBTOP_CMND_PROC_DISKIO: case GLIBTOP_CMND_PROC_IO:
memcpy (&pid, parameter, sizeof (pid_t)); memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_diskio_p glibtop_get_proc_io_p
(server, &resp->u.data.proc_diskio, pid); (server, &resp->u.data.proc_io, pid);
resp->offset = _offset_data (proc_time); resp->offset = _offset_data (proc_time);
break; break;
#endif #endif

View File

@@ -433,7 +433,7 @@ glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid)
} }
/** /**
* glibtop_get_proc_diskio: Get the disk io stats for the given pid * glibtop_get_proc_io: Get the io stats for the given pid
* @buf: Buffer where the result will be given * @buf: Buffer where the result will be given
* @pid: Process id to get the io stats for * @pid: Process id to get the io stats for
* *
@@ -442,7 +442,7 @@ glibtop_get_proc_affinity(glibtop_proc_affinity *buf, pid_t pid)
* Returns: A list of processor ID of 'buf.number' elements. * Returns: A list of processor ID of 'buf.number' elements.
*/ */
void void
glibtop_get_proc_diskio(glibtop_proc_diskio *buf, pid_t pid) glibtop_get_proc_io(glibtop_proc_io *buf, pid_t pid)
{ {
return glibtop_get_proc_diskio_l(glibtop_global_server, buf, pid); return glibtop_get_proc_io_l(glibtop_global_server, buf, pid);
} }

View File

@@ -90,8 +90,8 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = {
#if GLIBTOP_SUID_PPP #if GLIBTOP_SUID_PPP
_glibtop_init_ppp_p, _glibtop_init_ppp_p,
#endif #endif
#if GLIBTOP_SUID_PROC_DISKIO #if GLIBTOP_SUID_PROC_IO
_glibtop_init_proc_diskio_p, _glibtop_init_proc_io_p,
#endif #endif
NULL NULL
}; };

View File

@@ -16,7 +16,7 @@ libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \
proclist.c procstate.c procuid.c \ proclist.c procstate.c procuid.c \
proctime.c procmem.c procsignal.c \ proctime.c procmem.c procsignal.c \
prockernel.c procsegment.c procargs.c \ prockernel.c procsegment.c procargs.c \
procdiskio.c \ procio.c \
procmap.c netload.c ppp.c procmap.c netload.c ppp.c
libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO)

View File

@@ -47,7 +47,7 @@ G_BEGIN_DECLS
#define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_NETLIST 0
#define GLIBTOP_SUID_PROC_WD 0 #define GLIBTOP_SUID_PROC_WD 0
#define GLIBTOP_SUID_PROC_AFFINITY 0 #define GLIBTOP_SUID_PROC_AFFINITY 0
#define GLIBTOP_SUID_PROC_DISKIO (1 << GLIBTOP_SYSDEPS_PROC_DISKIO) #define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO)
G_END_DECLS G_END_DECLS

View File

@@ -21,23 +21,23 @@
#include <config.h> #include <config.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/procdiskio.h> #include <glibtop/procio.h>
static const unsigned long _glibtop_sysdeps_proc_diskio = 0; static const unsigned long _glibtop_sysdeps_proc_io = 0;
/* Init function. */ /* Init function. */
void void
_glibtop_init_proc_diskio_p (glibtop *server) _glibtop_init_proc_io_p (glibtop *server)
{ {
server->sysdeps.proc_diskio = _glibtop_sysdeps_proc_diskio; server->sysdeps.proc_io = _glibtop_sysdeps_proc_io;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
void void
glibtop_get_proc_diskio_p (glibtop *server, glibtop_proc_diskio *buf, glibtop_get_proc_io_p (glibtop *server, glibtop_proc_io *buf,
pid_t pid) pid_t pid)
{ {
memset (buf, 0, sizeof (glibtop_proc_diskio)); memset (buf, 0, sizeof (glibtop_proc_io));
} }

View File

@@ -10,7 +10,7 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
proctime.c procmem.c procsignal.c prockernel.c \ proctime.c procmem.c procsignal.c prockernel.c \
procsegment.c procargs.c procmap.c siglist.c \ procsegment.c procargs.c procmap.c siglist.c \
sysinfo.c netload.c ppp.c glibtop_private.c \ sysinfo.c netload.c ppp.c glibtop_private.c \
mountlist.c procaffinity.c procdiskio.c \ mountlist.c procaffinity.c procio.c \
fsusage.c netlist.c procopenfiles.c procwd.c fsusage.c netlist.c procopenfiles.c procwd.c
libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@ libgtop_sysdeps_2_0_la_LIBADD = @GLIB_LIBS@

View File

@@ -46,6 +46,6 @@
#define GLIBTOP_SUID_PROC_AFFINITY 0 #define GLIBTOP_SUID_PROC_AFFINITY 0
#define GLIBTOP_SUID_PPP 0 #define GLIBTOP_SUID_PPP 0
#define GLIBTOP_SUID_PROC_FILE 0 #define GLIBTOP_SUID_PROC_FILE 0
#define GLIBTOP_SUID_PROC_DISKIO 0 #define GLIBTOP_SUID_PROC_IO 0
#endif /* __LINUX__GLIBTOP_SERVER_H__ */ #endif /* __LINUX__GLIBTOP_SERVER_H__ */

View File

@@ -22,29 +22,29 @@
#include <config.h> #include <config.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/error.h> #include <glibtop/error.h>
#include <glibtop/procdiskio.h> #include <glibtop/procio.h>
#include "glibtop_private.h" #include "glibtop_private.h"
static const unsigned long _glibtop_sysdeps_proc_diskio = static const unsigned long _glibtop_sysdeps_proc_io =
(1L << GLIBTOP_PROC_DISKIO_RCHAR) + (1L << GLIBTOP_PROC_DISKIO_WCHAR) + (1L << GLIBTOP_PROC_IO_RCHAR) + (1L << GLIBTOP_PROC_IO_WCHAR) +
(1L << GLIBTOP_PROC_DISKIO_RBYTES) + (1L << GLIBTOP_PROC_DISKIO_WBYTES); (1L << GLIBTOP_PROC_IO_RBYTES) + (1L << GLIBTOP_PROC_IO_WBYTES);
/* Init function. */ /* Init function. */
void void
_glibtop_init_proc_diskio_s (glibtop *server) _glibtop_init_proc_io_s (glibtop *server)
{ {
server->sysdeps.proc_diskio = _glibtop_sysdeps_proc_diskio; server->sysdeps.proc_io = _glibtop_sysdeps_proc_io;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
void void
glibtop_get_proc_diskio_s (glibtop *server, glibtop_proc_diskio *buf, pid_t pid) glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid)
{ {
char buffer [BUFSIZ], *p; char buffer [BUFSIZ], *p;
memset (buf, 0, sizeof (glibtop_proc_diskio)); memset (buf, 0, sizeof (glibtop_proc_io));
if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 20)) if (server->os_version_code < LINUX_VERSION_CODE(2, 6, 20))
return; return;
@@ -66,5 +66,5 @@ glibtop_get_proc_diskio_s (glibtop *server, glibtop_proc_diskio *buf, pid_t pid)
p = skip_token (p); p = skip_token (p);
buf->wbytes = g_ascii_strtoull (p, &p, 10); buf->wbytes = g_ascii_strtoull (p, &p, 10);
buf->flags = _glibtop_sysdeps_proc_diskio; buf->flags = _glibtop_sysdeps_proc_io;
} }

View File

@@ -21,23 +21,23 @@
#include <config.h> #include <config.h>
#include <glibtop.h> #include <glibtop.h>
#include <glibtop/procdiskio.h> #include <glibtop/procio.h>
static const unsigned long _glibtop_sysdeps_proc_diskio = 0; static const unsigned long _glibtop_sysdeps_proc_io = 0;
/* Init function. */ /* Init function. */
void void
_glibtop_init_proc_diskio_s (glibtop *server) _glibtop_init_proc_io_s (glibtop *server)
{ {
server->sysdeps.proc_diskio = _glibtop_sysdeps_proc_diskio; server->sysdeps.proc_io = _glibtop_sysdeps_proc_io;
} }
/* Provides detailed information about a process. */ /* Provides detailed information about a process. */
void void
glibtop_get_proc_diskio_s (glibtop *server, glibtop_proc_diskio *buf, glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf,
pid_t pid) pid_t pid)
{ {
memset (buf, 0, sizeof (glibtop_proc_diskio)); memset (buf, 0, sizeof (glibtop_proc_io));
} }

View File

@@ -45,7 +45,7 @@ G_BEGIN_DECLS
#define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD)
#define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_NETLIST 0
#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP)
#define GLIBTOP_SUID_PROC_DISKIO (1 << GLIBTOP_SYSDEPS_PROC_DISKIO) #define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO)
G_END_DECLS G_END_DECLS