=> Building devel/libgtop Started : Tuesday, 23 JUL 2019 at 09:30:11 UTC Platform: 5.7-DEVELOPMENT DragonFly v5.7.0.83.g49866-DEVELOPMENT #40: Sun Jun 30 03:00:04 PDT 2019 root@pkgbox64.dragonflybsd.org:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64 -------------------------------------------------- -- Environment -------------------------------------------------- UNAME_r=5.6-SYNTH UNAME_m=x86_64 UNAME_p=x86_64 UNAME_v=DragonFly 5.6-SYNTH UNAME_s=DragonFly PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin SSL_NO_VERIFY_PEER=1 TERM=dumb PKG_CACHEDIR=/var/cache/pkg8 PKG_DBDIR=/var/db/pkg8 PORTSDIR=/xports LANG=C HOME=/root USER=root -------------------------------------------------- -- Options -------------------------------------------------- -------------------------------------------------- -- CONFIGURE_ENV -------------------------------------------------- MAKE=gmake GTKDOC="false" ac_cv_path_PERL=/usr/local/bin/perl ac_cv_path_PERL_PATH=/usr/local/bin/perl PERL_USE_UNSAFE_INC=1 PKG_CONFIG=pkgconf XDG_DATA_HOME=/construction/devel/libgtop XDG_CONFIG_HOME=/construction/devel/libgtop HOME=/construction/devel/libgtop TMPDIR="/tmp" PATH=/construction/devel/libgtop/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin SHELL=/bin/sh CONFIG_SHELL=/bin/sh CCVER=gcc80 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 CONFIG_SITE=/xports/Templates/config.site lt_cv_sys_max_cmd_len=262144 -------------------------------------------------- -- CONFIGURE_ARGS -------------------------------------------------- --enable-introspection --localstatedir=/usr/local/share --with-html-dir=/usr/local/share/doc --disable-gtk-doc --with-gconf-source=xml:merged:/usr/local/etc/gconf/gconf.xml.defaults --x-libraries=/usr/local/lib --x-includes=/usr/local/include --prefix=/usr/local ${_LATE_CONFIGURE_ARGS} -------------------------------------------------- -- MAKE_ENV -------------------------------------------------- GI_SCANNER_DISABLE_CACHE=1 XDG_CACHE_HOME=/construction/devel/libgtop PERL_USE_UNSAFE_INC=1 XDG_DATA_HOME=/construction/devel/libgtop XDG_CONFIG_HOME=/construction/devel/libgtop HOME=/construction/devel/libgtop TMPDIR="/tmp" PATH=/construction/devel/libgtop/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES CCVER=gcc80 LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 PREFIX=/usr/local LOCALBASE=/usr/local NOPROFILE=1 CC="cc" CFLAGS="-pipe -O2 -fno-strict-aliasing " CPP="cpp" CPPFLAGS="" LDFLAGS=" " LIBS="" CXX="c++" CXXFLAGS=" -pipe -O2 -fno-strict-aliasing " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 0644" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" -------------------------------------------------- -- MAKE_ARGS -------------------------------------------------- DESTDIR=/construction/devel/libgtop/stage -------------------------------------------------- -- PLIST_SUB -------------------------------------------------- GTK2_VERSION="2.10.0" GTK3_VERSION="3.0.0" OSREL=5.6 PREFIX=%D LOCALBASE=/usr/local RESETPREFIX=/usr/local LIB32DIR=lib PERL_VERSION=5.28.2 PERL_VER=5.28 PERL5_MAN1=lib/perl5/site_perl/man/man1 PERL5_MAN3=lib/perl5/site_perl/man/man3 SITE_PERL=lib/perl5/site_perl SITE_ARCH=lib/perl5/site_perl/mach/5.28 PROFILE="@comment " DOCSDIR="share/doc/libgtop" EXAMPLESDIR="share/examples/libgtop" DATADIR="share/libgtop" WWWDIR="www/libgtop" ETCDIR="etc/libgtop" -------------------------------------------------- -- SUB_LIST -------------------------------------------------- PREFIX=/usr/local LOCALBASE=/usr/local DATADIR=/usr/local/share/libgtop DOCSDIR=/usr/local/share/doc/libgtop EXAMPLESDIR=/usr/local/share/examples/libgtop WWWDIR=/usr/local/www/libgtop ETCDIR=/usr/local/etc/libgtop -------------------------------------------------- -- /etc/make.conf -------------------------------------------------- SYNTHPROFILE=Release-5.6 USE_PACKAGE_DEPENDS_ONLY=yes PACKAGE_BUILDING=yes BATCH=yes PKG_CREATE_VERBOSE=yes PORTSDIR=/xports DISTDIR=/distfiles WRKDIRPREFIX=/construction PORT_DBDIR=/options PACKAGES=/packages MAKE_JOBS_NUMBER_LIMIT=5 LICENSES_ACCEPTED= NONE HAVE_COMPAT_IA32_KERN= CONFIGURE_MAX_CMD_LEN=262144 _PERL5_FROM_BIN=5.28.1 _ALTCCVERSION_921dbbb2=none _OBJC_ALTCCVERSION_921dbbb2=none _SMP_CPUS=8 UID=0 ARCH=x86_64 OPSYS=DragonFly DFLYVERSION=500601 OSVERSION=9999999 OSREL=5.6 _OSRELEASE=5.6-SYNTH PYTHONBASE=/usr/local _PKG_CHECKED=1 -------------------------------------------------------------------------------- -- Phase: check-sanity -------------------------------------------------------------------------------- ===> License GPLv2 accepted by the user -------------------------------------------------------------------------------- -- Phase: pkg-depends -------------------------------------------------------------------------------- ===> libgtop-2.38.0_1 depends on file: /usr/local/sbin/pkg - not found ===> Installing existing package /packages/All/pkg-1.11.1.txz Installing pkg-1.11.1... Extracting pkg-1.11.1: .......... done ===> libgtop-2.38.0_1 depends on file: /usr/local/sbin/pkg - found ===> Returning to build of libgtop-2.38.0_1 -------------------------------------------------------------------------------- -- Phase: fetch-depends -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Phase: fetch -------------------------------------------------------------------------------- ===> License GPLv2 accepted by the user ===> Fetching all distfiles required by libgtop-2.38.0_1 for building -------------------------------------------------------------------------------- -- Phase: checksum -------------------------------------------------------------------------------- ===> License GPLv2 accepted by the user ===> Fetching all distfiles required by libgtop-2.38.0_1 for building => SHA256 Checksum OK for gnome2/libgtop-2.38.0.tar.xz. -------------------------------------------------------------------------------- -- Phase: extract-depends -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Phase: extract -------------------------------------------------------------------------------- ===> License GPLv2 accepted by the user ===> Fetching all distfiles required by libgtop-2.38.0_1 for building ===> Extracting for libgtop-2.38.0_1 => SHA256 Checksum OK for gnome2/libgtop-2.38.0.tar.xz. -------------------------------------------------------------------------------- -- Phase: patch-depends -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Phase: patch -------------------------------------------------------------------------------- ===> Patching for libgtop-2.38.0_1 ===> Applying ports patches for libgtop-2.38.0_1 ===> Applying dragonfly patches for libgtop-2.38.0_1 -------------------------------------------------------------------------------- -- Phase: build-depends -------------------------------------------------------------------------------- ===> libgtop-2.38.0_1 depends on executable: msgfmt - not found ===> Installing existing package /packages/All/gettext-tools-0.20.1.txz Installing gettext-tools-0.20.1... `-- Installing gettext-runtime-0.20.1... | `-- Installing indexinfo-0.3.1... | `-- Extracting indexinfo-0.3.1: .... done `-- Extracting gettext-runtime-0.20.1: .......... done `-- Installing libtextstyle-0.20.1... | `-- Installing ncurses-6.1.20190525... | `-- Extracting ncurses-6.1.20190525: .......... done `-- Extracting libtextstyle-0.20.1: .......... done Extracting gettext-tools-0.20.1: .......... done ===> libgtop-2.38.0_1 depends on executable: msgfmt - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on executable: gmake - not found ===> Installing existing package /packages/All/gmake-4.2.1_3.txz Installing gmake-4.2.1_3... Extracting gmake-4.2.1_3: .......... done ===> libgtop-2.38.0_1 depends on executable: gmake - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on file: /usr/local/bin/intltool-extract - not found ===> Installing existing package /packages/All/intltool-0.51.0_1.txz Installing intltool-0.51.0_1... `-- Installing p5-XML-Parser-2.44... | `-- Installing expat-2.2.6_1... | `-- Extracting expat-2.2.6_1: .......... done | `-- Installing perl5-5.28.2... | `-- Extracting perl5-5.28.2: .......... done `-- Extracting p5-XML-Parser-2.44: .......... done Extracting intltool-0.51.0_1: .......... done Message from perl5-5.28.2: The /usr/bin/perl symlink has been removed starting with Perl 5.20. For shebangs, you should either use: #!/usr/local/bin/perl or #!/usr/bin/env perl The first one will only work if you have a /usr/local/bin/perl, the second will work as long as perl is in PATH. ===> libgtop-2.38.0_1 depends on file: /usr/local/bin/intltool-extract - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on executable: g-ir-scanner - not found ===> Installing existing package /packages/All/gobject-introspection-1.56.1,1.txz Installing gobject-introspection-1.56.1,1... `-- Installing glib-2.56.3_5,1... | `-- Installing libffi-3.2.1_3... | `-- Extracting libffi-3.2.1_3: .......... done | `-- Installing libiconv-1.14_11... | `-- Extracting libiconv-1.14_11: .......... done | `-- Installing libxml2-2.9.9... | `-- Extracting libxml2-2.9.9: .......... done | `-- Installing pcre-8.43_1... | `-- Extracting pcre-8.43_1: .......... done | `-- Installing python36-3.6.9... | | `-- Installing libressl-2.9.2... | | `-- Extracting libressl-2.9.2: .......... done | | `-- Installing readline-8.0.0... | | `-- Extracting readline-8.0.0: .......... done | `-- Extracting python36-3.6.9: .......... done `-- Extracting glib-2.56.3_5,1: .......... done No schema files found: doing nothing. Extracting gobject-introspection-1.56.1,1: .......... done Message from python36-3.6.9: =========================================================================== Note that some standard Python modules are provided as separate ports as they require additional dependencies. They are available as: py36-gdbm databases/py-gdbm@py36 py36-sqlite3 databases/py-sqlite3@py36 py36-tkinter x11-toolkits/py-tkinter@py36 =========================================================================== ===> libgtop-2.38.0_1 depends on executable: g-ir-scanner - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on executable: makeinfo - not found ===> Installing existing package /packages/All/texinfo-6.6_1,1.txz Installing texinfo-6.6_1,1... `-- Installing p5-Locale-libintl-1.31... `-- Extracting p5-Locale-libintl-1.31: .......... done `-- Installing p5-Text-Unidecode-1.30... `-- Extracting p5-Text-Unidecode-1.30: .......... done `-- Installing p5-Unicode-EastAsianWidth-1.40... `-- Extracting p5-Unicode-EastAsianWidth-1.40: ...... done Extracting texinfo-6.6_1,1: .......... done ===> libgtop-2.38.0_1 depends on executable: makeinfo - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on package: pkgconf>=1.3.0_1 - not found ===> Installing existing package /packages/All/pkgconf-1.6.1,1.txz Installing pkgconf-1.6.1,1... Extracting pkgconf-1.6.1,1: .......... done ===> libgtop-2.38.0_1 depends on package: pkgconf>=1.3.0_1 - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on file: /usr/local/libdata/pkgconfig/xau.pc - not found ===> Installing existing package /packages/All/libXau-1.0.9.txz Installing libXau-1.0.9... Extracting libXau-1.0.9: .......... done ===> libgtop-2.38.0_1 depends on file: /usr/local/libdata/pkgconfig/xau.pc - found ===> Returning to build of libgtop-2.38.0_1 ===> libgtop-2.38.0_1 depends on package: perl5>=5.28.r1<5.29 - found -------------------------------------------------------------------------------- -- Phase: lib-depends -------------------------------------------------------------------------------- ===> libgtop-2.38.0_1 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so) ===> libgtop-2.38.0_1 depends on shared library: libglib-2.0.so - found (/usr/local/lib/libglib-2.0.so) ===> libgtop-2.38.0_1 depends on shared library: libintl.so - found (/usr/local/lib/libintl.so) -------------------------------------------------------------------------------- -- Phase: configure -------------------------------------------------------------------------------- ===> Configuring for libgtop-2.38.0_1 configure: WARNING: unrecognized options: --with-gconf-source configure: loading site script /xports/Templates/config.site checking build system type... x86_64-portbld-dragonfly5.6 checking host system type... x86_64-portbld-dragonfly5.6 checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... (cached) /bin/mkdir -p checking for gawk... (cached) /usr/bin/awk checking whether gmake sets $(MAKE)... yes checking whether gmake supports nested variables... yes checking whether UID '0' is supported by ustar format... yes checking whether GID '0' is supported by ustar format... yes checking how to create a ustar tar archive... (cached) /usr/bin/tar checking whether gmake supports nested variables... (cached) yes checking pkg-config is at least version 0.9.0... yes checking for gobject-introspection... yes checking for style of include used by gmake... GNU checking for gcc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking whether cc understands -c and -o together... yes checking dependency style of cc... gcc3 checking for library containing strerror... none required checking for gcc... (cached) cc checking whether we are using the GNU C compiler... (cached) yes checking whether cc accepts -g... (cached) yes checking for cc option to accept ISO C89... (cached) none needed checking whether cc understands -c and -o together... (cached) yes checking dependency style of cc... (cached) gcc3 checking how to run the C preprocessor... cpp checking for grep that handles long lines and -e... (cached) /usr/bin/grep checking for egrep... (cached) /usr/bin/egrep checking for ANSI C header files... (cached) yes checking for gawk... (cached) /usr/bin/awk checking for perl5... perl5 checking for gcc... (cached) cc checking for ranlib... ranlib checking for as... as checking for ar... ar checking whether ln -s works... yes checking whether gmake sets $(MAKE)... (cached) yes checking how to print strings... printf checking for a sed that does not truncate output... (cached) /usr/bin/sed checking for fgrep... (cached) /usr/bin/fgrep checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking the maximum length of command line arguments... (cached) 262144 checking how to convert x86_64-portbld-dragonfly5.6 file names to x86_64-portbld-dragonfly5.6 format... func_convert_file_noop checking how to convert x86_64-portbld-dragonfly5.6 file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... (cached) ranlib checking command to parse /usr/bin/nm -B output from cc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking for sys/types.h... (cached) yes checking for sys/stat.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for memory.h... (cached) yes checking for strings.h... (cached) yes checking for inttypes.h... (cached) yes checking for stdint.h... (cached) yes checking for unistd.h... (cached) yes checking for dlfcn.h... (cached) yes checking for objdir... .libs checking if cc supports -fno-rtti -fno-exceptions... no checking for cc option to produce PIC... -fPIC -DPIC checking if cc PIC flag -fPIC -DPIC works... yes checking if cc static flag -static works... yes checking if cc supports -c -o file.o... yes checking if cc supports -c -o file.o... (cached) yes checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... dragonfly5.6 ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for libgtop sysdeps directory... freebsd checking for kvm_open in -lkvm... yes checking for net/if_var.h... yes checking for I4B... no checking what we need to define to get struct msginfo... _KERNEL checking whether we need libgtop... yes checking sys/bitypes.h usability... no checking sys/bitypes.h presence... no checking for sys/bitypes.h... no checking for GLIB... yes checking ifaddrs.h usability... yes checking ifaddrs.h presence... yes checking for ifaddrs.h... yes checking for kinfo_getfile in -lutil... no checking for an ANSI C-conforming const... yes checking for inline... inline checking for off_t... (cached) yes checking for pid_t... (cached) yes checking for size_t... (cached) yes checking for struct stat.st_rdev... yes checking whether time.h and sys/time.h may both be included... yes checking whether struct tm is in sys/time.h or time.h... time.h checking for uid_t in sys/types.h... (cached) yes checking for ssize_t... (cached) yes checking for memory.h... (cached) yes checking for string.h... (cached) yes checking for strerror... (cached) yes checking for dlopen... (cached) yes checking for dlerror... yes checking linux/isdn.h usability... no checking linux/isdn.h presence... no checking for linux/isdn.h... no checking for vmgetinfo in -lperfstat... no checking for vm_statistics in -lmach... no checking whether program_invocation_name must be declared... yes checking for socket... yes checking for netinet/in.h... (cached) yes checking for arpa/inet.h... (cached) yes checking "for sun_len member in struct sockaddr_un"... yes checking for working alloca.h... yes checking for alloca... yes checking for stdlib.h... (cached) yes checking for unistd.h... (cached) yes checking for sys/param.h... (cached) yes checking for getpagesize... (cached) yes checking for working mmap... yes checking return type of signal handlers... void checking for strftime... (cached) yes checking for getcwd... (cached) yes checking for gettimeofday... (cached) yes checking for getwd... (cached) yes checking for putenv... (cached) yes checking for strdup... (cached) yes checking for strtoul... (cached) yes checking for uname... (cached) yes checking whether NLS is requested... yes checking for msgfmt... /usr/local/bin/msgfmt checking for gmsgfmt... /usr/local/bin/msgfmt checking for xgettext... /usr/local/bin/xgettext checking for msgmerge... /usr/local/bin/msgmerge checking for ld used by cc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for shared library run path origin... done checking for CFPreferencesCopyAppValue... no checking for CFLocaleCopyCurrent... no checking for GNU gettext in libc... no checking for iconv... yes checking for working iconv... yes checking how to link with libiconv... /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib checking for GNU gettext in libintl... yes checking whether to use NLS... yes checking where the gettext function comes from... external libintl checking how to link with libintl... /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib checking for X... libraries /usr/local/lib, headers /usr/local/include checking whether -R must be followed by a space... no checking for dnet_ntoa in -ldnet... no checking for dnet_ntoa in -ldnet_stub... no checking for gethostbyname... (cached) yes checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... no checking for gethostbyname... (cached) yes checking for connect... (cached) yes checking for inet_aton... (cached) yes checking X11/Xauth.h usability... no checking X11/Xauth.h presence... no checking for X11/Xauth.h... no checking for fcntl.h... (cached) yes checking for sys/param.h... (cached) yes checking sys/statfs.h usability... no checking sys/statfs.h presence... no checking for sys/statfs.h... no checking sys/fstyp.h usability... no checking sys/fstyp.h presence... no checking for sys/fstyp.h... no checking mnttab.h usability... no checking mnttab.h presence... no checking for mnttab.h... no checking mntent.h usability... no checking mntent.h presence... no checking for mntent.h... no checking for sys/statvfs.h... (cached) yes checking sys/vfs.h usability... no checking sys/vfs.h presence... no checking for sys/vfs.h... no checking for sys/mount.h... (cached) yes checking sys/filsys.h usability... no checking sys/filsys.h presence... no checking for sys/filsys.h... no checking sys/fs_types.h usability... no checking sys/fs_types.h presence... no checking for sys/fs_types.h... no checking sys/fs/s5param.h usability... no checking sys/fs/s5param.h presence... no checking for sys/fs/s5param.h... no checking for bcopy... (cached) yes checking for endgrent... (cached) yes checking for endpwent... yes checking for fchdir... yes checking for ftime... no checking for ftruncate... yes checking for getcwd... (cached) yes checking for getmntinfo... yes checking for gettimeofday... (cached) yes checking for isascii... (cached) yes checking for lchown... yes checking for listmntent... no checking for memcpy... (cached) yes checking for mkfifo... yes checking for strchr... (cached) yes checking for strerror... (cached) yes checking for strrchr... (cached) yes checking for vprintf... (cached) yes checking for library containing getmntent... no checking for listmntent of Cray/Unicos-9... no checking for getfsstat function... no checking for mntctl function and struct vmount... no checking for FIXME existence of three headers... no checking for getmntinfo function... yes configure: checking how to get filesystem space usage... checking statvfs function (SVR4)... yes checking for statfs that truncates block counts... no configure: checking for AFS... checking for gtk-doc... no configure: WARNING: You will not be able to create source packages with 'make dist' because gtk-doc >= 1.4 is not found. checking for gtkdoc-check... no checking for gtkdoc-check... no checking for gtkdoc-rebase... no checking for gtkdoc-mkpdf... no checking whether to build gtk-doc documentation... no checking for GTKDOC_DEPS... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating libgtop.spec config.status: creating po/Makefile.in config.status: creating misc/Makefile config.status: creating include/Makefile config.status: creating include/glibtop/Makefile config.status: creating sysdeps/Makefile config.status: creating sysdeps/common/Makefile config.status: creating sysdeps/stub/Makefile config.status: creating sysdeps/stub_suid/Makefile config.status: creating sysdeps/sun4/Makefile config.status: creating sysdeps/osf1/Makefile config.status: creating sysdeps/linux/Makefile config.status: creating sysdeps/freebsd/Makefile config.status: creating sysdeps/solaris/Makefile config.status: creating sysdeps/aix/Makefile config.status: creating sysdeps/bsd/Makefile config.status: creating sysdeps/darwin/Makefile config.status: creating sysdeps/cygwin/Makefile config.status: creating sysdeps/openbsd/Makefile config.status: creating src/Makefile config.status: creating src/daemon/Makefile config.status: creating lib/Makefile config.status: creating examples/Makefile config.status: creating doc/Makefile config.status: creating doc/reference/Makefile config.status: creating doc/reference/version.xml config.status: creating libgtop-2.0.pc config.status: creating libgtopconfig.h config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing po-directories commands config.status: creating po/POTFILES config.status: creating po/Makefile configure: WARNING: unrecognized options: --with-gconf-source -------------------------------------------------------------------------------- -- Phase: build -------------------------------------------------------------------------------- ===> Building for libgtop-2.38.0_1 gmake[1]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' gmake all-recursive gmake[2]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' Making all in po gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/po' gmake[3]: Nothing to be done for 'all'. gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/po' Making all in misc gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/misc' gmake[3]: Nothing to be done for 'all'. gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/misc' Making all in include gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include' Making all in glibtop gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[4]: Nothing to be done for 'all'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[4]: Nothing to be done for 'all-am'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include' Making all in sysdeps gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' Making all in common gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT error.lo -MD -MP -MF .deps/error.Tpo -c -o error.lo error.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT gnuslib.lo -MD -MP -MF .deps/gnuslib.Tpo -c -o gnuslib.lo gnuslib.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c -o procargs.lo procargs.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT default.lo -MD -MP -MF .deps/default.Tpo -c -o default.lo default.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps_suid.lo -MD -MP -MF .deps/sysdeps_suid.Tpo -c -o sysdeps_suid.lo sysdeps_suid.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c procargs.c -fPIC -DPIC -o .libs/procargs.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT gnuslib.lo -MD -MP -MF .deps/gnuslib.Tpo -c gnuslib.c -fPIC -DPIC -o .libs/gnuslib.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT default.lo -MD -MP -MF .deps/default.Tpo -c default.c -fPIC -DPIC -o .libs/default.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c procargs.c -o procargs.o >/dev/null 2>&1 mv -f .deps/procargs.Tpo .deps/procargs.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT gnuslib.lo -MD -MP -MF .deps/gnuslib.Tpo -c gnuslib.c -o gnuslib.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps_suid.lo -MD -MP -MF .deps/sysdeps_suid.Tpo -c sysdeps_suid.c -fPIC -DPIC -o .libs/sysdeps_suid.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT default.lo -MD -MP -MF .deps/default.Tpo -c default.c -o default.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps_suid.lo -MD -MP -MF .deps/sysdeps_suid.Tpo -c sysdeps_suid.c -o sysdeps_suid.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -fPIC -DPIC -o .libs/error.o mv -f .deps/gnuslib.Tpo .deps/gnuslib.Plo mv -f .deps/sysdeps_suid.Tpo .deps/sysdeps_suid.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT error.lo -MD -MP -MF .deps/error.Tpo -c error.c -o error.o >/dev/null 2>&1 mv -f .deps/default.Tpo .deps/default.Plo mv -f .deps/error.Tpo .deps/error.Plo /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o libgtop_common-2.0.la error.lo gnuslib.lo procargs.lo default.lo -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o libgtop_suid_common-2.0.la error.lo sysdeps_suid.lo libtool: link: ar cru .libs/libgtop_suid_common-2.0.a .libs/error.o .libs/sysdeps_suid.o /usr/libexec/binutils227/elf/ar: `u' modifier ignored since `D' is the default (see `U') libtool: link: ranlib .libs/libgtop_suid_common-2.0.a libtool: link: ( cd ".libs" && rm -f "libgtop_suid_common-2.0.la" && ln -s "../libgtop_suid_common-2.0.la" "libgtop_suid_common-2.0.la" ) libtool: link: ar cru .libs/libgtop_common-2.0.a .libs/error.o .libs/gnuslib.o .libs/procargs.o .libs/default.o /usr/libexec/binutils227/elf/ar: `u' modifier ignored since `D' is the default (see `U') libtool: link: ranlib .libs/libgtop_common-2.0.a libtool: link: ( cd ".libs" && rm -f "libgtop_common-2.0.la" && ln -s "../libgtop_common-2.0.la" "libgtop_common-2.0.la" ) gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' Making all in freebsd gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT nosuid.lo -MD -MP -MF .deps/nosuid.Tpo -c -o nosuid.lo nosuid.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT siglist.lo -MD -MP -MF .deps/siglist.Tpo -c -o siglist.lo siglist.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysinfo.lo -MD -MP -MF .deps/sysinfo.Tpo -c -o sysinfo.lo sysinfo.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT shm_limits.lo -MD -MP -MF .deps/shm_limits.Tpo -c -o shm_limits.lo shm_limits.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT cpu.lo -MD -MP -MF .deps/cpu.Tpo -c -o cpu.lo cpu.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT siglist.lo -MD -MP -MF .deps/siglist.Tpo -c siglist.c -fPIC -DPIC -o .libs/siglist.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT nosuid.lo -MD -MP -MF .deps/nosuid.Tpo -c nosuid.c -fPIC -DPIC -o .libs/nosuid.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysinfo.lo -MD -MP -MF .deps/sysinfo.Tpo -c sysinfo.c -fPIC -DPIC -o .libs/sysinfo.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT shm_limits.lo -MD -MP -MF .deps/shm_limits.Tpo -c shm_limits.c -fPIC -DPIC -o .libs/shm_limits.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT cpu.lo -MD -MP -MF .deps/cpu.Tpo -c cpu.c -fPIC -DPIC -o .libs/cpu.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT siglist.lo -MD -MP -MF .deps/siglist.Tpo -c siglist.c -o siglist.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysinfo.lo -MD -MP -MF .deps/sysinfo.Tpo -c sysinfo.c -o sysinfo.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT nosuid.lo -MD -MP -MF .deps/nosuid.Tpo -c nosuid.c -o nosuid.o >/dev/null 2>&1 mv -f .deps/sysinfo.Tpo .deps/sysinfo.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT msg_limits.lo -MD -MP -MF .deps/msg_limits.Tpo -c -o msg_limits.lo msg_limits.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT shm_limits.lo -MD -MP -MF .deps/shm_limits.Tpo -c shm_limits.c -o shm_limits.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT msg_limits.lo -MD -MP -MF .deps/msg_limits.Tpo -c msg_limits.c -fPIC -DPIC -o .libs/msg_limits.o cpu.c: In function 'glibtop_get_cpu_s': cpu.c:60:12: warning: unused variable 'i' [-Wunused-variable] int ncpu, i; ^ cpu.c:60:6: warning: unused variable 'ncpu' [-Wunused-variable] int ncpu, i; ^~~~ cpu.c:59:9: warning: unused variable 'length' [-Wunused-variable] size_t length; ^~~~~~ cpu.c:58:19: warning: unused variable 'ci' [-Wunused-variable] struct clockinfo ci; ^~ cpu.c:57:8: warning: unused variable 'cp_times' [-Wunused-variable] long *cp_times = NULL; ^~~~~~~~ cpu.c:56:7: warning: unused variable 'cpts' [-Wunused-variable] long cpts [CPUSTATES]; ^~~~ libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT cpu.lo -MD -MP -MF .deps/cpu.Tpo -c cpu.c -o cpu.o >/dev/null 2>&1 mv -f .deps/siglist.Tpo .deps/siglist.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sem_limits.lo -MD -MP -MF .deps/sem_limits.Tpo -c -o sem_limits.lo sem_limits.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sem_limits.lo -MD -MP -MF .deps/sem_limits.Tpo -c sem_limits.c -fPIC -DPIC -o .libs/sem_limits.o mv -f .deps/nosuid.Tpo .deps/nosuid.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT loadavg.lo -MD -MP -MF .deps/loadavg.Tpo -c -o loadavg.lo loadavg.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT loadavg.lo -MD -MP -MF .deps/loadavg.Tpo -c loadavg.c -fPIC -DPIC -o .libs/loadavg.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT msg_limits.lo -MD -MP -MF .deps/msg_limits.Tpo -c msg_limits.c -o msg_limits.o >/dev/null 2>&1 mv -f .deps/cpu.Tpo .deps/cpu.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT uptime.lo -MD -MP -MF .deps/uptime.Tpo -c -o uptime.lo uptime.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT uptime.lo -MD -MP -MF .deps/uptime.Tpo -c uptime.c -fPIC -DPIC -o .libs/uptime.o mv -f .deps/shm_limits.Tpo .deps/shm_limits.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netlist.lo -MD -MP -MF .deps/netlist.Tpo -c -o netlist.lo netlist.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netlist.lo -MD -MP -MF .deps/netlist.Tpo -c netlist.c -fPIC -DPIC -o .libs/netlist.o mv -f .deps/msg_limits.Tpo .deps/msg_limits.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT fsusage.lo -MD -MP -MF .deps/fsusage.Tpo -c -o fsusage.lo fsusage.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT fsusage.lo -MD -MP -MF .deps/fsusage.Tpo -c fsusage.c -fPIC -DPIC -o .libs/fsusage.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT loadavg.lo -MD -MP -MF .deps/loadavg.Tpo -c loadavg.c -o loadavg.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT uptime.lo -MD -MP -MF .deps/uptime.Tpo -c uptime.c -o uptime.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT fsusage.lo -MD -MP -MF .deps/fsusage.Tpo -c fsusage.c -o fsusage.o >/dev/null 2>&1 mv -f .deps/loadavg.Tpo .deps/loadavg.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mem.lo -MD -MP -MF .deps/mem.Tpo -c -o mem.lo mem.c mv -f .deps/fsusage.Tpo .deps/fsusage.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mountlist.lo -MD -MP -MF .deps/mountlist.Tpo -c -o mountlist.lo mountlist.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mem.lo -MD -MP -MF .deps/mem.Tpo -c mem.c -fPIC -DPIC -o .libs/mem.o mv -f .deps/uptime.Tpo .deps/uptime.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sem_limits.lo -MD -MP -MF .deps/sem_limits.Tpo -c sem_limits.c -o sem_limits.o >/dev/null 2>&1 /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procopenfiles.lo -MD -MP -MF .deps/procopenfiles.Tpo -c -o procopenfiles.lo procopenfiles.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procopenfiles.lo -MD -MP -MF .deps/procopenfiles.Tpo -c procopenfiles.c -fPIC -DPIC -o .libs/procopenfiles.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netlist.lo -MD -MP -MF .deps/netlist.Tpo -c netlist.c -o netlist.o >/dev/null 2>&1 mem.c: In function 'glibtop_get_mem_s': mem.c:73:9: warning: variable 'meminactive' set but not used [-Wunused-but-set-variable] gulong meminactive; ^~~~~~~~~~~ libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mem.lo -MD -MP -MF .deps/mem.Tpo -c mem.c -o mem.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mountlist.lo -MD -MP -MF .deps/mountlist.Tpo -c mountlist.c -fPIC -DPIC -o .libs/mountlist.o mv -f .deps/netlist.Tpo .deps/netlist.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procwd.lo -MD -MP -MF .deps/procwd.Tpo -c -o procwd.lo procwd.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procwd.lo -MD -MP -MF .deps/procwd.Tpo -c procwd.c -fPIC -DPIC -o .libs/procwd.o mv -f .deps/mem.Tpo .deps/mem.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procaffinity.lo -MD -MP -MF .deps/procaffinity.Tpo -c -o procaffinity.lo procaffinity.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procaffinity.lo -MD -MP -MF .deps/procaffinity.Tpo -c procaffinity.c -fPIC -DPIC -o .libs/procaffinity.o mv -f .deps/sem_limits.Tpo .deps/sem_limits.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT glibtop_private.lo -MD -MP -MF .deps/glibtop_private.Tpo -c -o glibtop_private.lo glibtop_private.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procaffinity.lo -MD -MP -MF .deps/procaffinity.Tpo -c procaffinity.c -o procaffinity.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procwd.lo -MD -MP -MF .deps/procwd.Tpo -c procwd.c -o procwd.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mountlist.lo -MD -MP -MF .deps/mountlist.Tpo -c mountlist.c -o mountlist.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT glibtop_private.lo -MD -MP -MF .deps/glibtop_private.Tpo -c glibtop_private.c -fPIC -DPIC -o .libs/glibtop_private.o mv -f .deps/procaffinity.Tpo .deps/procaffinity.Plo mv -f .deps/procwd.Tpo .deps/procwd.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c -o open.lo open.c /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT suid_open.lo -MD -MP -MF .deps/suid_open.Tpo -c -o suid_open.lo suid_open.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT glibtop_private.lo -MD -MP -MF .deps/glibtop_private.Tpo -c glibtop_private.c -o glibtop_private.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT suid_open.lo -MD -MP -MF .deps/suid_open.Tpo -c suid_open.c -fPIC -DPIC -o .libs/suid_open.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c open.c -fPIC -DPIC -o .libs/open.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c open.c -o open.o >/dev/null 2>&1 mv -f .deps/glibtop_private.Tpo .deps/glibtop_private.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c -o close.lo close.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c close.c -fPIC -DPIC -o .libs/close.o mv -f .deps/mountlist.Tpo .deps/mountlist.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT swap.lo -MD -MP -MF .deps/swap.Tpo -c -o swap.lo swap.c mv -f .deps/open.Tpo .deps/open.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proclist.lo -MD -MP -MF .deps/proclist.Tpo -c -o proclist.lo proclist.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT swap.lo -MD -MP -MF .deps/swap.Tpo -c swap.c -fPIC -DPIC -o .libs/swap.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proclist.lo -MD -MP -MF .deps/proclist.Tpo -c proclist.c -fPIC -DPIC -o .libs/proclist.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT swap.lo -MD -MP -MF .deps/swap.Tpo -c swap.c -o swap.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procopenfiles.lo -MD -MP -MF .deps/procopenfiles.Tpo -c procopenfiles.c -o procopenfiles.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT suid_open.lo -MD -MP -MF .deps/suid_open.Tpo -c suid_open.c -o suid_open.o >/dev/null 2>&1 proclist.c: In function 'glibtop_get_proclist_p': proclist.c:73:8: warning: unused variable 'prev' [-Wunused-variable] pid_t prev; ^~~~ proclist.c:72:15: warning: unused variable 'i' [-Wunused-variable] unsigned int i; ^ proclist.c:71:9: warning: unused variable 'len' [-Wunused-variable] size_t len; ^~~ proclist.c:70:21: warning: unused variable 'procstate' [-Wunused-variable] glibtop_proc_state procstate; ^~~~~~~~~ proclist.c:69:10: warning: unused variable 'pids' [-Wunused-variable] GArray *pids; ^~~~ proclist.c:68:21: warning: unused variable 'pinfo' [-Wunused-variable] struct kinfo_proc *pinfo; ^~~~~ mv -f .deps/procopenfiles.Tpo .deps/procopenfiles.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procstate.lo -MD -MP -MF .deps/procstate.Tpo -c -o procstate.lo procstate.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proclist.lo -MD -MP -MF .deps/proclist.Tpo -c proclist.c -o proclist.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procstate.lo -MD -MP -MF .deps/procstate.Tpo -c procstate.c -fPIC -DPIC -o .libs/procstate.o mv -f .deps/suid_open.Tpo .deps/suid_open.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procuid.lo -MD -MP -MF .deps/procuid.Tpo -c -o procuid.lo procuid.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procuid.lo -MD -MP -MF .deps/procuid.Tpo -c procuid.c -fPIC -DPIC -o .libs/procuid.o mv -f .deps/proclist.Tpo .deps/proclist.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proctime.lo -MD -MP -MF .deps/proctime.Tpo -c -o proctime.lo proctime.c mv -f .deps/swap.Tpo .deps/swap.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmem.lo -MD -MP -MF .deps/procmem.Tpo -c -o procmem.lo procmem.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proctime.lo -MD -MP -MF .deps/proctime.Tpo -c proctime.c -fPIC -DPIC -o .libs/proctime.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procstate.lo -MD -MP -MF .deps/procstate.Tpo -c procstate.c -o procstate.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmem.lo -MD -MP -MF .deps/procmem.Tpo -c procmem.c -fPIC -DPIC -o .libs/procmem.o proctime.c:40:16: warning: 'tv2sec_freq' defined but not used [-Wunused-function] static guint64 tv2sec_freq(struct timeval tv, guint64 freq) ^~~~~~~~~~~ libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proctime.lo -MD -MP -MF .deps/proctime.Tpo -c proctime.c -o proctime.o >/dev/null 2>&1 mv -f .deps/procstate.Tpo .deps/procstate.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsignal.lo -MD -MP -MF .deps/procsignal.Tpo -c -o procsignal.lo procsignal.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procuid.lo -MD -MP -MF .deps/procuid.Tpo -c procuid.c -o procuid.o >/dev/null 2>&1 procmem.c: In function 'glibtop_get_proc_mem_p': procmem.c:77:19: warning: unused variable 'object' [-Wunused-variable] struct vm_object object; ^~~~~~ procmem.c:76:17: warning: unused variable 'vmspace' [-Wunused-variable] struct vmspace vmspace; ^~~~~~~ procmem.c:75:30: warning: unused variable 'first' [-Wunused-variable] struct vm_map_entry entry, *first; ^~~~~ procmem.c:75:22: warning: unused variable 'entry' [-Wunused-variable] struct vm_map_entry entry, *first; ^~~~~ At top level: procmem.c:54:28: warning: '_glibtop_sysdeps_proc_mem_share' defined but not used [-Wunused-const-variable=] static const unsigned long _glibtop_sysdeps_proc_mem_share = ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsignal.lo -MD -MP -MF .deps/procsignal.Tpo -c procsignal.c -fPIC -DPIC -o .libs/procsignal.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c close.c -o close.o >/dev/null 2>&1 mv -f .deps/proctime.Tpo .deps/proctime.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT prockernel.lo -MD -MP -MF .deps/prockernel.Tpo -c -o prockernel.lo prockernel.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmem.lo -MD -MP -MF .deps/procmem.Tpo -c procmem.c -o procmem.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT prockernel.lo -MD -MP -MF .deps/prockernel.Tpo -c prockernel.c -fPIC -DPIC -o .libs/prockernel.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsignal.lo -MD -MP -MF .deps/procsignal.Tpo -c procsignal.c -o procsignal.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT prockernel.lo -MD -MP -MF .deps/prockernel.Tpo -c prockernel.c -o prockernel.o >/dev/null 2>&1 mv -f .deps/procmem.Tpo .deps/procmem.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsegment.lo -MD -MP -MF .deps/procsegment.Tpo -c -o procsegment.lo procsegment.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsegment.lo -MD -MP -MF .deps/procsegment.Tpo -c procsegment.c -fPIC -DPIC -o .libs/procsegment.o mv -f .deps/close.Tpo .deps/close.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c -o procargs.lo procargs.c mv -f .deps/prockernel.Tpo .deps/prockernel.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procio.lo -MD -MP -MF .deps/procio.Tpo -c -o procio.lo procio.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procio.lo -MD -MP -MF .deps/procio.Tpo -c procio.c -fPIC -DPIC -o .libs/procio.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c procargs.c -fPIC -DPIC -o .libs/procargs.o mv -f .deps/procsignal.Tpo .deps/procsignal.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmap.lo -MD -MP -MF .deps/procmap.Tpo -c -o procmap.lo procmap.c mv -f .deps/procuid.Tpo .deps/procuid.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netload.lo -MD -MP -MF .deps/netload.Tpo -c -o netload.lo netload.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netload.lo -MD -MP -MF .deps/netload.Tpo -c netload.c -fPIC -DPIC -o .libs/netload.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmap.lo -MD -MP -MF .deps/procmap.Tpo -c procmap.c -fPIC -DPIC -o .libs/procmap.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.lo -MD -MP -MF .deps/procargs.Tpo -c procargs.c -o procargs.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procio.lo -MD -MP -MF .deps/procio.Tpo -c procio.c -o procio.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procsegment.lo -MD -MP -MF .deps/procsegment.Tpo -c procsegment.c -o procsegment.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmap.lo -MD -MP -MF .deps/procmap.Tpo -c procmap.c -o procmap.o >/dev/null 2>&1 mv -f .deps/procio.Tpo .deps/procio.Plo /bin/sh ../../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT ppp.lo -MD -MP -MF .deps/ppp.Tpo -c -o ppp.lo ppp.c mv -f .deps/procargs.Tpo .deps/procargs.Plo /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -version-info 11:0:0 -o libgtop_sysdeps-2.0.la nosuid.lo siglist.lo sysinfo.lo shm_limits.lo cpu.lo msg_limits.lo sem_limits.lo loadavg.lo uptime.lo netlist.lo fsusage.lo mem.lo mountlist.lo procopenfiles.lo procwd.lo procaffinity.lo glibtop_private.lo open.lo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netload.lo -MD -MP -MF .deps/netload.Tpo -c netload.c -o netload.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT ppp.lo -MD -MP -MF .deps/ppp.Tpo -c ppp.c -fPIC -DPIC -o .libs/ppp.o mv -f .deps/procmap.Tpo .deps/procmap.Plo mv -f .deps/procsegment.Tpo .deps/procsegment.Plo mv -f .deps/netload.Tpo .deps/netload.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT ppp.lo -MD -MP -MF .deps/ppp.Tpo -c ppp.c -o ppp.o >/dev/null 2>&1 mv -f .deps/ppp.Tpo .deps/ppp.Plo /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -version-info 11:0:0 -o libgtop_sysdeps_suid-2.0.la suid_open.lo close.lo swap.lo proclist.lo procstate.lo procuid.lo proctime.lo procmem.lo procsignal.lo prockernel.lo procsegment.lo procargs.lo procio.lo procmap.lo netload.lo ppp.lo -lkvm libtool: warning: '-version-info/-version-number' is ignored for convenience libraries libtool: link: ar cru .libs/libgtop_sysdeps-2.0.a .libs/nosuid.o .libs/siglist.o .libs/sysinfo.o .libs/shm_limits.o .libs/cpu.o .libs/msg_limits.o .libs/sem_limits.o .libs/loadavg.o .libs/uptime.o .libs/netlist.o .libs/fsusage.o .libs/mem.o .libs/mountlist.o .libs/procopenfiles.o .libs/procwd.o .libs/procaffinity.o .libs/glibtop_private.o .libs/open.o /usr/libexec/binutils227/elf/ar: `u' modifier ignored since `D' is the default (see `U') libtool: warning: '-version-info/-version-number' is ignored for convenience libraries libtool: link: ranlib .libs/libgtop_sysdeps-2.0.a libtool: link: ( cd ".libs" && rm -f "libgtop_sysdeps-2.0.la" && ln -s "../libgtop_sysdeps-2.0.la" "libgtop_sysdeps-2.0.la" ) libtool: link: ar cru .libs/libgtop_sysdeps_suid-2.0.a .libs/suid_open.o .libs/close.o .libs/swap.o .libs/proclist.o .libs/procstate.o .libs/procuid.o .libs/proctime.o .libs/procmem.o .libs/procsignal.o .libs/prockernel.o .libs/procsegment.o .libs/procargs.o .libs/procio.o .libs/procmap.o .libs/netload.o .libs/ppp.o /usr/libexec/binutils227/elf/ar: `u' modifier ignored since `D' is the default (see `U') libtool: link: ranlib .libs/libgtop_sysdeps_suid-2.0.a libtool: link: ( cd ".libs" && rm -f "libgtop_sysdeps_suid-2.0.la" && ln -s "../libgtop_sysdeps_suid-2.0.la" "libgtop_sysdeps_suid-2.0.la" ) gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[4]: Nothing to be done for 'all-am'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' Making all in lib gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/lib' perl5 ./lib.pl < ../features.def > lib-t mv lib-t lib.c gmake all-am gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/lib' /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT init.lo -MD -MP -MF .deps/init.Tpo -c -o init.lo init.c /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c -o open.lo open.c /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c -o close.lo close.c /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT command.lo -MD -MP -MF .deps/command.Tpo -c -o command.lo command.c /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read.lo -MD -MP -MF .deps/read.Tpo -c -o read.lo read.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c close.c -fPIC -DPIC -o .libs/close.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c open.c -fPIC -DPIC -o .libs/open.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT init.lo -MD -MP -MF .deps/init.Tpo -c init.c -fPIC -DPIC -o .libs/init.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read.lo -MD -MP -MF .deps/read.Tpo -c read.c -fPIC -DPIC -o .libs/read.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT command.lo -MD -MP -MF .deps/command.Tpo -c command.c -fPIC -DPIC -o .libs/command.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read.lo -MD -MP -MF .deps/read.Tpo -c read.c -o read.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT init.lo -MD -MP -MF .deps/init.Tpo -c init.c -o init.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT close.lo -MD -MP -MF .deps/close.Tpo -c close.c -o close.o >/dev/null 2>&1 mv -f .deps/close.Tpo .deps/close.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read_data.lo -MD -MP -MF .deps/read_data.Tpo -c -o read_data.lo read_data.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT command.lo -MD -MP -MF .deps/command.Tpo -c command.c -o command.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read_data.lo -MD -MP -MF .deps/read_data.Tpo -c read_data.c -fPIC -DPIC -o .libs/read_data.o mv -f .deps/read.Tpo .deps/read.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT write.lo -MD -MP -MF .deps/write.Tpo -c -o write.lo write.c mv -f .deps/command.Tpo .deps/command.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT lib.lo -MD -MP -MF .deps/lib.Tpo -c -o lib.lo lib.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT write.lo -MD -MP -MF .deps/write.Tpo -c write.c -fPIC -DPIC -o .libs/write.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT lib.lo -MD -MP -MF .deps/lib.Tpo -c lib.c -fPIC -DPIC -o .libs/lib.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT read_data.lo -MD -MP -MF .deps/read_data.Tpo -c read_data.c -o read_data.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT write.lo -MD -MP -MF .deps/write.Tpo -c write.c -o write.o >/dev/null 2>&1 mv -f .deps/init.Tpo .deps/init.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT parameter.lo -MD -MP -MF .deps/parameter.Tpo -c -o parameter.lo parameter.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT parameter.lo -MD -MP -MF .deps/parameter.Tpo -c parameter.c -fPIC -DPIC -o .libs/parameter.o mv -f .deps/write.Tpo .deps/write.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps.lo -MD -MP -MF .deps/sysdeps.Tpo -c -o sysdeps.lo sysdeps.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT lib.lo -MD -MP -MF .deps/lib.Tpo -c lib.c -o lib.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps.lo -MD -MP -MF .deps/sysdeps.Tpo -c sysdeps.c -fPIC -DPIC -o .libs/sysdeps.o mv -f .deps/read_data.Tpo .deps/read_data.Plo /bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT boxed.lo -MD -MP -MF .deps/boxed.Tpo -c -o boxed.lo boxed.c libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT boxed.lo -MD -MP -MF .deps/boxed.Tpo -c boxed.c -fPIC -DPIC -o .libs/boxed.o libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps.lo -MD -MP -MF .deps/sysdeps.Tpo -c sysdeps.c -o sysdeps.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT boxed.lo -MD -MP -MF .deps/boxed.Tpo -c boxed.c -o boxed.o >/dev/null 2>&1 libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT parameter.lo -MD -MP -MF .deps/parameter.Tpo -c parameter.c -o parameter.o >/dev/null 2>&1 mv -f .deps/sysdeps.Tpo .deps/sysdeps.Plo mv -f .deps/boxed.Tpo .deps/boxed.Plo libtool: compile: cc -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT open.lo -MD -MP -MF .deps/open.Tpo -c open.c -o open.o >/dev/null 2>&1 mv -f .deps/parameter.Tpo .deps/parameter.Plo mv -f .deps/open.Tpo .deps/open.Plo mv -f .deps/lib.Tpo .deps/lib.Plo /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -version-info 11:0:0 -export-symbols ./libgtop.sym -no-undefined -o libgtop-2.0.la -rpath /usr/local/lib init.lo open.lo close.lo command.lo read.lo read_data.lo write.lo lib.lo parameter.lo sysdeps.lo boxed.lo -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl ../sysdeps/common/libgtop_common-2.0.la ../sysdeps/freebsd/libgtop_sysdeps-2.0.la ../sysdeps/freebsd/libgtop_sysdeps_suid-2.0.la libtool: link: echo "{ global:" > .libs/libgtop-2.0.so.11.0.0-ver libtool: link: sed -e "s|$|;|" < ./libgtop.sym >> .libs/libgtop-2.0.so.11.0.0-ver libtool: link: echo "local: *; };" >> .libs/libgtop-2.0.so.11.0.0-ver libtool: link: cc -shared -fPIC -DPIC .libs/init.o .libs/open.o .libs/close.o .libs/command.o .libs/read.o .libs/read_data.o .libs/write.o .libs/lib.o .libs/parameter.o .libs/sysdeps.o .libs/boxed.o -Wl,--whole-archive ../sysdeps/common/.libs/libgtop_common-2.0.a ../sysdeps/freebsd/.libs/libgtop_sysdeps-2.0.a ../sysdeps/freebsd/.libs/libgtop_sysdeps_suid-2.0.a -Wl,--no-whole-archive -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -lkvm -O2 -Wl,-soname -Wl,libgtop-2.0.so.11 -Wl,-version-script -Wl,.libs/libgtop-2.0.so.11.0.0-ver -o .libs/libgtop-2.0.so.11.0.0 libtool: link: (cd ".libs" && rm -f "libgtop-2.0.so.11" && ln -s "libgtop-2.0.so.11.0.0" "libgtop-2.0.so.11") libtool: link: (cd ".libs" && rm -f "libgtop-2.0.so" && ln -s "libgtop-2.0.so.11.0.0" "libgtop-2.0.so") libtool: link: (cd .libs/libgtop-2.0.lax/libgtop_common-2.0.a && ar x "/construction/devel/libgtop/libgtop-2.38.0/lib/../sysdeps/common/.libs/libgtop_common-2.0.a") libtool: link: (cd .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a && ar x "/construction/devel/libgtop/libgtop-2.38.0/lib/../sysdeps/freebsd/.libs/libgtop_sysdeps-2.0.a") libtool: link: (cd .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a && ar x "/construction/devel/libgtop/libgtop-2.38.0/lib/../sysdeps/freebsd/.libs/libgtop_sysdeps_suid-2.0.a") copying selected object files to avoid basename conflicts... libtool: link: ln .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/open.o .libs/libgtop-2.0.lax/lt1-open.o || cp .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/open.o .libs/libgtop-2.0.lax/lt1-open.o libtool: link: ln .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/close.o .libs/libgtop-2.0.lax/lt2-close.o || cp .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/close.o .libs/libgtop-2.0.lax/lt2-close.o libtool: link: ln .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procargs.o .libs/libgtop-2.0.lax/lt3-procargs.o || cp .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procargs.o .libs/libgtop-2.0.lax/lt3-procargs.o libtool: link: ar cru .libs/libgtop-2.0.a init.o open.o close.o command.o read.o read_data.o write.o lib.o parameter.o sysdeps.o boxed.o .libs/libgtop-2.0.lax/libgtop_common-2.0.a/default.o .libs/libgtop-2.0.lax/libgtop_common-2.0.a/error.o .libs/libgtop-2.0.lax/libgtop_common-2.0.a/gnuslib.o .libs/libgtop-2.0.lax/libgtop_common-2.0.a/procargs.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/cpu.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/fsusage.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/glibtop_private.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/loadavg.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/mem.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/mountlist.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/msg_limits.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/netlist.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/nosuid.o .libs/libgtop-2.0.lax/lt1-open.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/procaffinity.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/procopenfiles.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/procwd.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/sem_limits.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/shm_limits.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/siglist.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/sysinfo.o .libs/libgtop-2.0.lax/libgtop_sysdeps-2.0.a/uptime.o .libs/libgtop-2.0.lax/lt2-close.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/netload.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/ppp.o .libs/libgtop-2.0.lax/lt3-procargs.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procio.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/prockernel.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/proclist.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procmap.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procmem.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procsegment.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procsignal.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procstate.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/proctime.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/procuid.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/suid_open.o .libs/libgtop-2.0.lax/libgtop_sysdeps_suid-2.0.a/swap.o /usr/libexec/binutils227/elf/ar: `u' modifier ignored since `D' is the default (see `U') libtool: link: ranlib .libs/libgtop-2.0.a libtool: link: rm -fr .libs/libgtop-2.0.lax .libs/libgtop-2.0.lax libtool: link: ( cd ".libs" && rm -f "libgtop-2.0.la" && ln -s "../libgtop-2.0.la" "libgtop-2.0.la" ) CPPFLAGS="-I/usr/local/include" CFLAGS="-Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing " LDFLAGS="" CC="cc" PKG_CONFIG="pkgconf" GI_HOST_OS="" DLLTOOL="false" /usr/local/bin/g-ir-scanner --accept-unprefixed --warn-all --namespace=GTop --nsversion=2.0 --libtool="/bin/sh ../libtool" --library=libgtop-2.0.la --cflags-begin -I.. -I.. -I../sysdeps/freebsd -I../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include --cflags-end init.c open.c close.c command.c read.c read_data.c write.c lib.c parameter.c sysdeps.c boxed.c ../glibtop.h ../libgtopconfig.h ../include/glibtop/close.h ../include/glibtop/loadavg.h ../include/glibtop/prockernel.h ../include/glibtop/procstate.h ../include/glibtop/sem_limits.h ../include/glibtop/uptime.h ../include/glibtop/command.h ../include/glibtop/mem.h ../include/glibtop/proclist.h ../include/glibtop/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/cpu.h ../include/glibtop/msg_limits.h ../include/glibtop/procmem.h ../include/glibtop/procuid.h ../include/glibtop/swap.h ../include/glibtop/procsegment.h ../include/glibtop/sysdeps.h ../include/glibtop/global.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/sysinfo.h ../include/glibtop/ppp.h ../include/glibtop/procargs.h ../include/glibtop/netload.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 libgtop-2.0.la --output GTop-2.0.gir /construction/devel/libgtop/libgtop-2.38.0/include/glibtop/sysdeps.h:61: syntax error, unexpected identifier in 'G_STATIC_ASSERT((1UL << (28 - 1)) <= ' at 'G_STATIC_ASSERT' g-ir-scanner: link: /bin/sh ../libtool --mode=link --tag=CC cc -o /construction/devel/libgtop/libgtop-2.38.0/lib/tmp-introspectn0qn9zkn/GTop-2.0 -export-dynamic -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing /construction/devel/libgtop/libgtop-2.38.0/lib/tmp-introspectn0qn9zkn/GTop-2.0.o -L. libgtop-2.0.la -L/usr/local/lib -lgio-2.0 -lgobject-2.0 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -lintl libtool: link: cc -o /construction/devel/libgtop/libgtop-2.38.0/lib/tmp-introspectn0qn9zkn/.libs/GTop-2.0 -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing /construction/devel/libgtop/libgtop-2.38.0/lib/tmp-introspectn0qn9zkn/GTop-2.0.o -Wl,--export-dynamic -pthread -Wl,--export-dynamic -L. ./.libs/libgtop-2.0.so -L/usr/local/lib -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lintl -lkvm -pthread -Wl,-rpath -Wl,/usr/local/lib include/glibtop/procargs.h:79: Warning: GTop: glibtop_get_proc_argv_l: return value: Missing (transfer) annotation include/glibtop/procwd.h:55: Warning: GTop: glibtop_get_proc_wd_l: return value: Missing (transfer) annotation include/glibtop/procwd.h:68: Warning: GTop: glibtop_get_proc_wd_s: return value: Missing (transfer) annotation /usr/local/bin/g-ir-compiler --includedir=. GTop-2.0.gir -o GTop-2.0.typelib gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/lib' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/lib' Making all in src gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src' Making all in daemon gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT gnuserv.o -MD -MP -MF .deps/gnuserv.Tpo -c -o gnuserv.o gnuserv.c cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT slave.o -MD -MP -MF .deps/slave.Tpo -c -o slave.o slave.c cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT io.o -MD -MP -MF .deps/io.Tpo -c -o io.o io.c cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT version.o -MD -MP -MF .deps/version.Tpo -c -o version.o version.c main.c: In function 'handle_parent_connection': main.c:52:39: warning: format '%u' expects argument of type 'unsigned int', but argument 3 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu sizeof (glibtop_command), sizeof (glibtop_response), ~~~~~~~~~~~~~~~~~~~~~~~~ main.c:52:44: warning: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu sizeof (glibtop_command), sizeof (glibtop_response), ~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:52:49: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu main.c:54:4: sizeof (glibtop_mountentry), sizeof (glibtop_union), ~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:52:54: warning: format '%u' expects argument of type 'unsigned int', but argument 6 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu main.c:54:33: sizeof (glibtop_mountentry), sizeof (glibtop_union), ~~~~~~~~~~~~~~~~~~~~~~ main.c:52:59: warning: format '%u' expects argument of type 'unsigned int', but argument 7 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu main.c:55:4: sizeof (glibtop_sysdeps), ~~~~~~~~~~~~~~~~~~~~~~~~ main.c:52:64: warning: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'long unsigned int' [-Wformat=] syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", ~^ %lu main.c:56:4: sizeof (glibtop_response_union)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:61:41: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] "Parent (%d) received command %llu from client.", ~~~^ %lu getpid (), cmnd->command); ~~~~~~~~~~~~~ main.c:66:24: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] "Client sent %llu bytes, but buffer is %lu", ~~~^ %lu cmnd->data_size, (unsigned long)BUFSIZ); ~~~~~~~~~~~~~~~ main.c:77:45: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] syslog_message (LOG_DEBUG, "Client has %llu bytes of data.", ~~~^ %lu cmnd->data_size); ~~~~~~~~~~~~~~~ main.c:226:35: warning: passing argument 3 of 'glibtop_get_proc_io_l' makes integer from pointer without a cast [-Wint-conversion] (server, &resp->u.data.proc_io, parameter); ^~~~~~~~~ In file included from ../../include/glibtop/union.h:47, from daemon.h:29, from main.c:23: ../../include/glibtop/procio.h:78:74: note: expected 'pid_t' {aka 'int'} but argument is of type 'char *' void glibtop_get_proc_io_l (glibtop *server, glibtop_proc_io *buf, pid_t pid); ~~~~~~^~~ main.c:243:67: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] syslog_message (LOG_ERR, "Parent received unknown command %llu.", ~~~^ %lu cmnd->command); ~~~~~~~~~~~~~ In file included from io.c:24: io.c: In function 'do_output': ../../include/glibtop/error.h:53:32: warning: format '%d' expects argument of type 'int', but argument 6 has type 'long unsigned int' [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ io.c:30:2: note: in expansion of macro 'glibtop_debug' glibtop_debug ("Really writing %d bytes at offset %lu.", ^~~~~~~~~~~~~ io.c:30:34: note: format string is defined here glibtop_debug ("Really writing %d bytes at offset %lu.", ~^ %ld In file included from io.c:24: ../../include/glibtop/error.h:53:32: warning: format '%d' expects argument of type 'int', but argument 6 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ io.c:45:3: note: in expansion of macro 'glibtop_debug' glibtop_debug ("Writing %d bytes of data.", resp->data_size); ^~~~~~~~~~~~~ io.c:45:28: note: format string is defined here glibtop_debug ("Writing %d bytes of data.", resp->data_size); ~^ %ld In file included from io.c:24: io.c: In function 'do_read': ../../include/glibtop/error.h:53:32: warning: format '%d' expects argument of type 'int', but argument 7 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ io.c:87:3: note: in expansion of macro 'glibtop_debug' glibtop_debug ("READ (%d): %d - %d - %d", ^~~~~~~~~~~~~ io.c:87:31: note: format string is defined here glibtop_debug ("READ (%d): %d - %d - %d", ~^ %ld In file included from io.c:24: ../../include/glibtop/error.h:53:32: warning: format '%d' expects argument of type 'int', but argument 8 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ io.c:87:3: note: in expansion of macro 'glibtop_debug' glibtop_debug ("READ (%d): %d - %d - %d", ^~~~~~~~~~~~~ io.c:87:36: note: format string is defined here glibtop_debug ("READ (%d): %d - %d - %d", ~^ %ld In file included from io.c:24: ../../include/glibtop/error.h:53:32: warning: format '%d' expects argument of type 'int', but argument 9 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ io.c:87:3: note: in expansion of macro 'glibtop_debug' glibtop_debug ("READ (%d): %d - %d - %d", ^~~~~~~~~~~~~ io.c:87:41: note: format string is defined here glibtop_debug ("READ (%d): %d - %d - %d", ~^ %ld mv -f .deps/version.Tpo .deps/version.Po cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../sysdeps/freebsd -I../../include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -D_BSD -DLIBGTOP_COMPILE_SYSTEM="\"`uname -s`\"" -DLIBGTOP_COMPILE_RELEASE="\"`uname -r`\"" -DLIBGTOP_COMPILE_VERSION="\"`uname -v`\"" -DLIBGTOP_COMPILE_MACHINE="\"`uname -m`\"" -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT server.o -MD -MP -MF .deps/server.Tpo -c -o server.o server.c mv -f .deps/io.Tpo .deps/io.Po mv -f .deps/main.Tpo .deps/main.Po In file included from slave.c:24: slave.c: In function 'handle_slave_connection': ../../include/glibtop/error.h:53:32: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ slave.c:44:3: note: in expansion of macro 'glibtop_debug' glibtop_debug ("Slave %d received command " ^~~~~~~~~~~~~ slave.c:45:9: note: format string is defined here "%llu from client.", getpid (), cmnd->command); ~~~^ %lu slave.c:48:35: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] glibtop_error ("Client sent %llu bytes, " ~~~^ %lu slave.c:50:12: cmnd->size, (unsigned long)BUFSIZ); ~~~~~~~~~~ In file included from slave.c:24: ../../include/glibtop/error.h:53:32: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] glibtop_debug_r_real(server, "%s:%d %s(): " fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ ^~~~~~~~~~~~~~ ../../include/glibtop/error.h:56:28: note: in expansion of macro 'glibtop_debug_r' #define glibtop_debug(...) glibtop_debug_r(glibtop_global_server, __VA_ARGS__) ^~~~~~~~~~~~~~~ slave.c:57:4: note: in expansion of macro 'glibtop_debug' glibtop_debug ("Client has %llu bytes of data.", ^~~~~~~~~~~~~ slave.c:57:34: note: format string is defined here glibtop_debug ("Client has %llu bytes of data.", ~~~^ %lu slave.c:79:12: warning: passing argument 1 of 'g_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] g_free (ptr); ^~~ In file included from /usr/local/include/glib-2.0/glib/glist.h:32, from /usr/local/include/glib-2.0/glib/ghash.h:33, from /usr/local/include/glib-2.0/glib.h:50, from ../../glibtop.h:29, from daemon.h:25, from slave.c:23: /usr/local/include/glib-2.0/glib/gmem.h:71:35: note: expected 'gpointer' {aka 'void *'} but argument is of type 'const void *' void g_free (gpointer mem); ~~~~~~~~~~^~~ slave.c:93:12: warning: passing argument 1 of 'g_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] g_free (ptr); ^~~ In file included from /usr/local/include/glib-2.0/glib/glist.h:32, from /usr/local/include/glib-2.0/glib/ghash.h:33, from /usr/local/include/glib-2.0/glib.h:50, from ../../glibtop.h:29, from daemon.h:25, from slave.c:23: /usr/local/include/glib-2.0/glib/gmem.h:71:35: note: expected 'gpointer' {aka 'void *'} but argument is of type 'const void *' void g_free (gpointer mem); ~~~~~~~~~~^~~ slave.c:104:12: warning: passing argument 1 of 'g_free' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] g_free (ptr); ^~~ In file included from /usr/local/include/glib-2.0/glib/glist.h:32, from /usr/local/include/glib-2.0/glib/ghash.h:33, from /usr/local/include/glib-2.0/glib.h:50, from ../../glibtop.h:29, from daemon.h:25, from slave.c:23: /usr/local/include/glib-2.0/glib/gmem.h:71:35: note: expected 'gpointer' {aka 'void *'} but argument is of type 'const void *' void g_free (gpointer mem); ~~~~~~~~~~^~~ slave.c: In function 'handle_slave_command': slave.c:258:53: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] glibtop_error ("Child received unknown command %llu", ~~~^ %lu cmnd->command); ~~~~~~~~~~~~~ mv -f .deps/slave.Tpo .deps/slave.Po gnuserv.c: In function 'syslog_io_message': gnuserv.c:109:37: warning: ': ' directive output may be truncated writing 2 bytes into a region of size between 0 and 1023 [-Wformat-truncation=] snprintf (buffer2, BUFSIZ-1, "%s: %s", buffer, g_strerror (errno)); ^~ gnuserv.c:109:5: note: 'snprintf' output 3 or more bytes (assuming 1026) into a destination of size 1023 snprintf (buffer2, BUFSIZ-1, "%s: %s", buffer, g_strerror (errno)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mv -f .deps/server.Tpo .deps/server.Po /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o libgtop_server2 server.o slave.o io.o version.o ../../lib/libgtop-2.0.la ../../sysdeps/common/libgtop_common-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps_suid-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps_suid-2.0.la ../../sysdeps/common/libgtop_suid_common-2.0.la -L/usr/local/lib mv -f .deps/gnuserv.Tpo .deps/gnuserv.Po /bin/sh ../../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o libgtop_daemon2 gnuserv.o slave.o main.o io.o version.o ../../lib/libgtop-2.0.la ../../sysdeps/common/libgtop_common-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps_suid-2.0.la ../../sysdeps/freebsd/libgtop_sysdeps_suid-2.0.la ../../sysdeps/common/libgtop_suid_common-2.0.la -L/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/libgtop_daemon2 gnuserv.o slave.o main.o io.o version.o ../../lib/.libs/libgtop-2.0.so -L/usr/local/lib ../../sysdeps/common/.libs/libgtop_common-2.0.a ../../sysdeps/freebsd/.libs/libgtop_sysdeps-2.0.a ../../sysdeps/freebsd/.libs/libgtop_sysdeps_suid-2.0.a ../../sysdeps/common/.libs/libgtop_suid_common-2.0.a -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/libgtop_server2 server.o slave.o io.o version.o ../../lib/.libs/libgtop-2.0.so -L/usr/local/lib ../../sysdeps/common/.libs/libgtop_common-2.0.a ../../sysdeps/freebsd/.libs/libgtop_sysdeps-2.0.a ../../sysdeps/freebsd/.libs/libgtop_sysdeps_suid-2.0.a ../../sysdeps/common/.libs/libgtop_suid_common-2.0.a -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[4]: Nothing to be done for 'all-am'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src' Making all in examples gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/examples' cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT first.o -MD -MP -MF .deps/first.Tpo -c -o first.o first.c cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT second.o -MD -MP -MF .deps/second.Tpo -c -o second.o second.c cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT pprint.o -MD -MP -MF .deps/pprint.Tpo -c -o pprint.o pprint.c cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procargs.o -MD -MP -MF .deps/procargs.Tpo -c -o procargs.o procargs.c cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT df.o -MD -MP -MF .deps/df.Tpo -c -o df.o df.c mv -f .deps/second.Tpo .deps/second.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netlist.o -MD -MP -MF .deps/netlist.Tpo -c -o netlist.o netlist.c mv -f .deps/df.Tpo .deps/df.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT mountlist.o -MD -MP -MF .deps/mountlist.Tpo -c -o mountlist.o mountlist.c pprint.c: In function 'pprint_get_cpu': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:86:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~ pprint.c:87:3: note: in expansion of macro 'PPRINT' PPRINT(total, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~ pprint.c:88:3: note: in expansion of macro 'PPRINT' PPRINT(user, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~ pprint.c:89:3: note: in expansion of macro 'PPRINT' PPRINT(nice, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~ pprint.c:90:3: note: in expansion of macro 'PPRINT' PPRINT(sys, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~ pprint.c:91:3: note: in expansion of macro 'PPRINT' PPRINT(idle, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~ pprint.c:92:3: note: in expansion of macro 'PPRINT' PPRINT(iowait, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~ pprint.c:93:3: note: in expansion of macro 'PPRINT' PPRINT(irq, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~ pprint.c:94:3: note: in expansion of macro 'PPRINT' PPRINT(softirq, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~ pprint.c:95:3: note: in expansion of macro 'PPRINT' PPRINT(frequency, "%llu"); ^~~~~~ pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:96:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:96:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:96:46: note: format string is defined here PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:97:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:97:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:97:45: note: format string is defined here PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:98:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:98:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:98:45: note: format string is defined here PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:99:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:99:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:99:44: note: format string is defined here PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:100:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:100:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:100:45: note: format string is defined here PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:101:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:101:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:101:47: note: format string is defined here PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:102:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:102:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:102:44: note: format string is defined here PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:103:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:35:9: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~~~~~~~~~~~~ pprint.c:103:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ^~~~~~~~~~~~ pprint.c:103:48: note: format string is defined here PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~^ %lu pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~ pprint.c:104:3: note: in expansion of macro 'PPRINT' PPRINT(xcpu_flags, "%llx"); ^~~~~~ pprint.c: In function 'pprint_get_fsusage': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:118:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~ pprint.c:119:3: note: in expansion of macro 'PPRINT' PPRINT(blocks, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~ pprint.c:120:3: note: in expansion of macro 'PPRINT' PPRINT(bfree, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~ pprint.c:121:3: note: in expansion of macro 'PPRINT' PPRINT(bavail, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~ pprint.c:122:3: note: in expansion of macro 'PPRINT' PPRINT(files, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~ pprint.c:123:3: note: in expansion of macro 'PPRINT' PPRINT(ffree, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~ pprint.c:125:3: note: in expansion of macro 'PPRINT' PPRINT(read, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~ pprint.c:126:3: note: in expansion of macro 'PPRINT' PPRINT(write, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_loadavg': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:139:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:35:9: warning: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ^~~~~~~~ ~ pprint.c:140:3: note: in expansion of macro 'PPRINT_ARRAY' PPRINT_ARRAY(loadavg, 3, "%f"); ^~~~~~~~~~~~ pprint.c:35:12: note: format string is defined here printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~^ %lu pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~ pprint.c:141:3: note: in expansion of macro 'PPRINT' PPRINT(nr_running, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:142:3: note: in expansion of macro 'PPRINT' PPRINT(nr_tasks, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:143:3: note: in expansion of macro 'PPRINT' PPRINT(last_pid, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_mem': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:156:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~ pprint.c:157:3: note: in expansion of macro 'PPRINT' PPRINT(total, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~ pprint.c:158:3: note: in expansion of macro 'PPRINT' PPRINT(used, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~ pprint.c:159:3: note: in expansion of macro 'PPRINT' PPRINT(free, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~ pprint.c:160:3: note: in expansion of macro 'PPRINT' PPRINT(shared, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~ pprint.c:161:3: note: in expansion of macro 'PPRINT' PPRINT(buffer, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~ pprint.c:162:3: note: in expansion of macro 'PPRINT' PPRINT(cached, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~ pprint.c:163:3: note: in expansion of macro 'PPRINT' PPRINT(user, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~ pprint.c:164:3: note: in expansion of macro 'PPRINT' PPRINT(locked, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_mountlist': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:180:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~ pprint.c:181:3: note: in expansion of macro 'PPRINT' PPRINT(number, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~ pprint.c:182:3: note: in expansion of macro 'PPRINT' PPRINT(total, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~ pprint.c:183:3: note: in expansion of macro 'PPRINT' PPRINT(size, "%llu"); ^~~~~~ pprint.c:185:17: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~^ ~~~~~~~~~ %4lu pprint.c:185:32: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~^ ~~~~~~~~~~ %lu pprint.c:189:40: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf("\t\t .%lu = { .dev = %#llx," ~~~~^ %#lx pprint.c:193:26: (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~ pprint.c: In function 'pprint_get_msg_limits': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:214:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~ pprint.c:215:3: note: in expansion of macro 'PPRINT' PPRINT(msgpool, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~ pprint.c:216:3: note: in expansion of macro 'PPRINT' PPRINT(msgmap, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~ pprint.c:217:3: note: in expansion of macro 'PPRINT' PPRINT(msgmax, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~ pprint.c:218:3: note: in expansion of macro 'PPRINT' PPRINT(msgmnb, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~ pprint.c:219:3: note: in expansion of macro 'PPRINT' PPRINT(msgmni, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~ pprint.c:220:3: note: in expansion of macro 'PPRINT' PPRINT(msgssz, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~ pprint.c:221:3: note: in expansion of macro 'PPRINT' PPRINT(msgtql, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_netload': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:235:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c: In function 'pprint_get_swap': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:269:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~ pprint.c:270:3: note: in expansion of macro 'PPRINT' PPRINT(total, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~ pprint.c:271:3: note: in expansion of macro 'PPRINT' PPRINT(used, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~ pprint.c:272:3: note: in expansion of macro 'PPRINT' PPRINT(free, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~ pprint.c:273:3: note: in expansion of macro 'PPRINT' PPRINT(pagein, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~ pprint.c:274:3: note: in expansion of macro 'PPRINT' PPRINT(pageout, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_uptime': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:287:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~ pprint.c:290:3: note: in expansion of macro 'PPRINT' PPRINT(boot_time, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_proc_kernel': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:304:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~ pprint.c:305:3: note: in expansion of macro 'PPRINT' PPRINT(k_flags, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~ pprint.c:306:3: note: in expansion of macro 'PPRINT' PPRINT(min_flt, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~ pprint.c:307:3: note: in expansion of macro 'PPRINT' PPRINT(maj_flt, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:308:3: note: in expansion of macro 'PPRINT' PPRINT(cmin_flt, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:309:3: note: in expansion of macro 'PPRINT' PPRINT(cmaj_flt, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_proc_mem': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:321:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~ pprint.c:322:3: note: in expansion of macro 'PPRINT' PPRINT(size, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~ pprint.c:323:3: note: in expansion of macro 'PPRINT' PPRINT(vsize, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(resident, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:324:3: note: in expansion of macro 'PPRINT' PPRINT(resident, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(resident, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(share, "%llu"); ~~~~~~~~~~~~ pprint.c:325:3: note: in expansion of macro 'PPRINT' PPRINT(share, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(resident, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(share, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(rss, "%llu"); ~~~~~~~~~~ pprint.c:326:3: note: in expansion of macro 'PPRINT' PPRINT(rss, "%llu"); ^~~~~~ pprint.c:21:37: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(resident, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(share, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(rss, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(rss_rlim, "%llu"); ~~~~~~~~~~~~~~~ pprint.c:327:3: note: in expansion of macro 'PPRINT' PPRINT(rss_rlim, "%llu"); ^~~~~~ pprint.c: In function 'pprint_get_proc_affinity': pprint.c:21:37: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] #define PPRINT(DATA, FORMAT) printf("\t%4lu B %3lu " #DATA " = " FORMAT "\n", \ ^~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.DATA, (unsigned long) buf_offsetof(DATA), buf.DATA) ~~~~~~~~~ #define PPRINT_ARRAY(ARRAY, SIZE, FORMAT) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~~~~~~~~ printf("\t%4lu B %3lu " #ARRAY "[%lu] = { ", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf.ARRAY, \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) buf_offsetof(ARRAY), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf.ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for (i = 0; i < (SIZE); ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (!buf.ARRAY[i] && i < (SIZE - 1) && !buf.ARRAY[i + 1]) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ do { i++; } while (i < SIZE && !buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("..., "); \ ~~~~~~~~~~~~~~~~~~~~~~~ } else { \ ~~~~~~~~~~~~~~~~~ printf(".%u = " FORMAT ", ", i, buf.ARRAY[i]); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~~~~ } \ ~~~~~~~~~~~ printf("}\n"); \ ~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_ENTRY_ARRAY(ARRAY, SIZE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; \ ~~~~~~~~~~~ printf("\t%4lu B " #ARRAY "[%lu/%lu] = { \n", \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) sizeof buf->ARRAY, (unsigned long)(SIZE), \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) G_N_ELEMENTS(buf->ARRAY)); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < SIZE; ++i) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (buf->ARRAY[i].values) { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("\t[ "); \ ~~~~~~~~~~~~~~~~~~~~~ PPRINT_HASHTABLE(buf->ARRAY[i].values); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf ("]\n"); \ ~~~~~~~~~~~~~~~~~~~~ } \ ~~~~~~~~ } \ ~~~ printf("} "); \ ~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define PPRINT_HASHTABLE(HASHTABLE) do { \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ g_hash_table_foreach (HASHTABLE, (GHFunc)pprint_hashtable_item, NULL); \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } while(0) ~~~~~~~~~~ #define FOOTER_PPRINT() putchar('\n'); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static void pprint_hashtable_item(gchar* key, gchar* value, gpointer user_data) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf ("'%s': '%s', ", key, value); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_sysinfo(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ const glibtop_sysinfo *buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~~ buf = glibtop_get_sysinfo(); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_sysinfo); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~ // PPRINT(ncpu, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ENTRY_ARRAY(cpuinfo, buf->ncpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_cpu(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_cpu buf; ~~~~~~~~~~~~~~~~ glibtop_get_cpu(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_cpu); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(nice, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(sys, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(idle, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(iowait, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(irq, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(softirq, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(frequency, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_total, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_user, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_nice, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_sys, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_idle, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_iowait, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_irq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(xcpu_softirq, GLIBTOP_NCPU, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(xcpu_flags, "%llx"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_fsusage(const char *mountpoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_fsusage buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_fsusage(&buf, mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_fsusage); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("pprint_get_fsusage (mountpoint = \"%s\"\n", mountpoint); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(blocks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bfree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(bavail, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(files, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(ffree, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(block_size, "%u"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(read, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(write, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_loadavg(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_loadavg buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_loadavg(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_loadavg); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT_ARRAY(loadavg, 3, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_running, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(nr_tasks, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(last_pid, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mem(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mem buf; ~~~~~~~~~~~~~~~~ glibtop_get_mem(&buf); ~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(shared, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(buffer, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cached, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(user, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(locked, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_mountlist(gboolean allfs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_mountlist buf; ~~~~~~~~~~~~~~~~~~~~~~ glibtop_mountentry *entries; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ size_t i; ~~~~~~~~~ entries = glibtop_get_mountlist(&buf, allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_mountlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_mountlist (allfs = %d)\n", allfs); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(number, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ printf("\t%4llu B entries[%llu] = \n\t\t{\n", buf.total, buf.number); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t\t .%lu = { .dev = %#llx," ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " .devname = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .mountir = \"%s\"," ~~~~~~~~~~~~~~~~~~~~~ " .type = \"%s\" }\n", ~~~~~~~~~~~~~~~~~~~~~~ (unsigned long) i, entries[i].dev, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ entries[i].devname, ~~~~~~~~~~~~~~~~~~~ entries[i].mountdir, ~~~~~~~~~~~~~~~~~~~~ entries[i].type); ~~~~~~~~~~~~~~~~~ } ~ printf("\t\t}\n"); ~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_free(entries); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_msg_limits(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_msg_limits buf; ~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_msg_limits(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_msg_limits); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgpool, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmap, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmax, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmnb, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgmni, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgssz, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(msgtql, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netload(const char *iface) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netload buf; ~~~~~~~~~~~~~~~~~~~~ glibtop_get_netload(&buf, iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netload); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ printf("glibtop_get_netload (iface = \"%s\")\n", iface); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_netlist(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_netlist buf; ~~~~~~~~~~~~~~~~~~~~ char **devices; ~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ devices = glibtop_get_netlist(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_netlist); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ for(i = 0; i < buf.number; ++i) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ printf("\t%s\n", devices[i]); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ } ~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ g_strfreev(devices); ~~~~~~~~~~~~~~~~~~~~ } ~ static void pprint_get_swap(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_swap buf; ~~~~~~~~~~~~~~~~~ glibtop_get_swap(&buf); ~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_swap); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(total, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(used, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(free, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(pagein, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(pageout, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_uptime(void) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_uptime buf; ~~~~~~~~~~~~~~~~~~~ glibtop_get_uptime(&buf); ~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_uptime); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(uptime, "%f"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(idletime, "%f"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(boot_time, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_kernel(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_kernel buf; ~~~~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_kernel(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_kernel); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(k_flags, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(min_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(maj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmin_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(cmaj_flt, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_mem(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_mem buf; ~~~~~~~~~~~~~~~~~~~~~ glibtop_get_proc_mem(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_mem); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(size, "%llu"); ~~~~~~~~~~~~~~~~~~~~~ PPRINT(vsize, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(resident, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(share, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~ PPRINT(rss, "%llu"); ~~~~~~~~~~~~~~~~~~~~ PPRINT(rss_rlim, "%llu"); ~~~~~~~~~~~~~~~~~~~~~~~~~ FOOTER_PPRINT(); ~~~~~~~~~~~~~~~~ } ~ static void pprint_get_proc_affinity(pid_t pid) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { ~ glibtop_proc_affinity buf; ~~~~~~~~~~~~~~~~~~~~~~~~~~ guint32 i; ~~~~~~~~~~ guint16* cpus; ~~~~~~~~~~~~~~ cpus = glibtop_get_proc_affinity(&buf, pid); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HEADER_PPRINT(glibtop_get_proc_affinity); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PPRINT(flags, "%#llx"); ~~~~~~~~~~~~ pprint.c:341:3: note: in expansion of macro 'PPRINT' PPRINT(flags, "%#llx"); ^~~~~~ mountlist.c: In function 'main': mountlist.c:98:21: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", ~~~^ %9lu mountlist.c:100:4: fsusage.blocks, fsusage.bfree, ~~~~~~~~~~~~~~ mountlist.c:98:26: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", ~~~^ %9lu mountlist.c:100:20: fsusage.blocks, fsusage.bfree, ~~~~~~~~~~~~~ mountlist.c:98:31: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 5 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", ~~~^ %9lu mountlist.c:101:4: fsusage.bavail, fsusage.files, ~~~~~~~~~~~~~~ mountlist.c:98:36: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 6 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", ~~~^ %9lu mountlist.c:101:20: fsusage.bavail, fsusage.files, ~~~~~~~~~~~~~ mountlist.c:98:41: warning: format '%Lu' expects argument of type 'long long unsigned int', but argument 7 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("%-16s %9Lu %9Lu %9Lu %9Lu %9Lu %9d\n", ~~~^ %9lu mountlist.c:102:4: fsusage.ffree, fsusage.block_size); ~~~~~~~~~~~~~ mv -f .deps/procargs.Tpo .deps/procargs.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT procmap.o -MD -MP -MF .deps/procmap.Tpo -c -o procmap.o procmap.c mv -f .deps/netlist.Tpo .deps/netlist.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT netload.o -MD -MP -MF .deps/netload.Tpo -c -o netload.o netload.c mv -f .deps/mountlist.Tpo .deps/mountlist.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT sysdeps.o -MD -MP -MF .deps/sysdeps.Tpo -c -o sysdeps.o sysdeps.c netload.c: In function 'main': netload.c:116:33: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ~~~~~~^ %016lx netload.c:135:3: netload.flags, ~~~~~~~~~~~~~ netload.c:116:10: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:136:3: netload.if_flags, ~~~~~~~~~~~~~~~~ netload.c:117:32: note: format string is defined here "\tInterface Flags:\t0x%016llx\n" ~~~~~~^ %016lx netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 9 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:140:3: netload.collisions, ~~~~~~~~~~~~~~~~~~ netload.c:121:24: note: format string is defined here "\tCollisions:\t\t%llu\n\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 10 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:141:3: netload.packets_in, ~~~~~~~~~~~~~~~~~~ netload.c:122:24: note: format string is defined here "\tPackets In:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 11 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:142:3: netload.packets_out, ~~~~~~~~~~~~~~~~~~~ netload.c:123:25: note: format string is defined here "\tPackets Out:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 12 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:143:3: netload.packets_total, ~~~~~~~~~~~~~~~~~~~~~ netload.c:124:27: note: format string is defined here "\tPackets Total:\t\t%llu\n\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 13 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:144:3: netload.bytes_in, ~~~~~~~~~~~~~~~~ netload.c:125:22: note: format string is defined here "\tBytes In:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 14 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:145:3: netload.bytes_out, ~~~~~~~~~~~~~~~~~ netload.c:126:23: note: format string is defined here "\tBytes Out:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 15 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:146:3: netload.bytes_total, ~~~~~~~~~~~~~~~~~~~ netload.c:127:25: note: format string is defined here "\tBytes Total:\t\t%llu\n\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 16 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:147:3: netload.errors_in, ~~~~~~~~~~~~~~~~~ netload.c:128:23: note: format string is defined here "\tErrors In:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 17 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:148:3: netload.errors_out, ~~~~~~~~~~~~~~~~~~ netload.c:129:24: note: format string is defined here "\tErrors Out:\t\t%llu\n" ~~~^ %lu netload.c:116:10: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 18 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] printf ("Network Load (0x%016llx):\n\n" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ netload.c:149:3: netload.errors_total, ~~~~~~~~~~~~~~~~~~~~ netload.c:130:26: note: format string is defined here "\tErrors Total:\t\t%llu\n\n" ~~~^ %lu mv -f .deps/netload.Tpo .deps/netload.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT timings.o -MD -MP -MF .deps/timings.Tpo -c -o timings.o timings.c mv -f .deps/pprint.Tpo .deps/pprint.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT openfiles.o -MD -MP -MF .deps/openfiles.Tpo -c -o openfiles.o openfiles.c mv -f .deps/sysdeps.Tpo .deps/sysdeps.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT smp.o -MD -MP -MF .deps/smp.Tpo -c -o smp.o smp.c procmap.c: In function 'main': procmap.c:165:28: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ~~~~^ %#lx procmap.c:168:4: maps[i].flags, ~~~~~~~~~~~~~ procmap.c:165:38: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ~~~^ %lu procmap.c:169:4: maps[i].size >> 10, ~~~~~~~~~~~~~~~~~~ procmap.c:165:50: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 4 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ~~~^ %lu procmap.c:170:4: maps[i].rss >> 10, ~~~~~~~~~~~~~~~~~ procmap.c:165:11: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 5 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:171:4: maps[i].shared_clean >> 10, ~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:166:21: note: format string is defined here "shared_clean:%lluKib shared_dirty:%lluKiB " ~~~^ %lu procmap.c:165:11: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:172:4: maps[i].shared_dirty >> 10, ~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:166:42: note: format string is defined here "shared_clean:%lluKib shared_dirty:%lluKiB " ~~~^ %lu procmap.c:165:11: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:173:4: maps[i].private_clean >> 10, ~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:167:22: note: format string is defined here "private_clean:%lluKiB private_dirty: %lluKiB\n", ~~~^ %lu procmap.c:165:11: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 8 has type 'guint64' {aka 'long unsigned int'} [-Wformat=] g_print("smaps flags:%#llx size:%lluKiB rss:%lluKiB " ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:174:4: maps[i].private_dirty >> 10); ~~~~~~~~~~~~~~~~~~~~~~~~~~~ procmap.c:167:45: note: format string is defined here "private_clean:%lluKiB private_dirty: %lluKiB\n", ~~~^ %lu mv -f .deps/openfiles.Tpo .deps/openfiles.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT proclist.o -MD -MP -MF .deps/proclist.Tpo -c -o proclist.o proclist.c mv -f .deps/procmap.Tpo .deps/procmap.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT free.o -MD -MP -MF .deps/free.Tpo -c -o free.o free.c mv -f .deps/free.Tpo .deps/free.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT wd.o -MD -MP -MF .deps/wd.Tpo -c -o wd.o wd.c mv -f .deps/smp.Tpo .deps/smp.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT affinity.o -MD -MP -MF .deps/affinity.Tpo -c -o affinity.o affinity.c mv -f .deps/proclist.Tpo .deps/proclist.Po cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../sysdeps/freebsd -DGTOPLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/local/include -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -MT diskio.o -MD -MP -MF .deps/diskio.Tpo -c -o diskio.o diskio.c mv -f .deps/wd.Tpo .deps/wd.Po /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o second second.o ../lib/libgtop-2.0.la -lm mv -f .deps/diskio.Tpo .deps/diskio.Po /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o pprint pprint.o ../lib/libgtop-2.0.la mv -f .deps/affinity.Tpo .deps/affinity.Po /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o procargs procargs.o ../lib/libgtop-2.0.la mv -f .deps/first.Tpo .deps/first.Po /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o df df.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/second second.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lm -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o netlist netlist.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/pprint pprint.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o mountlist mountlist.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/df df.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/netlist netlist.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o procmap procmap.o ../lib/libgtop-2.0.la /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o netload netload.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/netload netload.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o sysdeps sysdeps.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/procmap procmap.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/mountlist mountlist.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o openfiles openfiles.o ../lib/libgtop-2.0.la /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o smp smp.o ../lib/libgtop-2.0.la -lm libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/sysdeps sysdeps.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o proclist proclist.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/procargs procargs.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o free free.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/free free.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o wd wd.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/proclist proclist.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/smp smp.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lm -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o affinity affinity.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/openfiles openfiles.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib mv -f .deps/timings.Tpo .deps/timings.Po /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o diskio diskio.o ../lib/libgtop-2.0.la /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o first first.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/wd wd.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib /bin/sh ../libtool --tag=CC --mode=link cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -L/usr/local/lib -lgobject-2.0 -lglib-2.0 -lintl -o timings timings.o ../lib/libgtop-2.0.la libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/affinity affinity.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/first first.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/diskio diskio.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib libtool: link: cc -Winline -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -pipe -O2 -fno-strict-aliasing -o .libs/timings timings.o -L/usr/local/lib ../lib/.libs/libgtop-2.0.so -lgobject-2.0 -lglib-2.0 -lintl -lkvm -Wl,-rpath -Wl,/usr/local/lib gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/examples' Making all in doc gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc' Making all in reference gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[4]: Nothing to be done for 'all'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[3]: Nothing to be done for 'all-am'. gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[2]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[1]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' -------------------------------------------------------------------------------- -- Phase: run-depends -------------------------------------------------------------------------------- ===> libgtop-2.38.0_1 depends on file: /usr/local/libdata/pkgconfig/xau.pc - found ===> libgtop-2.38.0_1 depends on executable: indexinfo - found -------------------------------------------------------------------------------- -- Phase: stage -------------------------------------------------------------------------------- ===> Staging for libgtop-2.38.0_1 ===> Generating temporary packing list gmake[1]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' if test -z 'strip'; then \ gmake INSTALL_PROGRAM="/bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s" \ install_sh_PROGRAM="/bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s" INSTALL_STRIP_FLAG=-s \ install; \ else \ gmake INSTALL_PROGRAM="/bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s" \ install_sh_PROGRAM="/bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='strip'" install; \ fi gmake[2]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' Making install in po gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/po' installing am.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/am/LC_MESSAGES/libgtop.mo installing ar.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ar/LC_MESSAGES/libgtop.mo installing as.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/as/LC_MESSAGES/libgtop.mo installing ast.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ast/LC_MESSAGES/libgtop.mo installing az.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/az/LC_MESSAGES/libgtop.mo installing be.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/be/LC_MESSAGES/libgtop.mo installing bg.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/bg/LC_MESSAGES/libgtop.mo installing bn.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/bn/LC_MESSAGES/libgtop.mo installing bn_IN.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/bn_IN/LC_MESSAGES/libgtop.mo installing bs.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/bs/LC_MESSAGES/libgtop.mo installing ca.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ca/LC_MESSAGES/libgtop.mo installing ca@valencia.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ca@valencia/LC_MESSAGES/libgtop.mo installing cs.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/cs/LC_MESSAGES/libgtop.mo installing cy.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/cy/LC_MESSAGES/libgtop.mo installing da.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/da/LC_MESSAGES/libgtop.mo installing de.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/de/LC_MESSAGES/libgtop.mo installing dz.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/dz/LC_MESSAGES/libgtop.mo installing el.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/el/LC_MESSAGES/libgtop.mo installing en_CA.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/en_CA/LC_MESSAGES/libgtop.mo installing en_GB.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/en_GB/LC_MESSAGES/libgtop.mo installing en@shaw.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/en@shaw/LC_MESSAGES/libgtop.mo installing eo.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/eo/LC_MESSAGES/libgtop.mo installing es.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/es/LC_MESSAGES/libgtop.mo installing et.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/et/LC_MESSAGES/libgtop.mo installing eu.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/eu/LC_MESSAGES/libgtop.mo installing fa.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/fa/LC_MESSAGES/libgtop.mo installing fi.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/fi/LC_MESSAGES/libgtop.mo installing fr.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/fr/LC_MESSAGES/libgtop.mo installing fur.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/fur/LC_MESSAGES/libgtop.mo installing ga.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ga/LC_MESSAGES/libgtop.mo installing gl.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/gl/LC_MESSAGES/libgtop.mo installing gu.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/gu/LC_MESSAGES/libgtop.mo installing he.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/he/LC_MESSAGES/libgtop.mo installing hi.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/hi/LC_MESSAGES/libgtop.mo installing hr.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/hr/LC_MESSAGES/libgtop.mo installing hu.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/hu/LC_MESSAGES/libgtop.mo installing id.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/id/LC_MESSAGES/libgtop.mo installing it.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/it/LC_MESSAGES/libgtop.mo installing ja.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ja/LC_MESSAGES/libgtop.mo installing ka.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ka/LC_MESSAGES/libgtop.mo installing kn.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/kn/LC_MESSAGES/libgtop.mo installing ko.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ko/LC_MESSAGES/libgtop.mo installing ku.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ku/LC_MESSAGES/libgtop.mo installing ky.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ky/LC_MESSAGES/libgtop.mo installing la.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/la/LC_MESSAGES/libgtop.mo installing lt.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/lt/LC_MESSAGES/libgtop.mo installing lv.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/lv/LC_MESSAGES/libgtop.mo installing mai.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mai/LC_MESSAGES/libgtop.mo installing mg.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mg/LC_MESSAGES/libgtop.mo installing mi.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mi/LC_MESSAGES/libgtop.mo installing mk.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mk/LC_MESSAGES/libgtop.mo installing ml.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ml/LC_MESSAGES/libgtop.mo installing mn.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mn/LC_MESSAGES/libgtop.mo installing mr.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/mr/LC_MESSAGES/libgtop.mo installing ms.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ms/LC_MESSAGES/libgtop.mo installing nb.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/nb/LC_MESSAGES/libgtop.mo installing ne.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ne/LC_MESSAGES/libgtop.mo installing nl.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/nl/LC_MESSAGES/libgtop.mo installing nn.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/nn/LC_MESSAGES/libgtop.mo installing oc.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/oc/LC_MESSAGES/libgtop.mo installing or.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/or/LC_MESSAGES/libgtop.mo installing pa.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/pa/LC_MESSAGES/libgtop.mo installing pl.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/pl/LC_MESSAGES/libgtop.mo installing pt.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/pt/LC_MESSAGES/libgtop.mo installing pt_BR.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/pt_BR/LC_MESSAGES/libgtop.mo installing ro.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ro/LC_MESSAGES/libgtop.mo installing ru.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ru/LC_MESSAGES/libgtop.mo installing rw.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/rw/LC_MESSAGES/libgtop.mo installing sk.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sk/LC_MESSAGES/libgtop.mo installing sl.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sl/LC_MESSAGES/libgtop.mo installing sq.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sq/LC_MESSAGES/libgtop.mo installing sr.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sr/LC_MESSAGES/libgtop.mo installing sr@latin.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sr@latin/LC_MESSAGES/libgtop.mo installing sv.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/sv/LC_MESSAGES/libgtop.mo installing ta.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ta/LC_MESSAGES/libgtop.mo installing te.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/te/LC_MESSAGES/libgtop.mo installing tg.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/tg/LC_MESSAGES/libgtop.mo installing th.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/th/LC_MESSAGES/libgtop.mo installing tr.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/tr/LC_MESSAGES/libgtop.mo installing ug.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/ug/LC_MESSAGES/libgtop.mo installing uk.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/uk/LC_MESSAGES/libgtop.mo installing vi.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/vi/LC_MESSAGES/libgtop.mo installing xh.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/xh/LC_MESSAGES/libgtop.mo installing zh_CN.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/zh_CN/LC_MESSAGES/libgtop.mo installing zh_HK.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/zh_HK/LC_MESSAGES/libgtop.mo installing zh_TW.gmo as /construction/devel/libgtop/stage/usr/local/share/locale/zh_TW/LC_MESSAGES/libgtop.mo if test "libgtop" = "gettext-tools"; then \ /bin/mkdir -p /construction/devel/libgtop/stage/usr/local/share/gettext/po; \ for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot Makevars.template; do \ install -m 0644 ./$file \ /construction/devel/libgtop/stage/usr/local/share/gettext/po/$file; \ done; \ for file in Makevars; do \ rm -f /construction/devel/libgtop/stage/usr/local/share/gettext/po/$file; \ done; \ else \ : ; \ fi gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/po' Making install in misc gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/misc' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/misc' gmake[4]: Nothing to be done for 'install-exec-am'. gmake[4]: Nothing to be done for 'install-data-am'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/misc' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/misc' Making install in include gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include' Making install in glibtop gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[5]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0/glibtop' install -m 0644 close.h loadavg.h prockernel.h procstate.h sem_limits.h uptime.h command.h mem.h proclist.h proctime.h shm_limits.h cpu.h msg_limits.h procmem.h procuid.h swap.h procsegment.h sysdeps.h global.h procsignal.h union.h gnuserv.h parameter.h mountlist.h fsusage.h procmap.h signal.h sysinfo.h ppp.h procargs.h netload.h procwd.h procaffinity.h procio.h netlist.h procopenfiles.h open.h '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0/glibtop' gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include/glibtop' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[5]: Nothing to be done for 'install-exec-am'. gmake[5]: Nothing to be done for 'install-data-am'. gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/include' Making install in sysdeps gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' Making install in common gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' gmake[5]: Nothing to be done for 'install-exec-am'. gmake[5]: Nothing to be done for 'install-data-am'. gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/common' Making install in freebsd gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' gmake[5]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0' install -m 0644 glibtop_server.h glibtop_machine.h glibtop_suid.h '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0' gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps/freebsd' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[5]: Nothing to be done for 'install-exec-am'. gmake[5]: Nothing to be done for 'install-data-am'. gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/sysdeps' Making install in lib gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/lib' gmake install-am gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/lib' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/lib' /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/lib' /bin/sh ../libtool --mode=install /usr/bin/install -c -s libgtop-2.0.la '/construction/devel/libgtop/stage/usr/local/lib' libtool: install: /usr/bin/install -c .libs/libgtop-2.0.so.11.0.0 /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.so.11.0.0 libtool: install: strip --strip-unneeded /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.so.11.0.0 libtool: install: (cd /construction/devel/libgtop/stage/usr/local/lib && { ln -s -f libgtop-2.0.so.11.0.0 libgtop-2.0.so.11 || { rm -f libgtop-2.0.so.11 && ln -s libgtop-2.0.so.11.0.0 libgtop-2.0.so.11; }; }) libtool: install: (cd /construction/devel/libgtop/stage/usr/local/lib && { ln -s -f libgtop-2.0.so.11.0.0 libgtop-2.0.so || { rm -f libgtop-2.0.so && ln -s libgtop-2.0.so.11.0.0 libgtop-2.0.so; }; }) libtool: install: /usr/bin/install -c .libs/libgtop-2.0.lai /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.la libtool: install: /usr/bin/install -c .libs/libgtop-2.0.a /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.a libtool: install: strip --strip-debug /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.a libtool: install: chmod 644 /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.a libtool: install: ranlib /construction/devel/libgtop/stage/usr/local/lib/libgtop-2.0.a libtool: warning: remember to run 'libtool --finish /usr/local/lib' /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/share/gir-1.0' install -m 0644 GTop-2.0.gir '/construction/devel/libgtop/stage/usr/local/share/gir-1.0' /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/lib/girepository-1.0' install -m 0644 GTop-2.0.typelib '/construction/devel/libgtop/stage/usr/local/lib/girepository-1.0' gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/lib' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/lib' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/lib' Making install in src gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src' Making install in daemon gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/bin' STRIPPROG='strip' /bin/sh ../../libtool --mode=install /bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s libgtop_daemon2 libgtop_server2 '/construction/devel/libgtop/stage/usr/local/bin' libtool: warning: '../../lib/libgtop-2.0.la' has not been installed in '/usr/local/lib' libtool: install: /bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s .libs/libgtop_daemon2 /construction/devel/libgtop/stage/usr/local/bin/libgtop_daemon2 libtool: warning: '../../lib/libgtop-2.0.la' has not been installed in '/usr/local/lib' libtool: install: /bin/sh /construction/devel/libgtop/libgtop-2.38.0/install-sh -c -s .libs/libgtop_server2 /construction/devel/libgtop/stage/usr/local/bin/libgtop_server2 gmake install-exec-hook gmake[6]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' chgrp kmem /usr/local/bin/libgtop_server2 && chmod 2755 /usr/local/bin/libgtop_server2 chgrp: /usr/local/bin/libgtop_server2: No such file or directory gmake[6]: [Makefile:759: install-exec-hook] Error 1 (ignored) gmake[6]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' gmake[5]: Nothing to be done for 'install-data-am'. gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src/daemon' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[5]: Nothing to be done for 'install-exec-am'. gmake[5]: Nothing to be done for 'install-data-am'. gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/src' Making install in examples gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/examples' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/examples' gmake[4]: Nothing to be done for 'install-exec-am'. gmake[4]: Nothing to be done for 'install-data-am'. gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/examples' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/examples' Making install in doc gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc' Making install in reference gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[5]: Nothing to be done for 'install-exec-am'. install -m 0644 ./html/home.png install -m 0644 ./html/index.html install -m 0644 ./html/left-insensitive.png install -m 0644 ./html/left.png install -m 0644 ./html/libgtop-Close.html install -m 0644 ./html/libgtop-Command.html install -m 0644 ./html/libgtop-GlibTop-Server.html install -m 0644 ./html/libgtop-GlibTop.html install -m 0644 ./html/libgtop-Net-List.html install -m 0644 ./html/libgtop-Net-Load.html install -m 0644 ./html/libgtop-PPP.html install -m 0644 ./html/libgtop-Process-Arguments.html install -m 0644 ./html/libgtop-Process-List.html install -m 0644 ./html/libgtop-Process-Time.html install -m 0644 ./html/libgtop-Shared-Memory-Limits.html install -m 0644 ./html/libgtop-Uptime.html install -m 0644 ./html/libgtop-cpu.html install -m 0644 ./html/libgtop-fsusage.html install -m 0644 ./html/libgtop-lib.html install -m 0644 ./html/libgtop-loadavg.html install -m 0644 ./html/libgtop-mem.html install -m 0644 ./html/libgtop-mountlist.html install -m 0644 ./html/libgtop-msg-limits.html install -m 0644 ./html/libgtop-open.html install -m 0644 ./html/libgtop-parameter.html install -m 0644 ./html/libgtop-prockernel.html install -m 0644 ./html/libgtop-procmap.html install -m 0644 ./html/libgtop-procmem.html install -m 0644 ./html/libgtop-procopenfiles.html install -m 0644 ./html/libgtop-procsegment.html install -m 0644 ./html/libgtop-procsignal.html install -m 0644 ./html/libgtop-procstate.html install -m 0644 ./html/libgtop-procuid.html install -m 0644 ./html/libgtop-sem-limits.html install -m 0644 ./html/libgtop-signal.html install -m 0644 ./html/libgtop-swap.html install -m 0644 ./html/libgtop-sysdeps.html install -m 0644 ./html/libgtop-sysinfo.html install -m 0644 ./html/libgtop-union.html install -m 0644 ./html/libgtop-version.html install -m 0644 ./html/libgtop-white-paper-overview.html install -m 0644 ./html/libgtop-white-paper.html install -m 0644 ./html/libgtop.devhelp2 install -m 0644 ./html/right-insensitive.png install -m 0644 ./html/right.png install -m 0644 ./html/style.css install -m 0644 ./html/up-insensitive.png install -m 0644 ./html/up.png gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc/reference' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[5]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[5]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/share/info' install -m 0644 ./libgtop2.info '/construction/devel/libgtop/stage/usr/local/share/info' install-info --info-dir='/construction/devel/libgtop/stage/usr/local/share/info' '/construction/devel/libgtop/stage/usr/local/share/info/libgtop2.info' gmake[5]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0/doc' gmake[3]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[4]: Entering directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[4]: Nothing to be done for 'install-exec-am'. /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0' install -m 0644 glibtop.h libgtopconfig.h '/construction/devel/libgtop/stage/usr/local/include/libgtop-2.0' /bin/mkdir -p '/construction/devel/libgtop/stage/usr/local/libdata/pkgconfig' install -m 0644 libgtop-2.0.pc '/construction/devel/libgtop/stage/usr/local/libdata/pkgconfig' gmake[4]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[3]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[2]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' gmake[1]: Leaving directory '/construction/devel/libgtop/libgtop-2.38.0' ====> Compressing man pages (compress-man) -------------------------------------------------------------------------------- -- Phase: package -------------------------------------------------------------------------------- ===> Building package for libgtop-2.38.0_1 file sizes/checksums [189]: .. done packing files [189]: .. done packing directories [0]: . done -------------------------------------------------- -- Termination -------------------------------------------------- Finished: Tuesday, 23 JUL 2019 at 09:31:31 UTC Duration: 00:01:20