New upstream version 2.41.2
This commit is contained in:
@@ -11,7 +11,7 @@ AM_LDFLAGS = $(LIBGTOP_EXTRA_LIBS)
|
||||
|
||||
noinst_PROGRAMS = first second pprint procargs df netlist \
|
||||
mountlist procmap netload sysdeps timings \
|
||||
openfiles smp proclist free wd affinity diskio
|
||||
openfiles smp proclist free wd affinity disk diskio sysinfo
|
||||
|
||||
first_SOURCES = first.c
|
||||
first_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
@@ -34,6 +34,9 @@ mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
smp_SOURCES = smp.c
|
||||
smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
|
||||
disk_SOURCES = disk.c
|
||||
disk_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
|
||||
timings_SOURCES = timings.c
|
||||
timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
@@ -67,3 +70,6 @@ affinity_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
diskio_SOURCES = diskio.c
|
||||
diskio_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
sysinfo_SOURCES = sysinfo.c
|
||||
sysinfo_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
|
||||
+57
-22
@@ -1,7 +1,7 @@
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.5 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
@@ -93,11 +93,13 @@ noinst_PROGRAMS = first$(EXEEXT) second$(EXEEXT) pprint$(EXEEXT) \
|
||||
mountlist$(EXEEXT) procmap$(EXEEXT) netload$(EXEEXT) \
|
||||
sysdeps$(EXEEXT) timings$(EXEEXT) openfiles$(EXEEXT) \
|
||||
smp$(EXEEXT) proclist$(EXEEXT) free$(EXEEXT) wd$(EXEEXT) \
|
||||
affinity$(EXEEXT) diskio$(EXEEXT)
|
||||
affinity$(EXEEXT) disk$(EXEEXT) diskio$(EXEEXT) \
|
||||
sysinfo$(EXEEXT)
|
||||
subdir = examples
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
|
||||
$(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/build-to-host.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gtk-doc.m4 \
|
||||
$(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 \
|
||||
$(top_srcdir)/m4/introspection.m4 $(top_srcdir)/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
|
||||
@@ -125,6 +127,9 @@ am__v_lt_1 =
|
||||
am_df_OBJECTS = df.$(OBJEXT)
|
||||
df_OBJECTS = $(am_df_OBJECTS)
|
||||
df_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
am_disk_OBJECTS = disk.$(OBJEXT)
|
||||
disk_OBJECTS = $(am_disk_OBJECTS)
|
||||
disk_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
am_diskio_OBJECTS = diskio.$(OBJEXT)
|
||||
diskio_OBJECTS = $(am_diskio_OBJECTS)
|
||||
diskio_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
@@ -167,6 +172,9 @@ smp_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
am_sysdeps_OBJECTS = sysdeps.$(OBJEXT)
|
||||
sysdeps_OBJECTS = $(am_sysdeps_OBJECTS)
|
||||
sysdeps_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
am_sysinfo_OBJECTS = sysinfo.$(OBJEXT)
|
||||
sysinfo_OBJECTS = $(am_sysinfo_OBJECTS)
|
||||
sysinfo_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
am_timings_OBJECTS = timings.$(OBJEXT)
|
||||
timings_OBJECTS = $(am_timings_OBJECTS)
|
||||
timings_DEPENDENCIES = $(top_builddir)/lib/libgtop-2.0.la
|
||||
@@ -189,13 +197,14 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__maybe_remake_depfiles = depfiles
|
||||
am__depfiles_remade = ./$(DEPDIR)/affinity.Po ./$(DEPDIR)/df.Po \
|
||||
./$(DEPDIR)/diskio.Po ./$(DEPDIR)/first.Po ./$(DEPDIR)/free.Po \
|
||||
./$(DEPDIR)/mountlist.Po ./$(DEPDIR)/netlist.Po \
|
||||
./$(DEPDIR)/netload.Po ./$(DEPDIR)/openfiles.Po \
|
||||
./$(DEPDIR)/pprint.Po ./$(DEPDIR)/procargs.Po \
|
||||
./$(DEPDIR)/proclist.Po ./$(DEPDIR)/procmap.Po \
|
||||
./$(DEPDIR)/second.Po ./$(DEPDIR)/smp.Po \
|
||||
./$(DEPDIR)/sysdeps.Po ./$(DEPDIR)/timings.Po \
|
||||
./$(DEPDIR)/disk.Po ./$(DEPDIR)/diskio.Po ./$(DEPDIR)/first.Po \
|
||||
./$(DEPDIR)/free.Po ./$(DEPDIR)/mountlist.Po \
|
||||
./$(DEPDIR)/netlist.Po ./$(DEPDIR)/netload.Po \
|
||||
./$(DEPDIR)/openfiles.Po ./$(DEPDIR)/pprint.Po \
|
||||
./$(DEPDIR)/procargs.Po ./$(DEPDIR)/proclist.Po \
|
||||
./$(DEPDIR)/procmap.Po ./$(DEPDIR)/second.Po \
|
||||
./$(DEPDIR)/smp.Po ./$(DEPDIR)/sysdeps.Po \
|
||||
./$(DEPDIR)/sysinfo.Po ./$(DEPDIR)/timings.Po \
|
||||
./$(DEPDIR)/wd.Po
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
@@ -216,18 +225,20 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
|
||||
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
am__v_CCLD_1 =
|
||||
SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(diskio_SOURCES) \
|
||||
$(first_SOURCES) free.c $(mountlist_SOURCES) \
|
||||
SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(disk_SOURCES) \
|
||||
$(diskio_SOURCES) $(first_SOURCES) free.c $(mountlist_SOURCES) \
|
||||
$(netlist_SOURCES) $(netload_SOURCES) $(openfiles_SOURCES) \
|
||||
$(pprint_SOURCES) $(procargs_SOURCES) $(proclist_SOURCES) \
|
||||
$(procmap_SOURCES) $(second_SOURCES) $(smp_SOURCES) \
|
||||
$(sysdeps_SOURCES) $(timings_SOURCES) $(wd_SOURCES)
|
||||
DIST_SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(diskio_SOURCES) \
|
||||
$(first_SOURCES) free.c $(mountlist_SOURCES) \
|
||||
$(sysdeps_SOURCES) $(sysinfo_SOURCES) $(timings_SOURCES) \
|
||||
$(wd_SOURCES)
|
||||
DIST_SOURCES = $(affinity_SOURCES) $(df_SOURCES) $(disk_SOURCES) \
|
||||
$(diskio_SOURCES) $(first_SOURCES) free.c $(mountlist_SOURCES) \
|
||||
$(netlist_SOURCES) $(netload_SOURCES) $(openfiles_SOURCES) \
|
||||
$(pprint_SOURCES) $(procargs_SOURCES) $(proclist_SOURCES) \
|
||||
$(procmap_SOURCES) $(second_SOURCES) $(smp_SOURCES) \
|
||||
$(sysdeps_SOURCES) $(timings_SOURCES) $(wd_SOURCES)
|
||||
$(sysdeps_SOURCES) $(sysinfo_SOURCES) $(timings_SOURCES) \
|
||||
$(wd_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
@@ -250,8 +261,6 @@ am__define_uniq_tagged_files = \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | $(am__uniquify_input)`
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
|
||||
ChangeLog
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
@@ -278,6 +287,8 @@ CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CSCOPE = @CSCOPE@
|
||||
CTAGS = @CTAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
@@ -289,8 +300,10 @@ ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
ETAGS = @ETAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
FILECMD = @FILECMD@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
@@ -341,6 +354,7 @@ LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LSBLK = @LSBLK@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
@@ -350,8 +364,8 @@ MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
@@ -376,6 +390,7 @@ SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
TR = @TR@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
@@ -428,6 +443,8 @@ libgtop_sysdeps_dir = @libgtop_sysdeps_dir@
|
||||
libgtop_top_builddir = @libgtop_top_builddir@
|
||||
libs_xauth = @libs_xauth@
|
||||
localedir = @localedir@
|
||||
localedir_c = @localedir_c@
|
||||
localedir_c_make = @localedir_c_make@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
@@ -436,6 +453,7 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
server_programs = @server_programs@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
@@ -462,6 +480,8 @@ mountlist_SOURCES = mountlist.c
|
||||
mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
smp_SOURCES = smp.c
|
||||
smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
disk_SOURCES = disk.c
|
||||
disk_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm
|
||||
timings_SOURCES = timings.c
|
||||
timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
pprint_SOURCES = pprint.c
|
||||
@@ -484,6 +504,8 @@ affinity_SOURCES = affinity.c
|
||||
affinity_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
diskio_SOURCES = diskio.c
|
||||
diskio_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
sysinfo_SOURCES = sysinfo.c
|
||||
sysinfo_LDADD = $(top_builddir)/lib/libgtop-2.0.la
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
@@ -535,6 +557,10 @@ df$(EXEEXT): $(df_OBJECTS) $(df_DEPENDENCIES) $(EXTRA_df_DEPENDENCIES)
|
||||
@rm -f df$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(df_OBJECTS) $(df_LDADD) $(LIBS)
|
||||
|
||||
disk$(EXEEXT): $(disk_OBJECTS) $(disk_DEPENDENCIES) $(EXTRA_disk_DEPENDENCIES)
|
||||
@rm -f disk$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(disk_OBJECTS) $(disk_LDADD) $(LIBS)
|
||||
|
||||
diskio$(EXEEXT): $(diskio_OBJECTS) $(diskio_DEPENDENCIES) $(EXTRA_diskio_DEPENDENCIES)
|
||||
@rm -f diskio$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(diskio_OBJECTS) $(diskio_LDADD) $(LIBS)
|
||||
@@ -591,6 +617,10 @@ sysdeps$(EXEEXT): $(sysdeps_OBJECTS) $(sysdeps_DEPENDENCIES) $(EXTRA_sysdeps_DEP
|
||||
@rm -f sysdeps$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(sysdeps_OBJECTS) $(sysdeps_LDADD) $(LIBS)
|
||||
|
||||
sysinfo$(EXEEXT): $(sysinfo_OBJECTS) $(sysinfo_DEPENDENCIES) $(EXTRA_sysinfo_DEPENDENCIES)
|
||||
@rm -f sysinfo$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(sysinfo_OBJECTS) $(sysinfo_LDADD) $(LIBS)
|
||||
|
||||
timings$(EXEEXT): $(timings_OBJECTS) $(timings_DEPENDENCIES) $(EXTRA_timings_DEPENDENCIES)
|
||||
@rm -f timings$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(timings_OBJECTS) $(timings_LDADD) $(LIBS)
|
||||
@@ -607,6 +637,7 @@ distclean-compile:
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/affinity.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/df.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disk.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskio.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/first.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ # am--include-marker
|
||||
@@ -621,6 +652,7 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/second.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/smp.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysdeps.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timings.Po@am__quote@ # am--include-marker
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wd.Po@am__quote@ # am--include-marker
|
||||
|
||||
@@ -708,7 +740,6 @@ cscopelist-am: $(am__tagged_files)
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
@@ -784,6 +815,7 @@ clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
|
||||
distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/affinity.Po
|
||||
-rm -f ./$(DEPDIR)/df.Po
|
||||
-rm -f ./$(DEPDIR)/disk.Po
|
||||
-rm -f ./$(DEPDIR)/diskio.Po
|
||||
-rm -f ./$(DEPDIR)/first.Po
|
||||
-rm -f ./$(DEPDIR)/free.Po
|
||||
@@ -798,6 +830,7 @@ distclean: distclean-am
|
||||
-rm -f ./$(DEPDIR)/second.Po
|
||||
-rm -f ./$(DEPDIR)/smp.Po
|
||||
-rm -f ./$(DEPDIR)/sysdeps.Po
|
||||
-rm -f ./$(DEPDIR)/sysinfo.Po
|
||||
-rm -f ./$(DEPDIR)/timings.Po
|
||||
-rm -f ./$(DEPDIR)/wd.Po
|
||||
-rm -f Makefile
|
||||
@@ -847,6 +880,7 @@ installcheck-am:
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f ./$(DEPDIR)/affinity.Po
|
||||
-rm -f ./$(DEPDIR)/df.Po
|
||||
-rm -f ./$(DEPDIR)/disk.Po
|
||||
-rm -f ./$(DEPDIR)/diskio.Po
|
||||
-rm -f ./$(DEPDIR)/first.Po
|
||||
-rm -f ./$(DEPDIR)/free.Po
|
||||
@@ -861,6 +895,7 @@ maintainer-clean: maintainer-clean-am
|
||||
-rm -f ./$(DEPDIR)/second.Po
|
||||
-rm -f ./$(DEPDIR)/smp.Po
|
||||
-rm -f ./$(DEPDIR)/sysdeps.Po
|
||||
-rm -f ./$(DEPDIR)/sysinfo.Po
|
||||
-rm -f ./$(DEPDIR)/timings.Po
|
||||
-rm -f ./$(DEPDIR)/wd.Po
|
||||
-rm -f Makefile
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Contributed by James Dominic P. Guana <guana.histark@gmail.com>, May 2020.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
LibGTop 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LibGTop; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/disk.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
glibtop_disk disk;
|
||||
char separator [BUFSIZ];
|
||||
int ndisk, i;
|
||||
|
||||
glibtop_init();
|
||||
|
||||
glibtop_get_disk (&disk);
|
||||
|
||||
ndisk = glibtop_global_server->ndisk ? glibtop_global_server->ndisk : 1;
|
||||
|
||||
memset (separator, '-', 91);
|
||||
separator [92] = '\0';
|
||||
|
||||
printf("\n\n");
|
||||
printf ("ELAPSE ");
|
||||
printf ("Read (b) Time Read (ms) Write (b) Time Write (ms)\n");
|
||||
printf ("%s\n", separator);
|
||||
|
||||
for (i = 0; i < ndisk; i++) {
|
||||
printf ("DISK %3d : %15lu %15lu %15lu %15lu\n", i,
|
||||
(unsigned long) disk.xdisk_sectors_read [i] * 512,
|
||||
(unsigned long) disk.xdisk_time_read [i],
|
||||
(unsigned long) disk.xdisk_sectors_write [i] * 512,
|
||||
(unsigned long) disk.xdisk_time_write [i]);
|
||||
|
||||
}
|
||||
|
||||
printf ("%s\n\n\n", separator);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
@@ -71,7 +71,9 @@ main (int argc, char *argv [])
|
||||
|
||||
printf ("Host = '%s' - %u\n\n", buffer, port);
|
||||
|
||||
#ifdef HAVE_SBRK
|
||||
printf ("sbrk (0) = %p\n\n", sbrk (0));
|
||||
#endif
|
||||
|
||||
for (c = 0; c < PROFILE_COUNT; c++) {
|
||||
mount_entries = glibtop_get_mountlist (&mount_list, 1);
|
||||
@@ -79,7 +81,9 @@ main (int argc, char *argv [])
|
||||
g_free (mount_entries);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SBRK
|
||||
printf ("sbrk (0) = %p\n\n", sbrk (0));
|
||||
#endif
|
||||
|
||||
mount_entries = glibtop_get_mountlist (&mount_list, 1);
|
||||
|
||||
@@ -108,7 +112,9 @@ main (int argc, char *argv [])
|
||||
|
||||
g_free (mount_entries);
|
||||
|
||||
#ifdef HAVE_SBRK
|
||||
printf ("\nsbrk (0) = %p\n\n", sbrk (0));
|
||||
#endif
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
|
||||
+3
-7
@@ -66,7 +66,7 @@ main (int argc, char *argv [])
|
||||
glibtop_netload netload;
|
||||
unsigned method, count, port;
|
||||
struct in_addr addr, subnet;
|
||||
char *address_string, *subnet_string;
|
||||
char address_string[INET_ADDRSTRLEN], subnet_string[INET_ADDRSTRLEN];
|
||||
char address6_string[INET6_ADDRSTRLEN], prefix6_string[INET6_ADDRSTRLEN];
|
||||
char *hwaddress_string;
|
||||
char buffer [BUFSIZ];
|
||||
@@ -105,9 +105,8 @@ main (int argc, char *argv [])
|
||||
addr.s_addr = netload.address;
|
||||
subnet.s_addr = netload.subnet;
|
||||
|
||||
address_string = g_strdup (inet_ntoa (addr));
|
||||
subnet_string = g_strdup (inet_ntoa (subnet));
|
||||
|
||||
inet_ntop (AF_INET, &addr, address_string, INET_ADDRSTRLEN);
|
||||
inet_ntop (AF_INET, &subnet, subnet_string, INET_ADDRSTRLEN);
|
||||
inet_ntop (AF_INET6, netload.address6, address6_string, INET6_ADDRSTRLEN);
|
||||
inet_ntop (AF_INET6, netload.prefix6, prefix6_string, INET6_ADDRSTRLEN);
|
||||
|
||||
@@ -153,9 +152,6 @@ main (int argc, char *argv [])
|
||||
hwaddress_string);
|
||||
|
||||
|
||||
g_free (address_string);
|
||||
g_free (subnet_string);
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Contributed by Dr. James Dominic P. Guana <jdpguana@histark.com>, August 2021.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
LibGTop 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LibGTop; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <locale.h>
|
||||
#include <libintl.h>
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/sysinfo.h>
|
||||
|
||||
int
|
||||
main (int argc, char *argv [])
|
||||
{
|
||||
char *model;
|
||||
const glibtop_sysinfo * sysinfo;
|
||||
|
||||
glibtop_init();
|
||||
sysinfo = glibtop_get_sysinfo ();
|
||||
model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name");
|
||||
|
||||
printf ("\nProcessor Model: %s\n", g_strdup (model));
|
||||
printf ("Number of Cores: %lu\n\n", sysinfo->ncpu);
|
||||
|
||||
glibtop_close ();
|
||||
|
||||
exit (0);
|
||||
}
|
||||
Reference in New Issue
Block a user