Remove useless/meaningless calls to glibtop_init_[prs]() with sysdeps/{freebsd,linux}.
This commit is contained in:
committed by
Benoît Dejean
parent
58d50d3546
commit
d817bee619
@@ -59,8 +59,6 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
size_t length;
|
||||
int ncpu, i;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_cpu));
|
||||
|
||||
length = sizeof (cpts);
|
||||
|
@@ -142,8 +142,6 @@ glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
{
|
||||
struct statvfs fsd;
|
||||
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_fsusage));
|
||||
|
||||
if (statvfs (path, &fsd) < 0)
|
||||
|
@@ -51,8 +51,6 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
|
||||
pid_t last_pid;
|
||||
size_t len;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_loadavg));
|
||||
|
||||
if (getloadavg (buf->loadavg, G_N_ELEMENTS(buf->loadavg)) == -1)
|
||||
|
@@ -76,8 +76,6 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
|
||||
gulong membuffer;
|
||||
gulong memfree;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
|
||||
|
||||
memset (buf, 0, sizeof *buf);
|
||||
|
||||
memtotal = mem_get_by_bytes (server, "hw.physmem");
|
||||
|
@@ -126,8 +126,6 @@ glibtop_get_mountlist_s (glibtop *server, glibtop_mountlist *buf, int all_fs)
|
||||
GArray *mount_array = g_array_new(FALSE, FALSE,
|
||||
sizeof(glibtop_mountentry));
|
||||
|
||||
glibtop_init_r (&server, 0, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_mountlist));
|
||||
|
||||
/* Read filesystem list. */
|
||||
|
@@ -48,8 +48,6 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
||||
size_t len;
|
||||
int msgmax, msgmni, msgmnb, msgtql, msgssz, msgseg;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_msg_limits));
|
||||
|
||||
if (server->sysdeps.msg_limits == 0)
|
||||
|
@@ -41,8 +41,6 @@ glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf)
|
||||
struct if_nameindex *ifstart, *ifs;
|
||||
GPtrArray *devices;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_netlist));
|
||||
|
||||
ifs = ifstart = if_nameindex();
|
||||
|
@@ -100,8 +100,6 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf,
|
||||
struct in_ifaddr in;
|
||||
} ifaddr;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_NETLOAD), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_netload));
|
||||
|
||||
if (server->sysdeps.netload == 0) return;
|
||||
|
@@ -96,8 +96,6 @@ glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||
#endif
|
||||
int phase;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PPP), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_ppp));
|
||||
|
||||
if (server->sysdeps.ppp == 0) return;
|
||||
|
@@ -52,8 +52,6 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf,
|
||||
size_t size = 0, pos = 0;
|
||||
int count;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_ARGS), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_args));
|
||||
|
||||
/* swapper, init, pagedaemon, vmdaemon, update - this doen't work. */
|
||||
|
@@ -69,8 +69,6 @@ glibtop_get_proc_kernel_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
int count;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_KERNEL), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
||||
|
||||
if (server->sysdeps.proc_time == 0)
|
||||
|
@@ -72,8 +72,6 @@ glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
|
||||
unsigned int i;
|
||||
pid_t prev;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROCLIST), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proclist));
|
||||
|
||||
if (sysctlbyname ("kern.proc.all", NULL, &len, NULL, 0)) {
|
||||
|
@@ -209,8 +209,6 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf,
|
||||
int count;
|
||||
int update = 0;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MAP), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_map));
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
|
@@ -75,8 +75,6 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
|
||||
struct vm_object object;
|
||||
int count;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_MEM), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_mem));
|
||||
|
||||
if (server->sysdeps.proc_mem == 0)
|
||||
|
@@ -55,8 +55,6 @@ glibtop_get_proc_segment_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
int count = 0;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SEGMENT), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_segment));
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
|
@@ -52,8 +52,6 @@ glibtop_get_proc_signal_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
int count = 0;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_SIGNAL), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_signal));
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
|
@@ -50,8 +50,6 @@ glibtop_get_proc_state_p (glibtop *server,
|
||||
struct kinfo_proc *pinfo;
|
||||
int count = 0;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_STATE), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_state));
|
||||
|
||||
/* Get the process information */
|
||||
|
@@ -66,8 +66,6 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf,
|
||||
int count;
|
||||
size_t len;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_TIME), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_time));
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
|
@@ -50,8 +50,6 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf,
|
||||
struct kinfo_proc *pinfo;
|
||||
int count = 0;
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_PROC_UID), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_uid));
|
||||
|
||||
/* It does not work for the swapper task. */
|
||||
|
@@ -51,8 +51,6 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
||||
int semmap, semmni, semmns, semmnu, semmsl, semopm, semume, semusz;
|
||||
int semvmx, semaem;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_sem_limits));
|
||||
|
||||
if (server->sysdeps.sem_limits == 0)
|
||||
|
@@ -53,8 +53,6 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
||||
unsigned long shmmax, shmmin, shmmni, shmseg, shmall;
|
||||
#endif
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_shm_limits));
|
||||
|
||||
if (server->sysdeps.shm_limits == 0)
|
||||
|
@@ -56,8 +56,6 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf)
|
||||
int nswdev;
|
||||
struct kvm_swap kvmsw[16];
|
||||
|
||||
glibtop_init_p (server, (1L << GLIBTOP_SYSDEPS_SWAP), 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_swap));
|
||||
memset (kvmsw, 0, sizeof (kvmsw));
|
||||
|
||||
|
@@ -43,8 +43,6 @@ init_sysinfo (glibtop *server)
|
||||
if (G_LIKELY (sysinfo.flags))
|
||||
return;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
||||
|
||||
ncpus = server->ncpu + 1;
|
||||
|
||||
len = 0;
|
||||
|
@@ -58,8 +58,6 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
|
||||
size_t size;
|
||||
glibtop_cpu cpu;
|
||||
|
||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_uptime));
|
||||
|
||||
mib[0] = CTL_KERN;
|
||||
|
@@ -194,7 +194,6 @@ glibtop_get_fsusage_s(glibtop *server, glibtop_fsusage *buf, const char *path)
|
||||
{
|
||||
struct statvfs fsd;
|
||||
|
||||
glibtop_init_r(&server, 0, 0);
|
||||
memset(buf, 0, sizeof(glibtop_fsusage));
|
||||
|
||||
if (statvfs(path, &fsd) < 0) {
|
||||
|
@@ -118,7 +118,6 @@ glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs)
|
||||
GArray* entries;
|
||||
IgnoreList* ig = NULL;
|
||||
|
||||
glibtop_init_r(&server, 0, 0);
|
||||
memset(buf, 0, sizeof(glibtop_mountlist));
|
||||
|
||||
/* wild guess, preallocate 8 entries
|
||||
|
Reference in New Issue
Block a user