From 0fd23dd1855702fa2b4b8ba97f9a5497ecde7b5b Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Wed, 24 Jul 2019 17:01:39 +0800 Subject: [PATCH 001/102] =?UTF-8?q?Allow=20building=20with=20gettext=20?= =?UTF-8?q?=E2=89=A5=200.20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of AM_GNU_GETTEXT_VERSION in configure.ac instructs autopoint to copy po/Makefile.in.in from the exact gettext version. It is fine if the version of gettext installed on the system has the same minor version number with the requested version, but it fails if you have a newer version of gettext because of the mismatch between autoconf macros and Makefile.in.in. *** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version 0.19 but the autoconf macros are from gettext version 0.20 Instead of specifying the exact version with AM_GNU_GETTEXT_VERSION, we can use AM_GNU_GETTEXT_REQUIRE_VERSION to ask autopoint to simply use the gettext version installed on the system to prevent the mismatch. This also bumps the version requirement on gettext to 0.19.6 because AM_GNU_GETTEXT_REQUIRE_VERSION was added in this version. --- configure.ac | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 472f44b4..712b787c 100644 --- a/configure.ac +++ b/configure.ac @@ -215,7 +215,9 @@ AC_TYPE_SIGNAL AC_FUNC_STRFTIME AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) -AM_GNU_GETTEXT_VERSION([0.19.4]) +# FIXME: Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION +AM_GNU_GETTEXT_VERSION([0.19.6]) +AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6]) AM_GNU_GETTEXT([external]) GETTEXT_PACKAGE=libgtop-2.0 From 31db82efced79d1ceee465d9b50da2fe6fd16482 Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Fri, 5 Jul 2019 21:06:24 +0800 Subject: [PATCH 002/102] Mark glibtop_init_s as non-introspectable This function isn't exported so it should be skipped. https://gitlab.gnome.org/GNOME/gjs/issues/259 --- glibtop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glibtop.h b/glibtop.h index 2c963d05..3542249a 100644 --- a/glibtop.h +++ b/glibtop.h @@ -128,7 +128,7 @@ glibtop_init_r (glibtop **server_ptr, /** - * glibtop_init_s: + * glibtop_init_s: (skip) * @server_ptr: (out): * @features: * @flags: From 9146c9d0e41a8e6fde241f6aa094358294a3e76d Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Tue, 8 Oct 2019 20:30:06 +0200 Subject: [PATCH 003/102] Update Catalan translation --- po/ca.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/ca.po b/po/ca.po index 3b0e7457..de84dfe5 100644 --- a/po/ca.po +++ b/po/ca.po @@ -130,7 +130,7 @@ msgstr "Terminació" #: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" -msgstr "Condició urgent en socket" +msgstr "Condició urgent en sòcol" #: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" From 34242826d6f12ffbe8798c83e6d32a061a8843fe Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Thu, 29 Aug 2019 15:13:18 +0800 Subject: [PATCH 004/102] Check for kinfo_getfile on FreeBSD Code in sysdeps/freebsd contains a lot of HAVE_KINFO_GETFILE checks, but the macro is always undefined because the configure script doesn't check for it. To fix it, add required checks for kinfo_getfile function. --- libgtop-sysdeps.m4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index fff7af6a..b363dae0 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -118,6 +118,9 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AC_CHECK_LIB(kvm, kvm_open, KVM_LIBS=-lkvm, KVM_LIBS=) AC_SUBST(KVM_LIBS) + AC_CHECK_LIB(util, kinfo_getfile) + AC_CHECK_FUNCS(kinfo_getfile) + AC_CHECK_HEADERS(net/if_var.h,,, [ #include #include From 9b4a03ed0a82a3cbd3086e5352a991759213471b Mon Sep 17 00:00:00 2001 From: Neel Chauhan Date: Sun, 15 Dec 2019 11:06:37 -0500 Subject: [PATCH 005/102] Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry --- sysdeps/freebsd/procmap.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sysdeps/freebsd/procmap.c b/sysdeps/freebsd/procmap.c index ffd88e14..92ae9368 100644 --- a/sysdeps/freebsd/procmap.c +++ b/sysdeps/freebsd/procmap.c @@ -273,10 +273,18 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } +#if (__FreeBSD_version >= 1300062) + first = vmspace.vm_map.header.right; +#else first = vmspace.vm_map.header.next; +#endif if (kvm_read (server->machine->kd, +#if (__FreeBSD_version >= 1300062) + (gulong) vmspace.vm_map.header.right, +#else (gulong) vmspace.vm_map.header.next, +#endif (char *) &entry, sizeof (entry)) != sizeof (entry)) { glibtop_warn_io_r (server, "kvm_read (entry)"); glibtop_suid_leave (server); @@ -299,7 +307,11 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, if (update) { if (kvm_read (server->machine->kd, +#if (__FreeBSD_version >= 1300062) + (gulong) entry.right, +#else (gulong) entry.next, +#endif (char *) &entry, sizeof (entry)) != sizeof (entry)) { glibtop_warn_io_r (server, "kvm_read (entry)"); continue; @@ -377,7 +389,11 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, if (entry.protection & VM_PROT_EXECUTE) mentry->perm |= GLIBTOP_MAP_PERM_EXECUTE; +#if (__FreeBSD_version >= 1300062) + } while (entry.right != first); +#else } while (entry.next != first); +#endif glibtop_suid_leave (server); From 9e98bbd98b6a86f4c1aa48c5b8012dab559696cb Mon Sep 17 00:00:00 2001 From: Umarzuki Bin Mochlis Moktar Date: Wed, 8 Jan 2020 15:19:03 +0000 Subject: [PATCH 006/102] Update Malay translation --- po/ms.po | 206 +++++++++++++++++++++++++++---------------------------- 1 file changed, 101 insertions(+), 105 deletions(-) diff --git a/po/ms.po b/po/ms.po index b3a849f3..f93c0d78 100644 --- a/po/ms.po +++ b/po/ms.po @@ -4,203 +4,199 @@ msgid "" msgstr "" "Project-Id-Version: libgtop (libgtop-GNOME-2-0-port)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2005-09-25 18:15+0200\n" -"PO-Revision-Date: 2003-11-11 03:36+0800\n" -"Last-Translator: Hasbullah Bin Pit \n" -"Language-Team: Projek Gabai \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2019-10-08 18:31+0000\n" +"PO-Revision-Date: 2019-12-22 18:08+0800\n" +"Last-Translator: abuyop \n" +"Language-Team: Pasukan Terjemahan GNOME Malaysia\n" "Language: ms\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Poedit 2.0.6\n" -#: lib/read.c:65 -#, fuzzy, c-format +#: lib/read.c:49 +#, c-format msgid "read %d byte" msgid_plural "read %d bytes" -msgstr[0] "baca saiz data" -msgstr[1] "baca saiz data" +msgstr[0] "baca %d bait" +msgstr[1] "baca %d bait" -#: lib/read_data.c:53 +#: lib/read_data.c:49 msgid "read data size" msgstr "baca saiz data" -#: lib/read_data.c:72 -#, fuzzy, c-format +#: lib/read_data.c:66 +#, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" -msgstr[0] "baca saiz data" -msgstr[1] "baca saiz data" +msgstr[0] "baca %lu bait data" +msgstr[1] "baca %lu bait data" -#: lib/write.c:52 -#, fuzzy, c-format +#: lib/write.c:49 +#, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" -msgstr[0] "baca saiz data" -msgstr[1] "baca saiz data" +msgstr[0] "tulis %d bait" +msgstr[1] "tulis %d bait" -#: src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" -msgstr "Hidupkan pengnyahpepijatan" +msgstr "Benarkan penyahpepijatan" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Benarkan output berjela" #: src/daemon/gnuserv.c:460 -msgid "DEBUG" -msgstr "NYAHPEPIJAT" +msgid "Don’t fork into background" +msgstr "Jangan cabangkan ke balik tabir" #: src/daemon/gnuserv.c:462 -msgid "Enable verbose output" -msgstr "Hidupkan output berjela" - -#: src/daemon/gnuserv.c:462 -msgid "VERBOSE" -msgstr "BERJELA" - -#: src/daemon/gnuserv.c:464 -msgid "Don't fork into background" -msgstr "Jangan sepit ke latarbelakang" - -#: src/daemon/gnuserv.c:464 -msgid "NO-DAEMON" -msgstr "TIADA-DAEMON" - -#: src/daemon/gnuserv.c:466 msgid "Invoked from inetd" -msgstr "Merujuk pada inetd" +msgstr "Diseru daripada inetd" -#: src/daemon/gnuserv.c:466 -msgid "INETD" -msgstr "INETD" - -#: src/daemon/gnuserv.c:500 +#: src/daemon/gnuserv.c:498 #, c-format msgid "" -"Error on option %s: %s.\n" -"Run '%s --help' to see a full list of available command line options.\n" +"Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Ralat pada opsyen %s: %s.\n" -"Laksanakan '%s --help' untuk melihat senarai penuh opsyen arahan baris yang " -"ada.\n" +"Jalankan \"%s --help\" untuk melihat senarai penuh pilihan baris perintah " +"yang tersedia.\n" -#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Letak" -#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" -msgstr "Gangguan" +msgstr "Sampuk" -#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Keluar" -#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" -msgstr "Arahan terlarang" +msgstr "Arahan Terlarang" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Surih perangkap" #: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 -msgid "Trace trap" -msgstr "Jerangkap Surih" +msgid "Abort" +msgstr "Henti Paksa" #: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 -msgid "Abort" -msgstr "Batal" - -#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "EMT error" msgstr "Ralat EMT" -#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" -msgstr "Pengecualian Floating-point" +msgstr "Pengecualian titik-apung" -#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Bunuh" -#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" -msgstr "Ralat Bas" +msgstr "Ralat bas" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Pelanggaran pensegmenan" #: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 -msgid "Segmentation violation" -msgstr "" +msgid "Bad argument to system call" +msgstr "Argumen teruk ke panggilan sistem" #: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 -msgid "Bad argument to system call" -msgstr "Hujah teruk ke panggilan sistem" +msgid "Broken pipe" +msgstr "Paip rosak" #: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 -msgid "Broken pipe" -msgstr "Paip pecah" +msgid "Alarm clock" +msgstr "Jam penggera" #: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 -msgid "Alarm clock" -msgstr "Jam loceng" - -#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Termination" msgstr "Penamatan" -#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Keadaan segera pada soket" -#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Henti" -#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" -msgstr "Hentian papankekunci" +msgstr "Hentian papan kekunci" -#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Teruskan" -#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" -msgstr "Status anak berubah" +msgstr "Status anak telah berubah" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Baca balik tabir daripada tty" #: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 -msgid "Background read from tty" -msgstr "Bacaan latar belakang daripada tty" +msgid "Background write to tty" +msgstr "Tulis balik tabir ke tty" #: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 -msgid "Background write to tty" -msgstr "Penulisan latar belakang daripada tty" +msgid "I/O now possible" +msgstr "I/O kini dibolehkan" #: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 -msgid "I/O now possible" -msgstr "I/O sekarang dibolehkan" +msgid "CPU limit exceeded" +msgstr "Had CPU dilangkaui" #: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 -msgid "CPU limit exceeded" -msgstr "CPU melebihi had" +msgid "File size limit exceeded" +msgstr "Had saiz fail dilangkaui" #: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 -msgid "File size limit exceeded" -msgstr "Saiz fail melebihi had" +msgid "Virtual alarm clock" +msgstr "Jam penggera maya" #: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 -msgid "Virtual alarm clock" -msgstr "Jam loceng maya" +msgid "Profiling alarm clock" +msgstr "Memprofilkan jam penggera" #: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 -msgid "Profiling alarm clock" -msgstr "Memprofil jam loceng" +msgid "Window size change" +msgstr "Saiz tetingkap berubah" #: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 -msgid "Window size change" -msgstr "Penukaran saiz tetingkap" - -#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "Information request" msgstr "Permintaan maklumat" -#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" -msgstr "Isyarat dinyatakan pengguna 1" +msgstr "Isyarat ditakrif pengguna 1" -#: sysdeps/osf1/siglist.c:58 sysdeps/sun4/siglist.c:58 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" -msgstr "Isyarat dinyatakan pengguna 2" +msgstr "Isyarat ditakrif pengguna 2" + +#~ msgid "DEBUG" +#~ msgstr "NYAHPEPIJAT" + +#~ msgid "VERBOSE" +#~ msgstr "BERJELA" + +#~ msgid "NO-DAEMON" +#~ msgstr "TIADA-DAEMON" + +#~ msgid "INETD" +#~ msgstr "INETD" From 4229d1ea2018ccd7be94858f4d06013ce59f03cf Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Mon, 2 Dec 2019 21:46:50 +0800 Subject: [PATCH 007/102] Check if sbrk is available The only use of sbrk in libgtop is in an example which always calls it with 0. Since the use of sbrk provides no functionality, just skip these calls when sbrk is not available. This problem was first reported on FreeBSD Bugzilla because FreeBSD decides not to support sbrk on ARM64 and RISC-V: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221751 Fix https://gitlab.gnome.org/GNOME/libgtop/issues/46 --- configure.ac | 2 +- examples/mountlist.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 712b787c..d7215bf0 100644 --- a/configure.ac +++ b/configure.ac @@ -213,7 +213,7 @@ AC_FUNC_ALLOCA AC_FUNC_MMAP AC_TYPE_SIGNAL AC_FUNC_STRFTIME -AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv strdup strtoul uname) +AC_CHECK_FUNCS(getcwd gettimeofday getwd putenv sbrk strdup strtoul uname) # FIXME: Remove AM_GNU_GETTEXT_VERSION once autoreconf supports REQUIRE_VERSION AM_GNU_GETTEXT_VERSION([0.19.6]) diff --git a/examples/mountlist.c b/examples/mountlist.c index bbb005fc..6feacf91 100644 --- a/examples/mountlist.c +++ b/examples/mountlist.c @@ -71,7 +71,9 @@ main (int argc, char *argv []) printf ("Host = '%s' - %u\n\n", buffer, port); +#ifdef HAVE_SBRK printf ("sbrk (0) = %p\n\n", sbrk (0)); +#endif for (c = 0; c < PROFILE_COUNT; c++) { mount_entries = glibtop_get_mountlist (&mount_list, 1); @@ -79,7 +81,9 @@ main (int argc, char *argv []) g_free (mount_entries); } +#ifdef HAVE_SBRK printf ("sbrk (0) = %p\n\n", sbrk (0)); +#endif mount_entries = glibtop_get_mountlist (&mount_list, 1); @@ -108,7 +112,9 @@ main (int argc, char *argv []) g_free (mount_entries); +#ifdef HAVE_SBRK printf ("\nsbrk (0) = %p\n\n", sbrk (0)); +#endif glibtop_close (); From 317841ba048582ef4d72aaf4a443461ab54cad0e Mon Sep 17 00:00:00 2001 From: sicklylife Date: Tue, 28 Jan 2020 15:05:30 +0000 Subject: [PATCH 008/102] Update Japanese translation --- po/ja.po | 95 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/po/ja.po b/po/ja.po index ae342acb..4dfc2893 100644 --- a/po/ja.po +++ b/po/ja.po @@ -9,9 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: libgtop master\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=libgtop&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2011-09-08 07:27+0000\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-01-08 15:19+0000\n" "PO-Revision-Date: 2011-09-11 07:40+0900\n" "Last-Translator: Jiro Matsuzawa \n" "Language-Team: Japanese \n" @@ -21,171 +20,175 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "%dバイト読み込み" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "データの読み込みサイズ" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "%luバイトデータの読み込み" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "%dバイトの書き込み" -#: ../src/daemon/gnuserv.c:455 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "デバッグを有効にする" -#: ../src/daemon/gnuserv.c:457 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "詳細な出力にする" -#: ../src/daemon/gnuserv.c:459 -msgid "Don't fork into background" +#: src/daemon/gnuserv.c:460 +#, fuzzy +#| msgid "Don't fork into background" +msgid "Don’t fork into background" msgstr "子プロセスをバックグラウンドに回さない" -#: ../src/daemon/gnuserv.c:461 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "`inetd` から起動する" -#: ../src/daemon/gnuserv.c:495 -#, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" +#: src/daemon/gnuserv.c:498 +#, fuzzy, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" "利用可能なコマンド・ラインのオプション一覧を表示する場合は '%s --help' を実行" "してください\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "ハングアップ" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "インタラプト" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "終了" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "不正なインストラクション" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "トレーストラップ" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "停止" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "EMT エラー" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "浮動小数点例外" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "強制終了" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "バスエラー" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "セグメンテーションバイオレーション" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "システムコールの引数が誤っています" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "パイプ破壊" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "アラームクロック" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "ターミネーション" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "ソケットの緊急状態" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "ストップ" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "キーボード停止" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "コンティニュー" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "子プロセス状態が変更された" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "TTY からのバックグラウンド読み込み" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "TTY へのバックグラウンド書き込み" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "I/O が使用可能" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "CPU の限界を越えた" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "ファイルサイズの限界を越えた" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "仮想アラームクロック" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "アラームクロックのプロファイル" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "ウィンドウサイズの変更" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "情報リクエスト" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "ユーザー定義のシグナル1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "ユーザー定義のシグナル2" From 6dcc9195eaed81d733888588251c88cff554d20d Mon Sep 17 00:00:00 2001 From: sicklylife Date: Tue, 28 Jan 2020 15:11:10 +0000 Subject: [PATCH 009/102] Update Japanese translation --- po/ja.po | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/po/ja.po b/po/ja.po index 4dfc2893..9abada27 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,18 +1,20 @@ # libgtop ja.po. -# Copyright (C) 1998,2000,2002-2007,2009-2010 Free Software Foundation, Inc. -# Eiichiro ITANI , 1998 +# Copyright (C) 1998-2011, 2020 Free Software Foundation, Inc. +# Eiichiro ITANI , 1998. # Takayuki KUSANO , 2000, 2002, 2010. # Yukihiro Nakai , 2000. # KAMAGASAKO Masatoshi , 2003. -# Takeshi AIHANA , 2004-2007,2009. +# Takeshi AIHANA , 2004-2007, 2009. +# Jiro Matsuzawa , 2011. +# sicklylife , 2020. # msgid "" msgstr "" "Project-Id-Version: libgtop master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" "POT-Creation-Date: 2020-01-08 15:19+0000\n" -"PO-Revision-Date: 2011-09-11 07:40+0900\n" -"Last-Translator: Jiro Matsuzawa \n" +"PO-Revision-Date: 2020-01-28 21:00+0900\n" +"Last-Translator: sicklylife \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -24,7 +26,7 @@ msgstr "" #, c-format msgid "read %d byte" msgid_plural "read %d bytes" -msgstr[0] "%dバイト読み込み" +msgstr[0] "%d バイト読み込み" #: lib/read_data.c:49 msgid "read data size" @@ -34,13 +36,13 @@ msgstr "データの読み込みサイズ" #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" -msgstr[0] "%luバイトデータの読み込み" +msgstr[0] "%lu バイトデータの読み込み" #: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" -msgstr[0] "%dバイトの書き込み" +msgstr[0] "%d バイトの書き込み" #: src/daemon/gnuserv.c:456 msgid "Enable debugging" @@ -51,23 +53,19 @@ msgid "Enable verbose output" msgstr "詳細な出力にする" #: src/daemon/gnuserv.c:460 -#, fuzzy -#| msgid "Don't fork into background" msgid "Don’t fork into background" msgstr "子プロセスをバックグラウンドに回さない" #: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" -msgstr "`inetd` から起動する" +msgstr "“inetd”から起動する" #: src/daemon/gnuserv.c:498 -#, fuzzy, c-format -#| msgid "" -#| "Run '%s --help' to see a full list of available command line options.\n" +#, c-format msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"利用可能なコマンド・ラインのオプション一覧を表示する場合は '%s --help' を実行" -"してください\n" +"“%s --help”を実行すると利用可能なコマンドラインオプションの一覧が表示されます" +"\n" #: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" @@ -187,8 +185,8 @@ msgstr "情報リクエスト" #: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" -msgstr "ユーザー定義のシグナル1" +msgstr "ユーザー定義のシグナル 1" #: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" -msgstr "ユーザー定義のシグナル2" +msgstr "ユーザー定義のシグナル 2" From 5e11fb440593ee04b5673704aba36d7b5c8d50b3 Mon Sep 17 00:00:00 2001 From: Zander Brown Date: Wed, 19 Feb 2020 19:03:10 +0000 Subject: [PATCH 010/102] Update British English translation --- po/en_GB.po | 140 ++++++++++++++++++++++------------------------------ 1 file changed, 58 insertions(+), 82 deletions(-) diff --git a/po/en_GB.po b/po/en_GB.po index 1d0f73a3..1bd48985 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -3,229 +3,205 @@ # This file is distributed under the same license as the libgtop package. # Gareth Owen , David Lodge , 2004. # Gareth Owen , 2004. -# +# Zander Brown , 2019. # msgid "" msgstr "" "Project-Id-Version: libgtop\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-05-15 22:52+0100\n" -"PO-Revision-Date: 2007-05-15 22:52-0000\n" -"Last-Translator: David Lodge \n" -"Language-Team: English/GB \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2018-01-25 10:19+0000\n" +"PO-Revision-Date: 2019-08-25 15:44+0100\n" +"Last-Translator: Zander Brown \n" +"Language-Team: English - United Kingdom \n" "Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Gtranslator 3.32.1\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "read %d byte" msgstr[1] "read %d bytes" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "read data size" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "read %lu byte of data" msgstr[1] "read %lu bytes of data" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "wrote %d byte" msgstr[1] "wrote %d bytes" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Enable debugging" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Enable verbose output" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" -msgstr "Don't fork into background" +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Don’t fork into background" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Invoked from inetd" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" -msgstr "Run '%s --help' to see a full list of available command line options.\n" +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Run “%s --help” to see a full list of available command line options.\n" -#: ../sysdeps/osf1/siglist.c:27 -#: ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Hangup" -#: ../sysdeps/osf1/siglist.c:28 -#: ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Interrupt" -#: ../sysdeps/osf1/siglist.c:29 -#: ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Quit" -#: ../sysdeps/osf1/siglist.c:30 -#: ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Illegal instruction" -#: ../sysdeps/osf1/siglist.c:31 -#: ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Trace trap" -#: ../sysdeps/osf1/siglist.c:32 -#: ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Abort" -#: ../sysdeps/osf1/siglist.c:33 -#: ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "EMT error" -#: ../sysdeps/osf1/siglist.c:34 -#: ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Floating-point exception" -#: ../sysdeps/osf1/siglist.c:35 -#: ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Kill" -#: ../sysdeps/osf1/siglist.c:36 -#: ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Bus error" -#: ../sysdeps/osf1/siglist.c:37 -#: ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Segmentation violation" -#: ../sysdeps/osf1/siglist.c:38 -#: ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Bad argument to system call" -#: ../sysdeps/osf1/siglist.c:39 -#: ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Broken pipe" -#: ../sysdeps/osf1/siglist.c:40 -#: ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Alarm clock" -#: ../sysdeps/osf1/siglist.c:41 -#: ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Termination" -#: ../sysdeps/osf1/siglist.c:42 -#: ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Urgent condition on socket" -#: ../sysdeps/osf1/siglist.c:43 -#: ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Stop" -#: ../sysdeps/osf1/siglist.c:44 -#: ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Keyboard stop" -#: ../sysdeps/osf1/siglist.c:45 -#: ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Continue" -#: ../sysdeps/osf1/siglist.c:46 -#: ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "Child status has changed" -#: ../sysdeps/osf1/siglist.c:47 -#: ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Background read from tty" -#: ../sysdeps/osf1/siglist.c:48 -#: ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Background write to tty" -#: ../sysdeps/osf1/siglist.c:49 -#: ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "I/O now possible" -#: ../sysdeps/osf1/siglist.c:50 -#: ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "CPU limit exceeded" -#: ../sysdeps/osf1/siglist.c:51 -#: ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "File size limit exceeded" -#: ../sysdeps/osf1/siglist.c:52 -#: ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Virtual alarm clock" -#: ../sysdeps/osf1/siglist.c:53 -#: ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Profiling alarm clock" -#: ../sysdeps/osf1/siglist.c:54 -#: ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Window size change" -#: ../sysdeps/osf1/siglist.c:55 -#: ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Information request" -#: ../sysdeps/osf1/siglist.c:56 -#: ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "User defined signal 1" -#: ../sysdeps/osf1/siglist.c:57 -#: ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "User defined signal 2" #~ msgid "DEBUG" #~ msgstr "DEBUG" + #~ msgid "VERBOSE" #~ msgstr "VERBOSE" + #~ msgid "NO-DAEMON" #~ msgstr "NO-DAEMON" + #~ msgid "INETD" #~ msgstr "INETD" - From c20421275b72a38f717db4f5472e854a1ffc803a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jiri=20Gr=C3=B6nroos?= Date: Sat, 22 Feb 2020 15:09:51 +0000 Subject: [PATCH 011/102] Update Finnish translation --- po/fi.po | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/po/fi.po b/po/fi.po index 4a855e37..6289c4c2 100644 --- a/po/fi.po +++ b/po/fi.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: libgtop 1.90.1\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" -"POT-Creation-Date: 2018-01-25 10:19+0000\n" -"PO-Revision-Date: 2018-03-03 18:19+0200\n" +"POT-Creation-Date: 2020-01-28 15:06+0000\n" +"PO-Revision-Date: 2020-02-22 17:09+0200\n" "Last-Translator: Jiri Grönroos \n" "Language-Team: Finnish \n" "Language: fi\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 1.8.7.1\n" +"X-Generator: Poedit 2.3\n" #: lib/read.c:49 #, c-format @@ -54,10 +54,8 @@ msgid "Enable verbose output" msgstr "Näytä lisätietoja" #: src/daemon/gnuserv.c:460 -#, fuzzy -#| msgid "Don't fork into background" msgid "Don’t fork into background" -msgstr "Älä käynnistä taustaprosessia" +msgstr "Älä haarauta taustalle" #: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" From 267ae64965ee20af9420e67011fa1a9ba7821566 Mon Sep 17 00:00:00 2001 From: Daniel Korostil Date: Mon, 16 Mar 2020 15:05:24 +0000 Subject: [PATCH 012/102] Update Ukrainian translation --- po/uk.po | 122 ++++++++++++++++++++++++++----------------------------- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/po/uk.po b/po/uk.po index 7c11eb51..81e2b7e2 100644 --- a/po/uk.po +++ b/po/uk.po @@ -1,23 +1,25 @@ # Copyright (C) 2000 Free Software Foundation, Inc. -# Yuri Syrota , 2000. -# Maxim Dziumanenko , 2004-2007 # +# Yuri Syrota , 2000. +# Maxim Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2020. msgid "" msgstr "" "Project-Id-Version: libgtop 1.1.3\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-12 16:15+0300\n" -"PO-Revision-Date: 2007-09-12 11:35+0300\n" -"Last-Translator: Maxim Dziumanenko \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-01-08 15:19+0000\n" +"PO-Revision-Date: 2020-03-14 21:27+0200\n" +"Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" +"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 20.03.70\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" @@ -25,11 +27,11 @@ msgstr[0] "зчитано %d байт" msgstr[1] "зчитано %d байти" msgstr[2] "зчитано %d байтів" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "розмір прочитаних даних" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" @@ -37,7 +39,7 @@ msgstr[0] "зчитано %lu байт даних" msgstr[1] "зчитано %lu байти даних" msgstr[2] "зчитано %lu байтів даних" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" @@ -45,160 +47,152 @@ msgstr[0] "записано %d байт даних" msgstr[1] "записано %d байти даних" msgstr[2] "записано %d байтів даних" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Увімкнути налагодження" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Увімкнути докладний вивід" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" -msgstr "Не переходити у фоновий режим" +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Не створювати відгалуження до фонового режиму" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Викликаний з inetd" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Запустіть '%s --help' щоб побачити повний список доступних параметрів.\n" +"Віддайте команду «%s --help», щоб побачити повний список доступних" +" параметрів.\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Розірвати" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Перервати" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Вихід" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Неправильна команда" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Захоплення трасування" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Припинити" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "Помилка EMT" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Виключення операції з плаваючою крапкою" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Знищити" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Помилка шини" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Помилка сегментації" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Неправильний аргумент у системному виклику" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Розірвано канал" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Таймер" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Завершення" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Стан сокету, що вимагає уваги" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Зупинити" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Клавіатурний сигнал зупинки" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Продовжити" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "Було змінено стан дочірнього процесу" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Фонове зчитування з TTY" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Фоновий запис у TTY" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "Ввід-вивід наразі можливий" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "Перевищено обмеження ЦП" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "Перевищено обмеження розміру файла" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Віртуальний таймер" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Сигнал таймера профілювання" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Зміна розмірів вікна" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Запит інформації" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "Визначений користувачем сигнал 1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "Визначений користувачем сигнал 2" - -#~ msgid "DEBUG" -#~ msgstr "НАЛАГОДЖЕННЯ" - -#~ msgid "VERBOSE" -#~ msgstr "ДЕТАЛЬНО" - -#~ msgid "NO-DAEMON" -#~ msgstr "БЕЗ-ДЕМОНУ" - -#~ msgid "INETD" -#~ msgstr "INETD" From d49e17039e5ba43ab22e284b9764842011909984 Mon Sep 17 00:00:00 2001 From: Juliano Camargo Date: Fri, 11 Sep 2020 23:50:02 +0000 Subject: [PATCH 013/102] Update Portuguese translation --- po/pt.po | 105 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/po/pt.po b/po/pt.po index 316c8721..27a262c3 100644 --- a/po/pt.po +++ b/po/pt.po @@ -4,192 +4,195 @@ # Duarte Loreto , 2001, 2002, 2003, 2004, 2005, 2007, 2013. # # Pedro Albuquerque , 2015. +# Juliano de Souza Camargo , 2020. # msgid "" msgstr "" "Project-Id-Version: 3.8\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=libgtop&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2014-02-08 10:53+0000\n" -"PO-Revision-Date: 2015-06-25 09:38+0100\n" -"Last-Translator: Pedro Albuquerque \n" -"Language-Team: Português \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2020-09-11 20:49-0300\n" +"Last-Translator: Juliano de Souza Camargo \n" +"Language-Team: Portuguese <>\n" "Language: pt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Gtranslator 2.91.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"X-Generator: Gtranslator 3.36.0\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "%d byte lido" msgstr[1] "%d bytes lidos" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "tamanho dos dados lidos" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "%lu byte de dados lido" msgstr[1] "%lu bytes de dados lidos" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "%d byte escrito" msgstr[1] "%d bytes escritos" -#: ../src/daemon/gnuserv.c:455 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Ativar depuração" -#: ../src/daemon/gnuserv.c:457 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Ativar resultados extensos" -#: ../src/daemon/gnuserv.c:459 -msgid "Don't fork into background" +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" msgstr "Não efetuar fork em fundo" -#: ../src/daemon/gnuserv.c:461 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Invocado pelo inetd" -#: ../src/daemon/gnuserv.c:495 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Execute '%s --help' para consultar uma lista completa de opções de linha de " +"Execute “%s --help” para consultar uma lista completa de opções de linha de " "comando.\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Pendurado" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Interrompido" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Sair" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Instrução ilegal" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Armadilha de rasto" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Abortar" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "Erro EMT" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Exceção de vírgula flutuante" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Matar" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Erro de bus" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Violação de segmentação" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Argumento inválido em chamada de sistema" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Canal interrompido" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Alarme" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Terminação" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Condição urgente no socket" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Parar" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Parar por teclado" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Continuar" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "Alteração no estado do filho" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Leitura em fundo da tty" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Escrita em fundo para a tty" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "E/S agora possível" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "Limite de CPU excedido" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "Limite de tamanho de ficheiro excedido" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Alarme virtual" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Alarme de otimização" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Alteração de tamanho de janela" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Pedido de informação" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "Sinal 1 definido pelo utilizador" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "Sinal 2 definido pelo utilizador" From 9e62440b314fbf87bbeca865a4223311314c52a3 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 23 May 2020 08:26:34 +0800 Subject: [PATCH 014/102] New API to retrieve disk stats in Linux --- glibtop.h | 2 + include/glibtop/disk.h | 74 +++++++++++++++++++++++++ include/glibtop/sysdeps.h | 4 +- include/glibtop/union.h | 2 + lib/Makefile.am | 2 +- lib/command.c | 1 + lib/libgtop.sym | 2 + lib/sysdeps.c | 4 ++ src/daemon/main.c | 4 ++ sysdeps/common/default.c | 14 +++++ sysdeps/common/sysdeps_suid.c | 3 ++ sysdeps/linux/Makefile.am | 2 +- sysdeps/linux/disk.c | 96 +++++++++++++++++++++++++++++++++ sysdeps/linux/glibtop_private.c | 18 +++++++ sysdeps/linux/glibtop_private.h | 3 ++ sysdeps/linux/glibtop_server.h | 1 + sysdeps/stub/disk.c | 42 +++++++++++++++ sysdeps/stub/glibtop_server.h | 1 + 18 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 include/glibtop/disk.h create mode 100644 sysdeps/linux/disk.c create mode 100644 sysdeps/stub/disk.c diff --git a/glibtop.h b/glibtop.h index 3542249a..804294da 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,6 +80,8 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ + int ndisk; /* Number of DISKs, zero if single-disk */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h new file mode 100644 index 00000000..8843112c --- /dev/null +++ b/include/glibtop/disk.h @@ -0,0 +1,74 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_DISK_H__ +#define __GLIBTOP_DISK_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_XDISK_SECTORS_READ 0 +#define GLIBTOP_XDISK_TIME_READ 1 +#define GLIBTOP_XDISK_SECTORS_WRITE 2 +#define GLIBTOP_XDISK_TIME_WRITE 3 + +#define GLIBTOP_MAX_DISK 4 + +/* Nobody should really be using more than 4 disk. + Yes we are :) + Nobody should really be using more than 32 disk. +*/ +#define GLIBTOP_NDISK 1024 + +typedef struct _glibtop_disk glibtop_disk; + +struct _glibtop_disk +{ + guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ + guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ + guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ + guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ +}; + +void glibtop_get_disk(glibtop_disk *buf); + +#if GLIBTOP_SUID_DISK +#define glibtop_get_disk_r glibtop_get_disk_p +#else +#define glibtop_get_disk_r glibtop_get_disk_s +#endif + +void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); + +#if GLIBTOP_SUID_DISK +void _glibtop_init_disk_p (glibtop *server); +void glibtop_get_disk_p (glibtop *server, glibtop_disk *buf); +#else +void _glibtop_init_disk_s (glibtop *server); +void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h index a18c69e6..a1db66d8 100644 --- a/include/glibtop/sysdeps.h +++ b/include/glibtop/sysdeps.h @@ -54,8 +54,9 @@ G_BEGIN_DECLS #define GLIBTOP_SYSDEPS_PROC_WD 25 #define GLIBTOP_SYSDEPS_PROC_AFFINITY 26 #define GLIBTOP_SYSDEPS_PROC_IO 27 +#define GLIBTOP_SYSDEPS_DISK 28 -#define GLIBTOP_MAX_SYSDEPS 28 +#define GLIBTOP_MAX_SYSDEPS 29 /* The 'features' args to glibtop_init_* is an unsigned long */ G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX); @@ -69,6 +70,7 @@ struct _glibtop_sysdeps guint64 flags; guint64 features; /* server features */ guint64 cpu; /* glibtop_cpu */ + guint64 disk; /* glibtop_cpu */ guint64 mem; /* glibtop_mem */ guint64 swap; /* glibtop_swap */ guint64 uptime; /* glibtop_uptime */ diff --git a/include/glibtop/union.h b/include/glibtop/union.h index 334f0217..bda7c576 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -23,6 +23,7 @@ #define __GLIBTOP_UNION_H__ #include +#include #include #include #include @@ -60,6 +61,7 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; + glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/Makefile.am b/lib/Makefile.am index 90b82861..5a6f6511 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -29,7 +29,7 @@ if HAVE_INTROSPECTION introspection_sources = $(libgtop_2_0_la_SOURCES) lib.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/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/cpu.h ../include/glibtop/disk.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 \ diff --git a/lib/command.c b/lib/command.c index b6ccf1f2..cf2270e0 100644 --- a/lib/command.c +++ b/lib/command.c @@ -43,6 +43,7 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size, CHECK_CMND(GLIBTOP_CMND_QUIT); CHECK_CMND(GLIBTOP_CMND_SYSDEPS); CHECK_CMND(GLIBTOP_CMND_CPU); + CHECK_CMND(GLIBTOP_CMND_DISK); CHECK_CMND(GLIBTOP_CMND_MEM); CHECK_CMND(GLIBTOP_CMND_SWAP); CHECK_CMND(GLIBTOP_CMND_UPTIME); diff --git a/lib/libgtop.sym b/lib/libgtop.sym index afa9d070..60316a72 100644 --- a/lib/libgtop.sym +++ b/lib/libgtop.sym @@ -3,6 +3,8 @@ glibtop_close glibtop_close_r glibtop_get_cpu glibtop_get_cpu_l +glibtop_get_disk +glibtop_get_disk_l glibtop_get_fsusage glibtop_get_fsusage_l glibtop_get_loadavg diff --git a/lib/sysdeps.c b/lib/sysdeps.c index 2a761576..96292568 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -27,6 +27,7 @@ const unsigned long glibtop_server_features = GLIBTOP_SUID_CPU + +GLIBTOP_SUID_DISK + GLIBTOP_SUID_MEM + GLIBTOP_SUID_SWAP + GLIBTOP_SUID_UPTIME + @@ -56,6 +57,9 @@ const _glibtop_init_func_t _glibtop_init_hook_s [] = { #if !GLIBTOP_SUID_CPU _glibtop_init_cpu_s, #endif +#if !GLIBTOP_SUID_DISK + _glibtop_init_disk_s, +#endif #if !GLIBTOP_SUID_MEM _glibtop_init_mem_s, #endif diff --git a/src/daemon/main.c b/src/daemon/main.c index b51addf6..34cbaf50 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -97,6 +97,10 @@ handle_parent_connection (int s) glibtop_get_cpu_l (server, &resp->u.data.cpu); do_output (s, resp, _offset_data (cpu), 0, NULL); break; + case GLIBTOP_CMND_DISK: + glibtop_get_disk_l (server, &resp->u.disk.cpu); + do_output (s, resp, _offset_data (disk), 0, NULL); + break; case GLIBTOP_CMND_MEM: glibtop_get_mem_l (server, &resp->u.data.mem); do_output (s, resp, _offset_data (mem), 0, NULL); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index e3b096f2..c20f2938 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -64,6 +64,20 @@ glibtop_get_cpu(glibtop_cpu *buf) } +/** + * glibtop_get_disk: + * @buf: A location to return the disk usage. + * + * Get the DISK usage. + * + */ +void +glibtop_get_cpu(glibtop_cpu *buf) +{ + glibtop_get_cpu_l(glibtop_global_server, buf); +} + + /** * glibtop_get_fsusage: * @buf: A location to return the file system usage. diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index 24953176..ecb1d53e 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -30,6 +30,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif +#if GLIBTOP_SUID_DISK + _glibtop_init_disk_p, +#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index fdd54696..c51bb155 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c new file mode 100644 index 00000000..159f8f12 --- /dev/null +++ b/sysdeps/linux/disk.c @@ -0,0 +1,96 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_disk = +(1L << GLIBTOP_XDISK_SECTORS_READ) + (1L << GLIBTOP_XDISK_TIME_READ) + +(1L << GLIBTOP_XDISK_SECTORS_WRITE) + (1L << GLIBTOP_XDISK_TIME_WRITE); + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn +#define STAT_BUFSIZ 81920 + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + char buffer [STAT_BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_disk)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* + * GLOBAL + */ + + p = buffer; /* "disk" */ + + /* + * PER DISK + */ + + for (i = 0; i <= server->ndisk; i++) { + + p = skip_multiple_token(p,2); + + // skip if disk is the raw device + if(!check_alphanumeric_word(p)){ + + p = skip_line(p); /* move to ^ */ + p = skip_multiple_token(p,2); + + } + + if (!check_disk_line_warn(server, p, i)) + break; + + p = skip_token(p); /* prev xdisk_name */ + p = skip_token(p); /* prev xdisk_reads_completed */ + p = skip_token(p); /* prev xdisk_reads_merged */ + + buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); + buf->xdisk_time_read [i] = strtoull (p, &p, 0); + + p = skip_token(p); /* prev xdisk_writes_completed */ + p = skip_token(p); /* prev xdisk_writes_merged */ + + buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); + buf->xdisk_time_write [i] = strtoull (p, &p, 0); + + p = skip_line(p); /* move to ^ */ + + } +} diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index d3a49aa6..7b36561c 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,6 +57,24 @@ skip_token (const char *p) } +int +check_alphanumeric_word (const char *p) +{ + int test = 0; + p = next_token(p); + while (*p && !g_ascii_isspace(*p)) { + if(g_ascii_isalpha(*p)){ + test = 0; + }else if(g_ascii_isdigit(*p)){ + test = 1; + } + p++; + }; + p = next_token(p); + return test; +} + + /* * Read functions */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 03761f4f..d42ee669 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,6 +61,9 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } +int +check_alphanumeric_word (const char *p); + /* * Smart strtoul which handles binary suffixes * e.g: get_scaled("Size: 32 kB", "Size:") == 32768 diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 6240d5de..43dd9d9f 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -23,6 +23,7 @@ #define __LINUX__GLIBTOP_SERVER_H__ #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 diff --git a/sysdeps/stub/disk.c b/sysdeps/stub/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/stub/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server.h index 1dd18bf0..0f8bd194 100644 --- a/sysdeps/stub/glibtop_server.h +++ b/sysdeps/stub/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 From 9cbb3b91f11ad0c4944a1428d609201c054cffab Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 26 May 2020 10:57:48 +0800 Subject: [PATCH 015/102] Handle LVM and RAID --- glibtop.h | 2 +- include/glibtop/disk.h | 10 +- sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 218 +++++++++++++++++++++++++++++--- sysdeps/linux/glibtop_private.c | 27 ++-- sysdeps/linux/glibtop_private.h | 4 +- 6 files changed, 229 insertions(+), 36 deletions(-) diff --git a/glibtop.h b/glibtop.h index 804294da..c196818c 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,7 +80,7 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk */ + int ndisk; /* Number of DISKs, zero if single-disk */ int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index 8843112c..cdde7796 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -42,6 +42,14 @@ G_BEGIN_DECLS typedef struct _glibtop_disk glibtop_disk; +struct _partition_info +{ + char name[256]; + char type[256]; + char raid_num[256]; + int max; +}; + struct _glibtop_disk { guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ @@ -50,7 +58,7 @@ struct _glibtop_disk guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ }; -void glibtop_get_disk(glibtop_disk *buf); +void glibtop_get_disk (glibtop_disk *buf); #if GLIBTOP_SUID_DISK #define glibtop_get_disk_r glibtop_get_disk_p diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index c20f2938..653a4f5a 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_cpu(glibtop_cpu *buf) +glibtop_get_cpu (glibtop_cpu *buf) { - glibtop_get_cpu_l(glibtop_global_server, buf); + glibtop_get_cpu_l (glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 159f8f12..3ad74bcc 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -39,58 +39,244 @@ _glibtop_init_disk_s (glibtop *server) /* Provides information about disk usage. */ -#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn +// Linux kernel reports sectors by 512 bytes even for AF 4kn // + +#define FILENAME "/proc/diskstats" +#define CMD_PIPE "lsblk --output NAME,TYPE -i -n | sed 's/`-//'|sed 's/|-//'|sed 's/|//'| sed -e 's/^[ \t]*//'|tr -s ' '" #define STAT_BUFSIZ 81920 +// Handle LVM and RAID // + +void +find_primary_part (_partition_info *primary_part, const char *m) +{ + int n = 0, tlvl = 0; + char name[256]="",type[256]=""; + + primary_part->max = 0; + + //scan by tree level + //0 = disk (to lvl 0) + //0 = disk, 1 = part (to lvl 1) + //0 = disk, 1 = part, 2 = lvm or raid (to lvl 2) + //0 = disk, 1 = part, 2 = raid, 3 = lvm (to lvl 3) + + while (sscanf(m, "%s %s", name, type) == 2) + { + + if (tlvl == 0) { + + if (strcmp (type, "disk") == 0) { + + primary_part->max++; + + } + else if ((strcmp (type, "part") == 0)){ + + tlvl = 1; + + } + + } + else if(tlvl == 1){ + + if (strcmp (type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (type, "part") == 0)) { + + n--; + + } + else if ((strcmp (type, "lvm") == 0)) { + + tlvl = 2; + primary_part->max++; + + } + else if ((strncmp (type, "raid", 4) == 0)) { + + tlvl = 2; + primary_part->max++; + + } + + } + else if( tlvl == 2){ + + if (strcmp(type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { + + n--; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { + + n--; + + } + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "lvm") == 0)){ + + tlvl = 3; + primary_part->max++; + + } + + } + else if (tlvl == 3) { + + if (strcmp (type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (type, "lvm") == 0)) { + + n--; + + } + else if ((strncmp (type, "raid", 4) == 0)) { + + n--; + tlvl = 2; + + } + else if ((strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + } + + + strcpy (primary_part[n].name, name); + strncpy (primary_part[n].type, type, 4); + + if (strcmp (primary_part[n].type, "raid") == 0) { + + strcpy (primary_part[n].raid_num, type + 4); + + } + + m = skip_line (m); + n++; + + } +} + +int +is_virtual_drive (_partition_info *primary_part, const char *p) +{ + int i; + char name[256]; + int test = 1; + sscanf (p, "%s", name); + + if (*p) { + + for (i=0; imax; i++) { + + if (strcmp (primary_part[i].name, name) == 0) { + + test = 0; + break; + + } + + } + + } + else { + + test = 0; + + } + + return test; +} + void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - char buffer [STAT_BUFSIZ], *p; + _partition_info primary_part[GLIBTOP_NDISK]; + char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; int i; memset (buf, 0, sizeof (glibtop_disk)); - file_to_buffer(server, buffer, sizeof buffer, FILENAME); + file_to_buffer (server, buffer, sizeof buffer, FILENAME); + + get_from_pipe (map_buffer, CMD_PIPE); + + server->ndisk = GLIBTOP_NDISK; /* * GLOBAL */ p = buffer; /* "disk" */ + m = map_buffer; /* * PER DISK */ + find_primary_part (primary_part, m); + for (i = 0; i <= server->ndisk; i++) { - p = skip_multiple_token(p,2); + p = skip_multiple_token (p,2); - // skip if disk is the raw device - if(!check_alphanumeric_word(p)){ + // skip if disk is the raw device + if (!is_virtual_drive (primary_part, p)) { - p = skip_line(p); /* move to ^ */ - p = skip_multiple_token(p,2); + p = skip_line (p); /* move to ^ */ + p = skip_multiple_token (p, 2); - } + } - if (!check_disk_line_warn(server, p, i)) + if (!check_disk_line_warn (server, p, i)) break; - p = skip_token(p); /* prev xdisk_name */ - p = skip_token(p); /* prev xdisk_reads_completed */ - p = skip_token(p); /* prev xdisk_reads_merged */ + p = skip_token (p); /* prev xdisk_name */ + p = skip_token (p); /* prev xdisk_reads_completed */ + p = skip_token (p); /* prev xdisk_reads_merged */ buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); buf->xdisk_time_read [i] = strtoull (p, &p, 0); - p = skip_token(p); /* prev xdisk_writes_completed */ - p = skip_token(p); /* prev xdisk_writes_merged */ + p = skip_token (p); /* prev xdisk_writes_completed */ + p = skip_token (p); /* prev xdisk_writes_merged */ buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); buf->xdisk_time_write [i] = strtoull (p, &p, 0); - p = skip_line(p); /* move to ^ */ + p = skip_line (p); /* move to ^ */ } } diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index 7b36561c..7bca42a5 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,21 +57,20 @@ skip_token (const char *p) } -int -check_alphanumeric_word (const char *p) +void +get_from_pipe (char *buffer, const char *cmd) { - int test = 0; - p = next_token(p); - while (*p && !g_ascii_isspace(*p)) { - if(g_ascii_isalpha(*p)){ - test = 0; - }else if(g_ascii_isdigit(*p)){ - test = 1; - } - p++; - }; - p = next_token(p); - return test; + FILE* fp; + long psize; + + fp = popen (cmd, "r"); + + fseek (fp, 0, SEEK_END); + psize = ftell (fp); + fseek (fp, 0, SEEK_SET); + fread(buffer,1,psize,fp); + + pclose (fp); } diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index d42ee669..66fed54c 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,8 +61,8 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } -int -check_alphanumeric_word (const char *p); +void +get_from_pipe (char *buffer, const char *cmd) /* * Smart strtoul which handles binary suffixes From 7396970afe2290488fd072612a650353dd13a16d Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 26 May 2020 18:53:49 +0800 Subject: [PATCH 016/102] Code clean up and add example --- autogen.sh | 28 +++++++++++++ configure.ac | 10 +++++ doc/reference/libgtop-sections.txt | 34 ++++++++++++++++ examples/Makefile.am | 3 ++ examples/disk.c | 65 ++++++++++++++++++++++++++++++ features.def | 1 + include/glibtop/Makefile.am | 2 +- include/glibtop/command.h | 3 +- include/glibtop/disk.h | 6 ++- include/glibtop/union.h | 2 +- lib/sysdeps.c | 3 ++ libgtop-2.0.pc.in | 2 +- libgtop.spec.in | 1 + src/daemon/main.c | 2 +- src/daemon/slave.c | 6 +++ sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 33 ++++++++++----- sysdeps/linux/glibtop_private.h | 2 +- sysdeps/stub/Makefile.am | 2 +- sysdeps/stub_suid/Makefile.am | 2 +- sysdeps/stub_suid/disk.c | 47 +++++++++++++++++++++ 21 files changed, 238 insertions(+), 20 deletions(-) create mode 100644 examples/disk.c create mode 100644 sysdeps/stub_suid/disk.c diff --git a/autogen.sh b/autogen.sh index 9d394bff..ab75b974 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,33 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. +RED='\033[0;31m' +NC='\033[0m' # No Color + +case "$(uname -s)" in + Linux) + if ! [ -x "$(command -v lsblk)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} lsblk cannot be found. Try installing util-linux or util-linux-ng ${RED}***${NC}" >&2 + echo '' >&2 + exit 1 + fi + if ! [ -x "$(command -v sed)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} sed cannot be found. ***" >&2 + echo '' >&2 + exit 1 + fi + if ! [ -x "$(command -v tr)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} tr cannot be found. ***" >&2 + echo '' >&2 + exit 1 + fi + ;; + *) + ;; +esac + test -n "$srcdir" || srcdir=$(dirname "$0") test -n "$srcdir" || srcdir=. diff --git a/configure.ac b/configure.ac index d7215bf0..5426daf1 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,16 @@ dnl Most people should have a working perl interpreter on their system AC_CHECK_PROGS(PERL, perl5 perl) test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.]) +case "${host_os}" in + linux*) + AC_CHECK_TOOL(LSBLK,lsblk) + AC_CHECK_TOOL(SED,sed) + AC_CHECK_TOOL(TR,tr) + ;; + *) + ;; +esac + AC_CHECK_TOOL(CC,gcc) AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(AS,as) diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index ba878943..3d6d710d 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -29,6 +29,7 @@ glibtop_close_p GLIBTOP_CMND_QUIT GLIBTOP_CMND_SYSDEPS GLIBTOP_CMND_CPU +GLIBTOP_CMND_DISK GLIBTOP_CMND_MEM GLIBTOP_CMND_SWAP GLIBTOP_CMND_UPTIME @@ -678,6 +679,39 @@ glibtop_init_cpu_s glibtop_get_cpu_s +glibtop/disk.h +
+disk +GLIBTOP_DISK_TOTAL +GLIBTOP_DISK_USER +GLIBTOP_DISK_NICE +GLIBTOP_DISK_SYS +GLIBTOP_DISK_IDLE +GLIBTOP_DISK_FREQUENCY +GLIBTOP_XDISK_TOTAL +GLIBTOP_XDISK_USER +GLIBTOP_XDISK_NICE +GLIBTOP_XDISK_SYS +GLIBTOP_XDISK_IDLE +GLIBTOP_XDISK_FLAGS +GLIBTOP_DISK_IOWAIT +GLIBTOP_DISK_IRQ +GLIBTOP_DISK_SOFTIRQ +GLIBTOP_XDISK_IOWAIT +GLIBTOP_XDISK_IRQ +GLIBTOP_XDISK_SOFTIRQ +GLIBTOP_MAX_DISK +GLIBTOP_NDISK +glibtop_disk +glibtop_get_disk +glibtop_get_disk_r +glibtop_get_disk_l +glibtop_init_disk_p +glibtop_get_disk_p +glibtop_init_disk_s +glibtop_get_disk_s +
+ glibtop/swap.h
swap diff --git a/examples/Makefile.am b/examples/Makefile.am index 25585e04..ef192787 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -34,6 +34,9 @@ mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la smp_SOURCES = smp.c smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm +disk_SOURCES = disk.c +disk_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm + timings_SOURCES = timings.c timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/examples/disk.c b/examples/disk.c new file mode 100644 index 00000000..c3c61142 --- /dev/null +++ b/examples/disk.c @@ -0,0 +1,65 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include + +#include +#include + +int +main (int argc, char *argv []) +{ + glibtop_disk disk; + char separator [BUFSIZ]; + int ndisk, i; + + glibtop_init(); + + glibtop_get_disk (&disk); + + ndisk = glibtop_global_server->ndisk ? glibtop_global_server->ndisk : 1; + + memset (separator, '-', 91); + separator [92] = '\0'; + + printf("\n\n"); + printf ("ELAPSE "); + printf ("Read Time Read Write Time Write\n"); + printf ("%s\n", separator); + + for (i = 0; i < ndisk; i++) { + printf ("DISK %3d : %12lu %12lu %12lu %12lu\n", i, + (unsigned long) disk.xdisk_sectors_read [i], + (unsigned long) disk.xdisk_time_read [i], + (unsigned long) disk.xdisk_sectors_write [i], + (unsigned long) disk.xdisk_time_write [i]); + + } + + printf ("%s\n\n\n", separator); + + exit (0); +} diff --git a/features.def b/features.def index faab87b1..50cbe72a 100644 --- a/features.def +++ b/features.def @@ -1,4 +1,5 @@ void|cpu +void|disk void|mem void|swap void|uptime diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index 6d0e055f..da78ca93 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -2,7 +2,7 @@ glibtopdir = $(includedir)/libgtop-2.0/glibtop glibtop_HEADERS = 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 \ + proctime.h shm_limits.h cpu.h disk.h msg_limits.h \ procmem.h procuid.h swap.h \ procsegment.h sysdeps.h global.h \ procsignal.h union.h gnuserv.h \ diff --git a/include/glibtop/command.h b/include/glibtop/command.h index 9a0e47b1..31e89589 100644 --- a/include/glibtop/command.h +++ b/include/glibtop/command.h @@ -60,8 +60,9 @@ G_BEGIN_DECLS #define GLIBTOP_CMND_PROC_WD 26 #define GLIBTOP_CMND_PROC_AFFINITY 27 #define GLIBTOP_CMND_PROC_IO 28 +#define GLIBTOP_CMND_DISK 29 -#define GLIBTOP_MAX_CMND 29 +#define GLIBTOP_MAX_CMND 30 #define _GLIBTOP_PARAM_SIZE 16 diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index cdde7796..292924f6 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -46,16 +46,20 @@ struct _partition_info { char name[256]; char type[256]; - char raid_num[256]; + char raid_num[256]; int max; }; +typedef struct _partition_info partition_info; + struct _glibtop_disk { + guint64 flags; guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ + guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/include/glibtop/union.h b/include/glibtop/union.h index bda7c576..eb57cfc0 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -61,7 +61,7 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; - glibtop_disk disk; + glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/sysdeps.c b/lib/sysdeps.c index 96292568..beb950e8 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -139,6 +139,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif +#if GLIBTOP_SUID_DISK + _glibtop_init_disk_p, +#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/libgtop-2.0.pc.in b/libgtop-2.0.pc.in index e1753322..4381ab20 100644 --- a/libgtop-2.0.pc.in +++ b/libgtop-2.0.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: libgtop Description: Portable System Access Library -Requires: glib-2.0 +Requires: glib-2.0, util-linux Version: @VERSION@ Libs: -L${libdir} -lgtop-2.0 Cflags: -I${includedir}/libgtop-2.0 diff --git a/libgtop.spec.in b/libgtop.spec.in index 5957868e..f4fefa5b 100644 --- a/libgtop.spec.in +++ b/libgtop.spec.in @@ -5,6 +5,7 @@ %define prefix /usr Summary: LibGTop library +Requires: util-linux, sed Name: libgtop Version: %ver Release: %rel diff --git a/src/daemon/main.c b/src/daemon/main.c index 34cbaf50..88e19a09 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -98,7 +98,7 @@ handle_parent_connection (int s) do_output (s, resp, _offset_data (cpu), 0, NULL); break; case GLIBTOP_CMND_DISK: - glibtop_get_disk_l (server, &resp->u.disk.cpu); + glibtop_get_disk_l (server, &resp->u.data.disk); do_output (s, resp, _offset_data (disk), 0, NULL); break; case GLIBTOP_CMND_MEM: diff --git a/src/daemon/slave.c b/src/daemon/slave.c index e15f1efc..6e80b2b8 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -135,6 +135,12 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, resp->offset = _offset_data (cpu); break; #endif +#if GLIBTOP_SUID_DISK + case GLIBTOP_CMND_DISK: + glibtop_get_disk_p (server, &resp->u.data.disk); + resp->offset = _offset_data (disk); + break; +#endif #if GLIBTOP_SUID_MEM case GLIBTOP_CMND_MEM: glibtop_get_mem_p (server, &resp->u.data.mem); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index 653a4f5a..ff6c3ecd 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_cpu (glibtop_cpu *buf) +glibtop_get_disk (glibtop_disk *buf) { - glibtop_get_cpu_l (glibtop_global_server, buf); + glibtop_get_disk_l (glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 3ad74bcc..c2d341f6 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -48,7 +48,7 @@ _glibtop_init_disk_s (glibtop *server) // Handle LVM and RAID // void -find_primary_part (_partition_info *primary_part, const char *m) +find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; char name[256]="",type[256]=""; @@ -190,7 +190,7 @@ find_primary_part (_partition_info *primary_part, const char *m) } int -is_virtual_drive (_partition_info *primary_part, const char *p) +is_virtual_drive (partition_info *primary_part, const char *p) { int i; char name[256]; @@ -220,10 +220,27 @@ is_virtual_drive (_partition_info *primary_part, const char *p) return test; } +int +max_lines (const char *p) +{ + char temp[10]; + int count = 0; + + while (sscanf (p, "%s", temp) == 1) + { + + p = skip_line(p); + count++; + + } + + return count; +} + void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - _partition_info primary_part[GLIBTOP_NDISK]; + partition_info primary_part[GLIBTOP_NDISK]; char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; int i; @@ -233,8 +250,6 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) get_from_pipe (map_buffer, CMD_PIPE); - server->ndisk = GLIBTOP_NDISK; - /* * GLOBAL */ @@ -246,23 +261,23 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) * PER DISK */ + server->ndisk = max_lines(p); + find_primary_part (primary_part, m); - for (i = 0; i <= server->ndisk; i++) { + for (i = 0; i < server->ndisk; i++) { p = skip_multiple_token (p,2); // skip if disk is the raw device if (!is_virtual_drive (primary_part, p)) { + server->ndisk--; p = skip_line (p); /* move to ^ */ p = skip_multiple_token (p, 2); } - if (!check_disk_line_warn (server, p, i)) - break; - p = skip_token (p); /* prev xdisk_name */ p = skip_token (p); /* prev xdisk_reads_completed */ p = skip_token (p); /* prev xdisk_reads_merged */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 66fed54c..39101163 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -62,7 +62,7 @@ skip_line (const char *p) } void -get_from_pipe (char *buffer, const char *cmd) +get_from_pipe (char *buffer, const char *cmd); /* * Smart strtoul which handles binary suffixes diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am index f4219edb..6d9ce727 100644 --- a/sysdeps/stub/Makefile.am +++ b/sysdeps/stub/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am index fcc7daf9..3f1bf958 100644 --- a/sysdeps/stub_suid/Makefile.am +++ b/sysdeps/stub_suid/Makefile.am @@ -7,7 +7,7 @@ libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) -libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/disk.c b/sysdeps/stub_suid/disk.c new file mode 100644 index 00000000..ed5cda02 --- /dev/null +++ b/sysdeps/stub_suid/disk.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_p (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_p (glibtop *server, glibtop_disk *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_DISK, 0); + + memset (buf, 0, sizeof (glibtop_disk)); +} From e9da95977365731a8f921f2d23b943036bf8f3d5 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Fri, 29 May 2020 13:42:48 +0800 Subject: [PATCH 017/102] Updated config and added reference --- configure.ac | 6 +-- doc/main.texi | 1 + doc/reference.texi | 59 +++++++++++++++++++++++++++++- doc/reference/libgtop-sections.txt | 22 ++--------- include/glibtop/disk.h | 18 ++++----- sysdeps/linux/disk.c | 31 +++++----------- 6 files changed, 84 insertions(+), 53 deletions(-) diff --git a/configure.ac b/configure.ac index 5426daf1..cc1d041f 100644 --- a/configure.ac +++ b/configure.ac @@ -8,16 +8,16 @@ m4_define([libgtop_micro_version], [0]) m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) dnl increment if the interface has additions, changes, removals. -m4_define([libgtop_current], [11]) +m4_define([libgtop_current], [12]) dnl increment any time the source changes; set to dnl 0 if you increment CURRENT -m4_define([libgtop_revision], [1]) +m4_define([libgtop_revision], [0]) dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. -m4_define([libgtop_age], [0]) +m4_define([libgtop_age], [1]) # Increase each time you change the client/server protocol. m4_define([libgtop_server_version], [5]) diff --git a/doc/main.texi b/doc/main.texi index 6945d651..f6a1ddde 100644 --- a/doc/main.texi +++ b/doc/main.texi @@ -49,6 +49,7 @@ System Dependent Functions * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. +* glibtop_disk:: DISK Usage. Common Functions diff --git a/doc/reference.texi b/doc/reference.texi index cdba6887..55970001 100644 --- a/doc/reference.texi +++ b/doc/reference.texi @@ -28,6 +28,7 @@ * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. +* glibtop_disk:: DISK Usage. @end menu @node glibtop_cpu, glibtop_mem, System Dependent, System Dependent @@ -1343,7 +1344,7 @@ enum @{ @end example @page -@node glibtop_ppp, , glibtop_netload, System Dependent +@node glibtop_ppp, glibtop_disk, glibtop_netload, System Dependent @subsection PPP Statistics Library function @code{glibtop_get_ppp}: @@ -1403,6 +1404,62 @@ We're currently offline. We're currently online. @end table +@page +@node glibtop_disk, , glibtop_ppp, System Dependent +@subsection DISK Usage + +Library function @code{glibtop_get_disk}: + +@example +@cartouche +void glibtop_get_disk (glibtop_disk *buf); +void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_disk} in @file{}: + +@example +@cartouche +typedef struct _glibtop_disk glibtop_disk; + +struct _glibtop_disk +@{ + xdisk_sectors_read [GLIBTOP_NDISK], + xdisk_time_read [GLIBTOP_NDISK], + xdisk_sectors_write [GLIBTOP_NDISK], + xdisk_time_write [GLIBTOP_NDISK], +@}; +@end cartouche +@end example + +All DISK reads and writes are measured by @dfn{sectors} which are normally 512 bytes each. +All disk time are measured in milliseconds which is 1/1000th of a second. + +@table @code +@item xdisk_sectors_read +Number of sectors read since system boot. + +@item xdisk_time_read +Number of milliseconds spent reading since system boot. + +@item xdisk_sectors_write +Number of sectors written since system boot. + +@item xdisk_time_write +Number of milliseconds spent writing since system boot. + +@end table + +The @samp{xdisk_} are values from arrays of @code{GLIBTOP_NDISK} (defined in +@file{}) elements and contain one value for each DISK +in the system. + +Please note that all of the disk values are absolute values measured in +certain units since system boot. To get bandwidth values (bytes/s), you need to call @code{glibtop_disk}, save the +result, wait some time and then call it again and divide the differences of +the two values by the time spent reading or writing. + @page @node Common Functions, Library Functions, System Dependent, Reference Manual @section Common Functions diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index 3d6d710d..63137481 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -682,24 +682,10 @@ glibtop_get_cpu_s glibtop/disk.h
disk -GLIBTOP_DISK_TOTAL -GLIBTOP_DISK_USER -GLIBTOP_DISK_NICE -GLIBTOP_DISK_SYS -GLIBTOP_DISK_IDLE -GLIBTOP_DISK_FREQUENCY -GLIBTOP_XDISK_TOTAL -GLIBTOP_XDISK_USER -GLIBTOP_XDISK_NICE -GLIBTOP_XDISK_SYS -GLIBTOP_XDISK_IDLE -GLIBTOP_XDISK_FLAGS -GLIBTOP_DISK_IOWAIT -GLIBTOP_DISK_IRQ -GLIBTOP_DISK_SOFTIRQ -GLIBTOP_XDISK_IOWAIT -GLIBTOP_XDISK_IRQ -GLIBTOP_XDISK_SOFTIRQ +LIBTOP_XDISK_SECTORS_READ +GLIBTOP_XDISK_TIME_READ +GLIBTOP_XDISK_SECTORS_WRITE +GLIBTOP_XDISK_TIME_WRITE GLIBTOP_MAX_DISK GLIBTOP_NDISK glibtop_disk diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index 292924f6..e444d819 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -28,17 +28,17 @@ G_BEGIN_DECLS #define GLIBTOP_XDISK_SECTORS_READ 0 -#define GLIBTOP_XDISK_TIME_READ 1 +#define GLIBTOP_XDISK_TIME_READ 1 #define GLIBTOP_XDISK_SECTORS_WRITE 2 #define GLIBTOP_XDISK_TIME_WRITE 3 -#define GLIBTOP_MAX_DISK 4 +#define GLIBTOP_MAX_DISK 4 /* Nobody should really be using more than 4 disk. Yes we are :) Nobody should really be using more than 32 disk. */ -#define GLIBTOP_NDISK 1024 +#define GLIBTOP_NDISK 1024 typedef struct _glibtop_disk glibtop_disk; @@ -54,12 +54,12 @@ typedef struct _partition_info partition_info; struct _glibtop_disk { - guint64 flags; - guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ - guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ - guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ - guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ - guint64 xdisk_flags; + guint64 flags; /* NOT USED YET */ + guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ + guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ + guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ + guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ + guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index c2d341f6..dbd46dff 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -51,7 +51,7 @@ void find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; - char name[256]="",type[256]=""; + char name[256]="", type[256]=""; primary_part->max = 0; @@ -92,18 +92,12 @@ find_primary_part (partition_info *primary_part, const char *m) n--; } - else if ((strcmp (type, "lvm") == 0)) { + else if ((strcmp (type, "lvm") == 0) || (strncmp (type, "raid", 4) == 0)) { tlvl = 2; primary_part->max++; } - else if ((strncmp (type, "raid", 4) == 0)) { - - tlvl = 2; - primary_part->max++; - - } } else if( tlvl == 2){ @@ -115,23 +109,14 @@ find_primary_part (partition_info *primary_part, const char *m) primary_part->max++; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0) || + (strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { n--; } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { - - n--; - - } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { - - n--; - tlvl = 1; - - } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0) || + (strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { n--; tlvl = 1; @@ -171,6 +156,7 @@ find_primary_part (partition_info *primary_part, const char *m) tlvl = 1; } + } @@ -195,11 +181,12 @@ is_virtual_drive (partition_info *primary_part, const char *p) int i; char name[256]; int test = 1; + sscanf (p, "%s", name); if (*p) { - for (i=0; imax; i++) { + for (i=0; i < primary_part->max; i++) { if (strcmp (primary_part[i].name, name) == 0) { From 2229253e11ae5c729a703f0c72e006f46746c592 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 6 Nov 2020 09:51:58 -0600 Subject: [PATCH 018/102] Revert "Updated config and added reference" This reverts commit e9da95977365731a8f921f2d23b943036bf8f3d5. --- configure.ac | 6 +-- doc/main.texi | 1 - doc/reference.texi | 59 +----------------------------- doc/reference/libgtop-sections.txt | 22 +++++++++-- include/glibtop/disk.h | 18 ++++----- sysdeps/linux/disk.c | 31 +++++++++++----- 6 files changed, 53 insertions(+), 84 deletions(-) diff --git a/configure.ac b/configure.ac index cc1d041f..5426daf1 100644 --- a/configure.ac +++ b/configure.ac @@ -8,16 +8,16 @@ m4_define([libgtop_micro_version], [0]) m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) dnl increment if the interface has additions, changes, removals. -m4_define([libgtop_current], [12]) +m4_define([libgtop_current], [11]) dnl increment any time the source changes; set to dnl 0 if you increment CURRENT -m4_define([libgtop_revision], [0]) +m4_define([libgtop_revision], [1]) dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. -m4_define([libgtop_age], [1]) +m4_define([libgtop_age], [0]) # Increase each time you change the client/server protocol. m4_define([libgtop_server_version], [5]) diff --git a/doc/main.texi b/doc/main.texi index f6a1ddde..6945d651 100644 --- a/doc/main.texi +++ b/doc/main.texi @@ -49,7 +49,6 @@ System Dependent Functions * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. -* glibtop_disk:: DISK Usage. Common Functions diff --git a/doc/reference.texi b/doc/reference.texi index 55970001..cdba6887 100644 --- a/doc/reference.texi +++ b/doc/reference.texi @@ -28,7 +28,6 @@ * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. -* glibtop_disk:: DISK Usage. @end menu @node glibtop_cpu, glibtop_mem, System Dependent, System Dependent @@ -1344,7 +1343,7 @@ enum @{ @end example @page -@node glibtop_ppp, glibtop_disk, glibtop_netload, System Dependent +@node glibtop_ppp, , glibtop_netload, System Dependent @subsection PPP Statistics Library function @code{glibtop_get_ppp}: @@ -1404,62 +1403,6 @@ We're currently offline. We're currently online. @end table -@page -@node glibtop_disk, , glibtop_ppp, System Dependent -@subsection DISK Usage - -Library function @code{glibtop_get_disk}: - -@example -@cartouche -void glibtop_get_disk (glibtop_disk *buf); -void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); -@end cartouche -@end example - -Declaration of @code{glibtop_disk} in @file{}: - -@example -@cartouche -typedef struct _glibtop_disk glibtop_disk; - -struct _glibtop_disk -@{ - xdisk_sectors_read [GLIBTOP_NDISK], - xdisk_time_read [GLIBTOP_NDISK], - xdisk_sectors_write [GLIBTOP_NDISK], - xdisk_time_write [GLIBTOP_NDISK], -@}; -@end cartouche -@end example - -All DISK reads and writes are measured by @dfn{sectors} which are normally 512 bytes each. -All disk time are measured in milliseconds which is 1/1000th of a second. - -@table @code -@item xdisk_sectors_read -Number of sectors read since system boot. - -@item xdisk_time_read -Number of milliseconds spent reading since system boot. - -@item xdisk_sectors_write -Number of sectors written since system boot. - -@item xdisk_time_write -Number of milliseconds spent writing since system boot. - -@end table - -The @samp{xdisk_} are values from arrays of @code{GLIBTOP_NDISK} (defined in -@file{}) elements and contain one value for each DISK -in the system. - -Please note that all of the disk values are absolute values measured in -certain units since system boot. To get bandwidth values (bytes/s), you need to call @code{glibtop_disk}, save the -result, wait some time and then call it again and divide the differences of -the two values by the time spent reading or writing. - @page @node Common Functions, Library Functions, System Dependent, Reference Manual @section Common Functions diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index 63137481..3d6d710d 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -682,10 +682,24 @@ glibtop_get_cpu_s glibtop/disk.h
disk -LIBTOP_XDISK_SECTORS_READ -GLIBTOP_XDISK_TIME_READ -GLIBTOP_XDISK_SECTORS_WRITE -GLIBTOP_XDISK_TIME_WRITE +GLIBTOP_DISK_TOTAL +GLIBTOP_DISK_USER +GLIBTOP_DISK_NICE +GLIBTOP_DISK_SYS +GLIBTOP_DISK_IDLE +GLIBTOP_DISK_FREQUENCY +GLIBTOP_XDISK_TOTAL +GLIBTOP_XDISK_USER +GLIBTOP_XDISK_NICE +GLIBTOP_XDISK_SYS +GLIBTOP_XDISK_IDLE +GLIBTOP_XDISK_FLAGS +GLIBTOP_DISK_IOWAIT +GLIBTOP_DISK_IRQ +GLIBTOP_DISK_SOFTIRQ +GLIBTOP_XDISK_IOWAIT +GLIBTOP_XDISK_IRQ +GLIBTOP_XDISK_SOFTIRQ GLIBTOP_MAX_DISK GLIBTOP_NDISK glibtop_disk diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index e444d819..292924f6 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -28,17 +28,17 @@ G_BEGIN_DECLS #define GLIBTOP_XDISK_SECTORS_READ 0 -#define GLIBTOP_XDISK_TIME_READ 1 +#define GLIBTOP_XDISK_TIME_READ 1 #define GLIBTOP_XDISK_SECTORS_WRITE 2 #define GLIBTOP_XDISK_TIME_WRITE 3 -#define GLIBTOP_MAX_DISK 4 +#define GLIBTOP_MAX_DISK 4 /* Nobody should really be using more than 4 disk. Yes we are :) Nobody should really be using more than 32 disk. */ -#define GLIBTOP_NDISK 1024 +#define GLIBTOP_NDISK 1024 typedef struct _glibtop_disk glibtop_disk; @@ -54,12 +54,12 @@ typedef struct _partition_info partition_info; struct _glibtop_disk { - guint64 flags; /* NOT USED YET */ - guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ - guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ - guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ - guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ - guint64 xdisk_flags; + guint64 flags; + guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ + guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ + guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ + guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ + guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index dbd46dff..c2d341f6 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -51,7 +51,7 @@ void find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; - char name[256]="", type[256]=""; + char name[256]="",type[256]=""; primary_part->max = 0; @@ -92,12 +92,18 @@ find_primary_part (partition_info *primary_part, const char *m) n--; } - else if ((strcmp (type, "lvm") == 0) || (strncmp (type, "raid", 4) == 0)) { + else if ((strcmp (type, "lvm") == 0)) { tlvl = 2; primary_part->max++; } + else if ((strncmp (type, "raid", 4) == 0)) { + + tlvl = 2; + primary_part->max++; + + } } else if( tlvl == 2){ @@ -109,14 +115,23 @@ find_primary_part (partition_info *primary_part, const char *m) primary_part->max++; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0) || - (strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { n--; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0) || - (strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { + + n--; + + } + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { n--; tlvl = 1; @@ -156,7 +171,6 @@ find_primary_part (partition_info *primary_part, const char *m) tlvl = 1; } - } @@ -181,12 +195,11 @@ is_virtual_drive (partition_info *primary_part, const char *p) int i; char name[256]; int test = 1; - sscanf (p, "%s", name); if (*p) { - for (i=0; i < primary_part->max; i++) { + for (i=0; imax; i++) { if (strcmp (primary_part[i].name, name) == 0) { From ea08151ae6582a438db76b738293a0194c964b88 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 6 Nov 2020 09:52:00 -0600 Subject: [PATCH 019/102] Revert "Code clean up and add example" This reverts commit 7396970afe2290488fd072612a650353dd13a16d. --- autogen.sh | 28 ------------- configure.ac | 10 ----- doc/reference/libgtop-sections.txt | 34 ---------------- examples/Makefile.am | 3 -- examples/disk.c | 65 ------------------------------ features.def | 1 - include/glibtop/Makefile.am | 2 +- include/glibtop/command.h | 3 +- include/glibtop/disk.h | 6 +-- include/glibtop/union.h | 2 +- lib/sysdeps.c | 3 -- libgtop-2.0.pc.in | 2 +- libgtop.spec.in | 1 - src/daemon/main.c | 2 +- src/daemon/slave.c | 6 --- sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 33 +++++---------- sysdeps/linux/glibtop_private.h | 2 +- sysdeps/stub/Makefile.am | 2 +- sysdeps/stub_suid/Makefile.am | 2 +- sysdeps/stub_suid/disk.c | 47 --------------------- 21 files changed, 20 insertions(+), 238 deletions(-) delete mode 100644 examples/disk.c delete mode 100644 sysdeps/stub_suid/disk.c diff --git a/autogen.sh b/autogen.sh index ab75b974..9d394bff 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,33 +1,5 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. -RED='\033[0;31m' -NC='\033[0m' # No Color - -case "$(uname -s)" in - Linux) - if ! [ -x "$(command -v lsblk)" ]; then - echo '' >&2 - echo -e "${RED}*** ERROR:${NC} lsblk cannot be found. Try installing util-linux or util-linux-ng ${RED}***${NC}" >&2 - echo '' >&2 - exit 1 - fi - if ! [ -x "$(command -v sed)" ]; then - echo '' >&2 - echo -e "${RED}*** ERROR:${NC} sed cannot be found. ***" >&2 - echo '' >&2 - exit 1 - fi - if ! [ -x "$(command -v tr)" ]; then - echo '' >&2 - echo -e "${RED}*** ERROR:${NC} tr cannot be found. ***" >&2 - echo '' >&2 - exit 1 - fi - ;; - *) - ;; -esac - test -n "$srcdir" || srcdir=$(dirname "$0") test -n "$srcdir" || srcdir=. diff --git a/configure.ac b/configure.ac index 5426daf1..d7215bf0 100644 --- a/configure.ac +++ b/configure.ac @@ -71,16 +71,6 @@ dnl Most people should have a working perl interpreter on their system AC_CHECK_PROGS(PERL, perl5 perl) test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.]) -case "${host_os}" in - linux*) - AC_CHECK_TOOL(LSBLK,lsblk) - AC_CHECK_TOOL(SED,sed) - AC_CHECK_TOOL(TR,tr) - ;; - *) - ;; -esac - AC_CHECK_TOOL(CC,gcc) AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(AS,as) diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index 3d6d710d..ba878943 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -29,7 +29,6 @@ glibtop_close_p GLIBTOP_CMND_QUIT GLIBTOP_CMND_SYSDEPS GLIBTOP_CMND_CPU -GLIBTOP_CMND_DISK GLIBTOP_CMND_MEM GLIBTOP_CMND_SWAP GLIBTOP_CMND_UPTIME @@ -679,39 +678,6 @@ glibtop_init_cpu_s glibtop_get_cpu_s
-glibtop/disk.h -
-disk -GLIBTOP_DISK_TOTAL -GLIBTOP_DISK_USER -GLIBTOP_DISK_NICE -GLIBTOP_DISK_SYS -GLIBTOP_DISK_IDLE -GLIBTOP_DISK_FREQUENCY -GLIBTOP_XDISK_TOTAL -GLIBTOP_XDISK_USER -GLIBTOP_XDISK_NICE -GLIBTOP_XDISK_SYS -GLIBTOP_XDISK_IDLE -GLIBTOP_XDISK_FLAGS -GLIBTOP_DISK_IOWAIT -GLIBTOP_DISK_IRQ -GLIBTOP_DISK_SOFTIRQ -GLIBTOP_XDISK_IOWAIT -GLIBTOP_XDISK_IRQ -GLIBTOP_XDISK_SOFTIRQ -GLIBTOP_MAX_DISK -GLIBTOP_NDISK -glibtop_disk -glibtop_get_disk -glibtop_get_disk_r -glibtop_get_disk_l -glibtop_init_disk_p -glibtop_get_disk_p -glibtop_init_disk_s -glibtop_get_disk_s -
- glibtop/swap.h
swap diff --git a/examples/Makefile.am b/examples/Makefile.am index ef192787..25585e04 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -34,9 +34,6 @@ mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la smp_SOURCES = smp.c smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm -disk_SOURCES = disk.c -disk_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm - timings_SOURCES = timings.c timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/examples/disk.c b/examples/disk.c deleted file mode 100644 index c3c61142..00000000 --- a/examples/disk.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by James Dominic P. Guana , May 2020. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include -#include -#include -#include - -#include -#include - -int -main (int argc, char *argv []) -{ - glibtop_disk disk; - char separator [BUFSIZ]; - int ndisk, i; - - glibtop_init(); - - glibtop_get_disk (&disk); - - ndisk = glibtop_global_server->ndisk ? glibtop_global_server->ndisk : 1; - - memset (separator, '-', 91); - separator [92] = '\0'; - - printf("\n\n"); - printf ("ELAPSE "); - printf ("Read Time Read Write Time Write\n"); - printf ("%s\n", separator); - - for (i = 0; i < ndisk; i++) { - printf ("DISK %3d : %12lu %12lu %12lu %12lu\n", i, - (unsigned long) disk.xdisk_sectors_read [i], - (unsigned long) disk.xdisk_time_read [i], - (unsigned long) disk.xdisk_sectors_write [i], - (unsigned long) disk.xdisk_time_write [i]); - - } - - printf ("%s\n\n\n", separator); - - exit (0); -} diff --git a/features.def b/features.def index 50cbe72a..faab87b1 100644 --- a/features.def +++ b/features.def @@ -1,5 +1,4 @@ void|cpu -void|disk void|mem void|swap void|uptime diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index da78ca93..6d0e055f 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -2,7 +2,7 @@ glibtopdir = $(includedir)/libgtop-2.0/glibtop glibtop_HEADERS = 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 disk.h msg_limits.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 \ diff --git a/include/glibtop/command.h b/include/glibtop/command.h index 31e89589..9a0e47b1 100644 --- a/include/glibtop/command.h +++ b/include/glibtop/command.h @@ -60,9 +60,8 @@ G_BEGIN_DECLS #define GLIBTOP_CMND_PROC_WD 26 #define GLIBTOP_CMND_PROC_AFFINITY 27 #define GLIBTOP_CMND_PROC_IO 28 -#define GLIBTOP_CMND_DISK 29 -#define GLIBTOP_MAX_CMND 30 +#define GLIBTOP_MAX_CMND 29 #define _GLIBTOP_PARAM_SIZE 16 diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index 292924f6..cdde7796 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -46,20 +46,16 @@ struct _partition_info { char name[256]; char type[256]; - char raid_num[256]; + char raid_num[256]; int max; }; -typedef struct _partition_info partition_info; - struct _glibtop_disk { - guint64 flags; guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ - guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/include/glibtop/union.h b/include/glibtop/union.h index eb57cfc0..bda7c576 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -61,7 +61,7 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; - glibtop_disk disk; + glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/sysdeps.c b/lib/sysdeps.c index beb950e8..96292568 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -139,9 +139,6 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif -#if GLIBTOP_SUID_DISK - _glibtop_init_disk_p, -#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/libgtop-2.0.pc.in b/libgtop-2.0.pc.in index 4381ab20..e1753322 100644 --- a/libgtop-2.0.pc.in +++ b/libgtop-2.0.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: libgtop Description: Portable System Access Library -Requires: glib-2.0, util-linux +Requires: glib-2.0 Version: @VERSION@ Libs: -L${libdir} -lgtop-2.0 Cflags: -I${includedir}/libgtop-2.0 diff --git a/libgtop.spec.in b/libgtop.spec.in index f4fefa5b..5957868e 100644 --- a/libgtop.spec.in +++ b/libgtop.spec.in @@ -5,7 +5,6 @@ %define prefix /usr Summary: LibGTop library -Requires: util-linux, sed Name: libgtop Version: %ver Release: %rel diff --git a/src/daemon/main.c b/src/daemon/main.c index 88e19a09..34cbaf50 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -98,7 +98,7 @@ handle_parent_connection (int s) do_output (s, resp, _offset_data (cpu), 0, NULL); break; case GLIBTOP_CMND_DISK: - glibtop_get_disk_l (server, &resp->u.data.disk); + glibtop_get_disk_l (server, &resp->u.disk.cpu); do_output (s, resp, _offset_data (disk), 0, NULL); break; case GLIBTOP_CMND_MEM: diff --git a/src/daemon/slave.c b/src/daemon/slave.c index 6e80b2b8..e15f1efc 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -135,12 +135,6 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, resp->offset = _offset_data (cpu); break; #endif -#if GLIBTOP_SUID_DISK - case GLIBTOP_CMND_DISK: - glibtop_get_disk_p (server, &resp->u.data.disk); - resp->offset = _offset_data (disk); - break; -#endif #if GLIBTOP_SUID_MEM case GLIBTOP_CMND_MEM: glibtop_get_mem_p (server, &resp->u.data.mem); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index ff6c3ecd..653a4f5a 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_disk (glibtop_disk *buf) +glibtop_get_cpu (glibtop_cpu *buf) { - glibtop_get_disk_l (glibtop_global_server, buf); + glibtop_get_cpu_l (glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index c2d341f6..3ad74bcc 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -48,7 +48,7 @@ _glibtop_init_disk_s (glibtop *server) // Handle LVM and RAID // void -find_primary_part (partition_info *primary_part, const char *m) +find_primary_part (_partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; char name[256]="",type[256]=""; @@ -190,7 +190,7 @@ find_primary_part (partition_info *primary_part, const char *m) } int -is_virtual_drive (partition_info *primary_part, const char *p) +is_virtual_drive (_partition_info *primary_part, const char *p) { int i; char name[256]; @@ -220,27 +220,10 @@ is_virtual_drive (partition_info *primary_part, const char *p) return test; } -int -max_lines (const char *p) -{ - char temp[10]; - int count = 0; - - while (sscanf (p, "%s", temp) == 1) - { - - p = skip_line(p); - count++; - - } - - return count; -} - void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - partition_info primary_part[GLIBTOP_NDISK]; + _partition_info primary_part[GLIBTOP_NDISK]; char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; int i; @@ -250,6 +233,8 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) get_from_pipe (map_buffer, CMD_PIPE); + server->ndisk = GLIBTOP_NDISK; + /* * GLOBAL */ @@ -261,23 +246,23 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) * PER DISK */ - server->ndisk = max_lines(p); - find_primary_part (primary_part, m); - for (i = 0; i < server->ndisk; i++) { + for (i = 0; i <= server->ndisk; i++) { p = skip_multiple_token (p,2); // skip if disk is the raw device if (!is_virtual_drive (primary_part, p)) { - server->ndisk--; p = skip_line (p); /* move to ^ */ p = skip_multiple_token (p, 2); } + if (!check_disk_line_warn (server, p, i)) + break; + p = skip_token (p); /* prev xdisk_name */ p = skip_token (p); /* prev xdisk_reads_completed */ p = skip_token (p); /* prev xdisk_reads_merged */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 39101163..66fed54c 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -62,7 +62,7 @@ skip_line (const char *p) } void -get_from_pipe (char *buffer, const char *cmd); +get_from_pipe (char *buffer, const char *cmd) /* * Smart strtoul which handles binary suffixes diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am index 6d9ce727..f4219edb 100644 --- a/sysdeps/stub/Makefile.am +++ b/sysdeps/stub/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am index 3f1bf958..fcc7daf9 100644 --- a/sysdeps/stub_suid/Makefile.am +++ b/sysdeps/stub_suid/Makefile.am @@ -7,7 +7,7 @@ libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) -libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/disk.c b/sysdeps/stub_suid/disk.c deleted file mode 100644 index ed5cda02..00000000 --- a/sysdeps/stub_suid/disk.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig , April 1998. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include -#include - -#include - -static const unsigned long _glibtop_sysdeps_disk = 0; - -/* Init function. */ - -void -_glibtop_init_disk_p (glibtop *server) -{ - server->sysdeps.disk = _glibtop_sysdeps_disk; -} - -/* Provides information about disk usage. */ - -void -glibtop_get_disk_p (glibtop *server, glibtop_disk *buf) -{ - glibtop_init_p (server, GLIBTOP_SYSDEPS_DISK, 0); - - memset (buf, 0, sizeof (glibtop_disk)); -} From 30bf8d04183c26ca48c6cd4efe4c24058a082783 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 6 Nov 2020 09:52:00 -0600 Subject: [PATCH 020/102] Revert "Handle LVM and RAID" This reverts commit 9cbb3b91f11ad0c4944a1428d609201c054cffab. --- glibtop.h | 2 +- include/glibtop/disk.h | 10 +- sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 218 +++----------------------------- sysdeps/linux/glibtop_private.c | 27 ++-- sysdeps/linux/glibtop_private.h | 4 +- 6 files changed, 36 insertions(+), 229 deletions(-) diff --git a/glibtop.h b/glibtop.h index c196818c..804294da 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,7 +80,7 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk */ + int ndisk; /* Number of DISKs, zero if single-disk */ int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index cdde7796..8843112c 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -42,14 +42,6 @@ G_BEGIN_DECLS typedef struct _glibtop_disk glibtop_disk; -struct _partition_info -{ - char name[256]; - char type[256]; - char raid_num[256]; - int max; -}; - struct _glibtop_disk { guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ @@ -58,7 +50,7 @@ struct _glibtop_disk guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ }; -void glibtop_get_disk (glibtop_disk *buf); +void glibtop_get_disk(glibtop_disk *buf); #if GLIBTOP_SUID_DISK #define glibtop_get_disk_r glibtop_get_disk_p diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index 653a4f5a..c20f2938 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_cpu (glibtop_cpu *buf) +glibtop_get_cpu(glibtop_cpu *buf) { - glibtop_get_cpu_l (glibtop_global_server, buf); + glibtop_get_cpu_l(glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 3ad74bcc..159f8f12 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -39,244 +39,58 @@ _glibtop_init_disk_s (glibtop *server) /* Provides information about disk usage. */ -// Linux kernel reports sectors by 512 bytes even for AF 4kn // - -#define FILENAME "/proc/diskstats" -#define CMD_PIPE "lsblk --output NAME,TYPE -i -n | sed 's/`-//'|sed 's/|-//'|sed 's/|//'| sed -e 's/^[ \t]*//'|tr -s ' '" +#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn #define STAT_BUFSIZ 81920 -// Handle LVM and RAID // - -void -find_primary_part (_partition_info *primary_part, const char *m) -{ - int n = 0, tlvl = 0; - char name[256]="",type[256]=""; - - primary_part->max = 0; - - //scan by tree level - //0 = disk (to lvl 0) - //0 = disk, 1 = part (to lvl 1) - //0 = disk, 1 = part, 2 = lvm or raid (to lvl 2) - //0 = disk, 1 = part, 2 = raid, 3 = lvm (to lvl 3) - - while (sscanf(m, "%s %s", name, type) == 2) - { - - if (tlvl == 0) { - - if (strcmp (type, "disk") == 0) { - - primary_part->max++; - - } - else if ((strcmp (type, "part") == 0)){ - - tlvl = 1; - - } - - } - else if(tlvl == 1){ - - if (strcmp (type, "disk") == 0) { - - n--; - tlvl = 0; - primary_part->max++; - - } - else if ((strcmp (type, "part") == 0)) { - - n--; - - } - else if ((strcmp (type, "lvm") == 0)) { - - tlvl = 2; - primary_part->max++; - - } - else if ((strncmp (type, "raid", 4) == 0)) { - - tlvl = 2; - primary_part->max++; - - } - - } - else if( tlvl == 2){ - - if (strcmp(type, "disk") == 0) { - - n--; - tlvl = 0; - primary_part->max++; - - } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { - - n--; - - } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { - - n--; - - } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { - - n--; - tlvl = 1; - - } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { - - n--; - tlvl = 1; - - } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "lvm") == 0)){ - - tlvl = 3; - primary_part->max++; - - } - - } - else if (tlvl == 3) { - - if (strcmp (type, "disk") == 0) { - - n--; - tlvl = 0; - primary_part->max++; - - } - else if ((strcmp (type, "lvm") == 0)) { - - n--; - - } - else if ((strncmp (type, "raid", 4) == 0)) { - - n--; - tlvl = 2; - - } - else if ((strcmp (type, "part") == 0)) { - - n--; - tlvl = 1; - - } - } - - - strcpy (primary_part[n].name, name); - strncpy (primary_part[n].type, type, 4); - - if (strcmp (primary_part[n].type, "raid") == 0) { - - strcpy (primary_part[n].raid_num, type + 4); - - } - - m = skip_line (m); - n++; - - } -} - -int -is_virtual_drive (_partition_info *primary_part, const char *p) -{ - int i; - char name[256]; - int test = 1; - sscanf (p, "%s", name); - - if (*p) { - - for (i=0; imax; i++) { - - if (strcmp (primary_part[i].name, name) == 0) { - - test = 0; - break; - - } - - } - - } - else { - - test = 0; - - } - - return test; -} - void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - _partition_info primary_part[GLIBTOP_NDISK]; - char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; + char buffer [STAT_BUFSIZ], *p; int i; memset (buf, 0, sizeof (glibtop_disk)); - file_to_buffer (server, buffer, sizeof buffer, FILENAME); - - get_from_pipe (map_buffer, CMD_PIPE); - - server->ndisk = GLIBTOP_NDISK; + file_to_buffer(server, buffer, sizeof buffer, FILENAME); /* * GLOBAL */ p = buffer; /* "disk" */ - m = map_buffer; /* * PER DISK */ - find_primary_part (primary_part, m); - for (i = 0; i <= server->ndisk; i++) { - p = skip_multiple_token (p,2); + p = skip_multiple_token(p,2); - // skip if disk is the raw device - if (!is_virtual_drive (primary_part, p)) { + // skip if disk is the raw device + if(!check_alphanumeric_word(p)){ - p = skip_line (p); /* move to ^ */ - p = skip_multiple_token (p, 2); + p = skip_line(p); /* move to ^ */ + p = skip_multiple_token(p,2); - } + } - if (!check_disk_line_warn (server, p, i)) + if (!check_disk_line_warn(server, p, i)) break; - p = skip_token (p); /* prev xdisk_name */ - p = skip_token (p); /* prev xdisk_reads_completed */ - p = skip_token (p); /* prev xdisk_reads_merged */ + p = skip_token(p); /* prev xdisk_name */ + p = skip_token(p); /* prev xdisk_reads_completed */ + p = skip_token(p); /* prev xdisk_reads_merged */ buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); buf->xdisk_time_read [i] = strtoull (p, &p, 0); - p = skip_token (p); /* prev xdisk_writes_completed */ - p = skip_token (p); /* prev xdisk_writes_merged */ + p = skip_token(p); /* prev xdisk_writes_completed */ + p = skip_token(p); /* prev xdisk_writes_merged */ buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); buf->xdisk_time_write [i] = strtoull (p, &p, 0); - p = skip_line (p); /* move to ^ */ + p = skip_line(p); /* move to ^ */ } } diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index 7bca42a5..7b36561c 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,20 +57,21 @@ skip_token (const char *p) } -void -get_from_pipe (char *buffer, const char *cmd) +int +check_alphanumeric_word (const char *p) { - FILE* fp; - long psize; - - fp = popen (cmd, "r"); - - fseek (fp, 0, SEEK_END); - psize = ftell (fp); - fseek (fp, 0, SEEK_SET); - fread(buffer,1,psize,fp); - - pclose (fp); + int test = 0; + p = next_token(p); + while (*p && !g_ascii_isspace(*p)) { + if(g_ascii_isalpha(*p)){ + test = 0; + }else if(g_ascii_isdigit(*p)){ + test = 1; + } + p++; + }; + p = next_token(p); + return test; } diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 66fed54c..d42ee669 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,8 +61,8 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } -void -get_from_pipe (char *buffer, const char *cmd) +int +check_alphanumeric_word (const char *p); /* * Smart strtoul which handles binary suffixes From 7e214414bf23d1ea34e7fdccb17a7f41040ffea9 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 6 Nov 2020 09:52:01 -0600 Subject: [PATCH 021/102] Revert "New API to retrieve disk stats in Linux" This reverts commit 9e62440b314fbf87bbeca865a4223311314c52a3. --- glibtop.h | 2 - include/glibtop/disk.h | 74 ------------------------- include/glibtop/sysdeps.h | 4 +- include/glibtop/union.h | 2 - lib/Makefile.am | 2 +- lib/command.c | 1 - lib/libgtop.sym | 2 - lib/sysdeps.c | 4 -- src/daemon/main.c | 4 -- sysdeps/common/default.c | 14 ----- sysdeps/common/sysdeps_suid.c | 3 -- sysdeps/linux/Makefile.am | 2 +- sysdeps/linux/disk.c | 96 --------------------------------- sysdeps/linux/glibtop_private.c | 18 ------- sysdeps/linux/glibtop_private.h | 3 -- sysdeps/linux/glibtop_server.h | 1 - sysdeps/stub/disk.c | 42 --------------- sysdeps/stub/glibtop_server.h | 1 - 18 files changed, 3 insertions(+), 272 deletions(-) delete mode 100644 include/glibtop/disk.h delete mode 100644 sysdeps/linux/disk.c delete mode 100644 sysdeps/stub/disk.c diff --git a/glibtop.h b/glibtop.h index 804294da..3542249a 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,8 +80,6 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk */ - int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h deleted file mode 100644 index 8843112c..00000000 --- a/include/glibtop/disk.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by James Dominic P. Guana , May 2020. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __GLIBTOP_DISK_H__ -#define __GLIBTOP_DISK_H__ - -#include -#include - -G_BEGIN_DECLS - -#define GLIBTOP_XDISK_SECTORS_READ 0 -#define GLIBTOP_XDISK_TIME_READ 1 -#define GLIBTOP_XDISK_SECTORS_WRITE 2 -#define GLIBTOP_XDISK_TIME_WRITE 3 - -#define GLIBTOP_MAX_DISK 4 - -/* Nobody should really be using more than 4 disk. - Yes we are :) - Nobody should really be using more than 32 disk. -*/ -#define GLIBTOP_NDISK 1024 - -typedef struct _glibtop_disk glibtop_disk; - -struct _glibtop_disk -{ - guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ - guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ - guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ - guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ -}; - -void glibtop_get_disk(glibtop_disk *buf); - -#if GLIBTOP_SUID_DISK -#define glibtop_get_disk_r glibtop_get_disk_p -#else -#define glibtop_get_disk_r glibtop_get_disk_s -#endif - -void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); - -#if GLIBTOP_SUID_DISK -void _glibtop_init_disk_p (glibtop *server); -void glibtop_get_disk_p (glibtop *server, glibtop_disk *buf); -#else -void _glibtop_init_disk_s (glibtop *server); -void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf); -#endif - - -G_END_DECLS - -#endif diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h index a1db66d8..a18c69e6 100644 --- a/include/glibtop/sysdeps.h +++ b/include/glibtop/sysdeps.h @@ -54,9 +54,8 @@ G_BEGIN_DECLS #define GLIBTOP_SYSDEPS_PROC_WD 25 #define GLIBTOP_SYSDEPS_PROC_AFFINITY 26 #define GLIBTOP_SYSDEPS_PROC_IO 27 -#define GLIBTOP_SYSDEPS_DISK 28 -#define GLIBTOP_MAX_SYSDEPS 29 +#define GLIBTOP_MAX_SYSDEPS 28 /* The 'features' args to glibtop_init_* is an unsigned long */ G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX); @@ -70,7 +69,6 @@ struct _glibtop_sysdeps guint64 flags; guint64 features; /* server features */ guint64 cpu; /* glibtop_cpu */ - guint64 disk; /* glibtop_cpu */ guint64 mem; /* glibtop_mem */ guint64 swap; /* glibtop_swap */ guint64 uptime; /* glibtop_uptime */ diff --git a/include/glibtop/union.h b/include/glibtop/union.h index bda7c576..334f0217 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -23,7 +23,6 @@ #define __GLIBTOP_UNION_H__ #include -#include #include #include #include @@ -61,7 +60,6 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; - glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/Makefile.am b/lib/Makefile.am index 5a6f6511..90b82861 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -29,7 +29,7 @@ if HAVE_INTROSPECTION introspection_sources = $(libgtop_2_0_la_SOURCES) lib.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/disk.h ../include/glibtop/msg_limits.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 \ diff --git a/lib/command.c b/lib/command.c index cf2270e0..b6ccf1f2 100644 --- a/lib/command.c +++ b/lib/command.c @@ -43,7 +43,6 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size, CHECK_CMND(GLIBTOP_CMND_QUIT); CHECK_CMND(GLIBTOP_CMND_SYSDEPS); CHECK_CMND(GLIBTOP_CMND_CPU); - CHECK_CMND(GLIBTOP_CMND_DISK); CHECK_CMND(GLIBTOP_CMND_MEM); CHECK_CMND(GLIBTOP_CMND_SWAP); CHECK_CMND(GLIBTOP_CMND_UPTIME); diff --git a/lib/libgtop.sym b/lib/libgtop.sym index 60316a72..afa9d070 100644 --- a/lib/libgtop.sym +++ b/lib/libgtop.sym @@ -3,8 +3,6 @@ glibtop_close glibtop_close_r glibtop_get_cpu glibtop_get_cpu_l -glibtop_get_disk -glibtop_get_disk_l glibtop_get_fsusage glibtop_get_fsusage_l glibtop_get_loadavg diff --git a/lib/sysdeps.c b/lib/sysdeps.c index 96292568..2a761576 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -27,7 +27,6 @@ const unsigned long glibtop_server_features = GLIBTOP_SUID_CPU + -GLIBTOP_SUID_DISK + GLIBTOP_SUID_MEM + GLIBTOP_SUID_SWAP + GLIBTOP_SUID_UPTIME + @@ -57,9 +56,6 @@ const _glibtop_init_func_t _glibtop_init_hook_s [] = { #if !GLIBTOP_SUID_CPU _glibtop_init_cpu_s, #endif -#if !GLIBTOP_SUID_DISK - _glibtop_init_disk_s, -#endif #if !GLIBTOP_SUID_MEM _glibtop_init_mem_s, #endif diff --git a/src/daemon/main.c b/src/daemon/main.c index 34cbaf50..b51addf6 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -97,10 +97,6 @@ handle_parent_connection (int s) glibtop_get_cpu_l (server, &resp->u.data.cpu); do_output (s, resp, _offset_data (cpu), 0, NULL); break; - case GLIBTOP_CMND_DISK: - glibtop_get_disk_l (server, &resp->u.disk.cpu); - do_output (s, resp, _offset_data (disk), 0, NULL); - break; case GLIBTOP_CMND_MEM: glibtop_get_mem_l (server, &resp->u.data.mem); do_output (s, resp, _offset_data (mem), 0, NULL); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index c20f2938..e3b096f2 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -64,20 +64,6 @@ glibtop_get_cpu(glibtop_cpu *buf) } -/** - * glibtop_get_disk: - * @buf: A location to return the disk usage. - * - * Get the DISK usage. - * - */ -void -glibtop_get_cpu(glibtop_cpu *buf) -{ - glibtop_get_cpu_l(glibtop_global_server, buf); -} - - /** * glibtop_get_fsusage: * @buf: A location to return the file system usage. diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index ecb1d53e..24953176 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -30,9 +30,6 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif -#if GLIBTOP_SUID_DISK - _glibtop_init_disk_p, -#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index c51bb155..fdd54696 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c disk.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c deleted file mode 100644 index 159f8f12..00000000 --- a/sysdeps/linux/disk.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by James Dominic P. Guana , May 2020. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -#include "glibtop_private.h" - -static const unsigned long _glibtop_sysdeps_disk = -(1L << GLIBTOP_XDISK_SECTORS_READ) + (1L << GLIBTOP_XDISK_TIME_READ) + -(1L << GLIBTOP_XDISK_SECTORS_WRITE) + (1L << GLIBTOP_XDISK_TIME_WRITE); - -/* Init function. */ - -void -_glibtop_init_disk_s (glibtop *server) -{ - server->sysdeps.disk = _glibtop_sysdeps_disk; -} - -/* Provides information about disk usage. */ - -#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn -#define STAT_BUFSIZ 81920 - -void -glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) -{ - char buffer [STAT_BUFSIZ], *p; - int i; - - memset (buf, 0, sizeof (glibtop_disk)); - - file_to_buffer(server, buffer, sizeof buffer, FILENAME); - - /* - * GLOBAL - */ - - p = buffer; /* "disk" */ - - /* - * PER DISK - */ - - for (i = 0; i <= server->ndisk; i++) { - - p = skip_multiple_token(p,2); - - // skip if disk is the raw device - if(!check_alphanumeric_word(p)){ - - p = skip_line(p); /* move to ^ */ - p = skip_multiple_token(p,2); - - } - - if (!check_disk_line_warn(server, p, i)) - break; - - p = skip_token(p); /* prev xdisk_name */ - p = skip_token(p); /* prev xdisk_reads_completed */ - p = skip_token(p); /* prev xdisk_reads_merged */ - - buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); - buf->xdisk_time_read [i] = strtoull (p, &p, 0); - - p = skip_token(p); /* prev xdisk_writes_completed */ - p = skip_token(p); /* prev xdisk_writes_merged */ - - buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); - buf->xdisk_time_write [i] = strtoull (p, &p, 0); - - p = skip_line(p); /* move to ^ */ - - } -} diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index 7b36561c..d3a49aa6 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,24 +57,6 @@ skip_token (const char *p) } -int -check_alphanumeric_word (const char *p) -{ - int test = 0; - p = next_token(p); - while (*p && !g_ascii_isspace(*p)) { - if(g_ascii_isalpha(*p)){ - test = 0; - }else if(g_ascii_isdigit(*p)){ - test = 1; - } - p++; - }; - p = next_token(p); - return test; -} - - /* * Read functions */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index d42ee669..03761f4f 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,9 +61,6 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } -int -check_alphanumeric_word (const char *p); - /* * Smart strtoul which handles binary suffixes * e.g: get_scaled("Size: 32 kB", "Size:") == 32768 diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 43dd9d9f..6240d5de 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -23,7 +23,6 @@ #define __LINUX__GLIBTOP_SERVER_H__ #define GLIBTOP_SUID_CPU 0 -#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 diff --git a/sysdeps/stub/disk.c b/sysdeps/stub/disk.c deleted file mode 100644 index a946fdf5..00000000 --- a/sysdeps/stub/disk.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by James Dominic P. Guana , May 2020. - - LibGTop is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, - or (at your option) any later version. - - LibGTop is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with LibGTop; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -static const unsigned long _glibtop_sysdeps_disk = 0; - -/* Init function. */ - -void -_glibtop_init_disk_s (glibtop *server) -{ - server->sysdeps.disk = _glibtop_sysdeps_disk; -} - -/* Provides information about disk usage. */ - -void -glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) -{ - memset (buf, 0, sizeof (glibtop_disk)); -} diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server.h index 0f8bd194..1dd18bf0 100644 --- a/sysdeps/stub/glibtop_server.h +++ b/sysdeps/stub/glibtop_server.h @@ -25,7 +25,6 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU 0 -#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 From d94138f45d402f3536bf58cf2750278cd188af65 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Sat, 16 Jan 2021 14:24:55 +0100 Subject: [PATCH 022/102] Update Catalan translation --- po/ca.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/ca.po b/po/ca.po index de84dfe5..52a107fc 100644 --- a/po/ca.po +++ b/po/ca.po @@ -65,7 +65,7 @@ msgstr "Ha estat cridat des d'inetd" #, c-format msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Executeu «%s --help» per veure una llista completa de les opcions " +"Executeu «%s --help» per a veure una llista completa de les opcions " "disponibles de la línia d'ordres.\n" #: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 From 2a34650c28fb74b4b6705089ab83cee63c2b9964 Mon Sep 17 00:00:00 2001 From: A S Alam Date: Sun, 14 Feb 2021 02:42:05 +0000 Subject: [PATCH 023/102] Update Punjabi translation --- po/pa.po | 108 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 52 deletions(-) diff --git a/po/pa.po b/po/pa.po index f3457ad7..7f879b77 100644 --- a/po/pa.po +++ b/po/pa.po @@ -5,188 +5,192 @@ # # # Amanpreet Singh Alam , 2004. -# A S Alam , 2004, 2005, 2007, 2009. +# A S Alam , 2004, 2005, 2007, 2009, 2021. msgid "" msgstr "" "Project-Id-Version: libgtop.HEAD\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-07 14:35+0100\n" -"PO-Revision-Date: 2009-03-16 05:37+0000\n" -"Last-Translator: A S Alam \n" -"Language-Team: Punjabi/Panjabi \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2021-02-13 18:41-0800\n" +"Last-Translator: A S Alam \n" +"Language-Team: Punjabi \n" "Language: pa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 0.3\n" +"X-Generator: Lokalize 20.08.1\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "%d ਬਾਇਟ ਪੜ੍ਹੇ" msgstr[1] "%d ਬਾਈਟ ਪੜ੍ਹੇ" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "ਡਾਟਾ ਆਕਾਰ ਪੜ੍ਹੇ" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "%lu ਡਾਟਾ ਬਾਈਟ ਪੜ੍ਹੇ" msgstr[1] "%lu ਡਾਟਾ ਬਾਈਟ ਪੜ੍ਹੇ" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "%d ਬਾਈਟ ਲਿਖੇ" msgstr[1] "%d ਬਾਈਟ ਲਿਖੇ" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "ਡੀਬੱਗਇੰਗ ਚਾਲੂ ਕਰੋ" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "ਜਾਣਕਾਰੀ ਆਉਟਪੁੱਟ ਯੋਗ" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" -msgstr "ਬੈਕਗਰਾਊਂਡ 'ਚ ਫੋਰਕ" +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "ਬੈਕਗਰਾਊਂਡ 'ਚ ਫੋਰਕ ਨਾ ਕਰੋ" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "inetd ਤੋਂ ਸ਼ਾਮਿਲ ਹੈ" -#: ../src/daemon/gnuserv.c:498, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" -msgstr "ਪੂਰੀ ਕਮਾਂਡ ਚੋਣ ਲਿਸਟ ਵੇਖਣ ਲਈ '%s --help' ਚਲਾਉ।\n" +#: src/daemon/gnuserv.c:498 +#, c-format +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "ਪੂਰੀ ਕਮਾਂਡ ਚੋਣ ਲਿਸਟ ਵੇਖਣ ਲਈ “%s --help“ ਚਲਾਉ।\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "ਬੰਦ ਕਰੋ" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "ਰੁਕਾਵਟ" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "ਬਾਹਰ" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "ਗਲਤ ਹਦਾਇਤ" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "ਟਰੇਸ ਟਰੈਪ" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "ਅਧੂਰਾ ਛੱਡੋ" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "EMT ਗਲਤੀ" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "ਦਸ਼ਮਲਵ ਅਪਵਾਦ" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "ਖਤਮ" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "ਬਸ ਗਲਤੀ" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "ਸਿਗਮੈਂਟੇਸ਼ਨ ਉਲੰਘਣਾ" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "ਸਿਸਟਮ ਕਾਲ ਲਈ ਗਲਤ ਆਰਗੂਮੈਂਟ" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" -msgstr "ਟੁੱਟਿਆ ਪਾਇਪ" +msgstr "ਟੁੱਟਿਆ ਪਾਈਪ" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "ਆਲਰਮ ਘੜੀ" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "ਸਮਾਪਤੀ" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "ਸਾਕਟ ਲਈ ਜਰੂਰੀ ਸ਼ਰਤ" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "ਰੋਕੋ" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "ਕੀ-ਬੋਰਡ ਰੁੱਕ ਗਿਆ ਹੈ" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "ਜਾਰੀ ਰਹੋ" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "ਚਲਾਇਡ ਹਾਲਤ ਤਬਦੀਲ ਹੋਈ" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "tty ਤੋਂ ਬੈਕਗਰਾਊਂਡ ਪੜ੍ਹੋ" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "tty ਲਈ ਬੈਕਗਰਾਊਂਡ ਲਿਖੋ" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "I/O ਹੁਣ ਸੰਭਵ" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "CPU ਸੀਮਾ ਟੱਪੀ" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "ਫਾਇਲ ਆਕਾਰ ਸੀਮਾ ਟੱਪੀ" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "ਵੁਰਚੁਅਲ ਅਲਾਰਮ ਘੜੀ" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "ਅਲਾਰਮ ਘੜੀ ਰਾਹੀਂ ਪ੍ਰੋਫਾਇਲਿੰਗ" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "ਵਿੰਡੋ ਅਕਾਰ ਬਦਲੋ" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "ਜਾਣਕਾਰੀ ਲਈ ਬੇਨਤੀ" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "ਯੂਜ਼ਰ ਪ੍ਰਭਾਸ਼ਿਤ ਸਿਗਨਲ1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "ਯੂਜ਼ਰ ਪ੍ਰਭਾਸ਼ਿਤ ਸਿਗਨਲ 2" From 8f179da4ee9c007beaf2324dbc4ebc3bba42c40e Mon Sep 17 00:00:00 2001 From: Fran Dieguez Date: Wed, 24 Feb 2021 00:10:02 +0000 Subject: [PATCH 024/102] Update Galician translation --- po/gl.po | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/po/gl.po b/po/gl.po index ac85d91b..06135aa7 100644 --- a/po/gl.po +++ b/po/gl.po @@ -15,12 +15,11 @@ msgid "" msgstr "" "Project-Id-Version: gl\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=libgto" -"p&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-04-07 11:26+0000\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" "PO-Revision-Date: 2017-08-12 12:25+0200\n" "Last-Translator: Fran Dieguez \n" -"Language-Team: Galician\n" +"Language-Team: Proxecto Trasno \n" "Language: gl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -63,7 +62,6 @@ msgid "Enable verbose output" msgstr "Activar a saída detallada" #: src/daemon/gnuserv.c:460 -#| msgid "Don't fork into background" msgid "Don’t fork into background" msgstr "Non facer fork nunha tarefa de fondo" @@ -73,8 +71,6 @@ msgstr "Invocado desde inetd" #: src/daemon/gnuserv.c:498 #, c-format -#| msgid "" -#| "Run '%s --help' to see a full list of available command line options.\n" msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" "Execute '%s --help' para ver a lista completa das opcións de liña de ordes " From 7eafc2301750a403d40ddda122779b9dc05da447 Mon Sep 17 00:00:00 2001 From: Charles Monzat Date: Sun, 14 Mar 2021 14:57:12 +0000 Subject: [PATCH 025/102] Update French translation --- po/fr.po | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/po/fr.po b/po/fr.po index fa8c4f0b..7e3da9c4 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,22 +7,22 @@ # Christophe Merlet , 2000-2004. # Benoit Dejean , 2004. # Stéphane Raimbault , 2007. -# Charles Monzat , 2018. +# Charles Monzat , 2018-2021. # msgid "" msgstr "" "Project-Id-Version: libgtop 2.9.91\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" -"POT-Creation-Date: 2018-01-25 10:19+0000\n" -"PO-Revision-Date: 2018-11-19 13:23+0100\n" -"Last-Translator: Charles Monzat \n" -"Language-Team: français \n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2021-03-11 10:22+0100\n" +"Last-Translator: Charles Monzat \n" +"Language-Team: GNOME French Team \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Gtranslator 3.30.0\n" +"X-Generator: Gtranslator 3.38.0\n" #: lib/read.c:49 #, c-format @@ -118,7 +118,7 @@ msgstr "Violation de segmentation" #: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" -msgstr "Mauvais argument d’appel système" +msgstr "Mauvais paramètre d’appel système" #: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" From 902317116698ca77a21c144fee610fa8f80568de Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Wed, 17 Mar 2021 00:50:06 +0100 Subject: [PATCH 026/102] Add gitlab-ci.yml file Start basic, with a single stage that builds for Fedora. --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..3d283784 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,18 @@ +stages: + - build + +build-fedora: + image: fedora:latest + stage: build + except: + - tags + before_script: + - dnf update -y --nogpgcheck + - dnf -y install --nogpgcheck + gawk gettext-devel glib2-devel gobject-introspection-devel gtk-doc perl + texinfo texinfo-tex + script: + - ./autogen.sh --disable-dependency-tracking + - make + - make install + - make distcheck From 489e090286ef9067fe8cc9a74d62541810d4ffeb Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 17 Mar 2021 20:59:27 +0000 Subject: [PATCH 027/102] Delete empty TODO file. --- TODO | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 TODO diff --git a/TODO b/TODO deleted file mode 100644 index e69de29b..00000000 From 32f8317d046bb9da6889e15f2ab4a5c99e5eb4ae Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 30 Mar 2021 11:23:14 +0200 Subject: [PATCH 028/102] ci: Split off dependency list --- .gitlab-ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d283784..a6cb0140 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,17 @@ stages: - build +variables: + FEDORA_DEPENDENCIES: + gawk + gettext-devel + glib2-devel + gobject-introspection-devel + gtk-doc + perl + texinfo + texinfo-tex + build-fedora: image: fedora:latest stage: build @@ -8,9 +19,7 @@ build-fedora: - tags before_script: - dnf update -y --nogpgcheck - - dnf -y install --nogpgcheck - gawk gettext-devel glib2-devel gobject-introspection-devel gtk-doc perl - texinfo texinfo-tex + - dnf -y install --nogpgcheck $FEDORA_DEPENDENCIES script: - ./autogen.sh --disable-dependency-tracking - make From 38b8e65e00fc32524736c31881d44193daf8e1e3 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 30 Mar 2021 11:23:46 +0200 Subject: [PATCH 029/102] ci: Use builddir != srcdir --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a6cb0140..60367ed7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,9 @@ build-fedora: - dnf update -y --nogpgcheck - dnf -y install --nogpgcheck $FEDORA_DEPENDENCIES script: - - ./autogen.sh --disable-dependency-tracking + - mkdir _build + - cd _build + - ../autogen.sh --disable-dependency-tracking - make - make install - make distcheck From cc042e18330f86bd01e63c3603d23aa4e74ccb92 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 30 Mar 2021 11:26:00 +0200 Subject: [PATCH 030/102] ci: Add ABI check --- .gitlab-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 60367ed7..5854e7f4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,6 +11,10 @@ variables: perl texinfo texinfo-tex + FEDORA_DEPENDENCIES_ABI_CHECK: + libabigail + intltool + LAST_ABI_BREAK: "abccaf488a929de1e95e6a748485575dec52c998" build-fedora: image: fedora:latest @@ -27,3 +31,7 @@ build-fedora: - make - make install - make distcheck + - cd .. + - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash + - dnf install -y $FEDORA_DEPENDENCIES_ABI_CHECK + - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) From 61093d22d9b42eb235e792931e9eb4e5f24fd602 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 11 Apr 2021 14:05:23 +0000 Subject: [PATCH 031/102] Add automated test build on ubuntu --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5854e7f4..f1eba76a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,18 @@ variables: libabigail intltool LAST_ABI_BREAK: "abccaf488a929de1e95e6a748485575dec52c998" + UBUNTU_DEPENDENCIES: + autoconf + automake + autopoint + gettext + glib2.0 + gtk-doc-tools + libgirepository1.0-dev + libtool + make + texinfo + texlive build-fedora: image: fedora:latest @@ -35,3 +47,19 @@ build-fedora: - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash - dnf install -y $FEDORA_DEPENDENCIES_ABI_CHECK - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) + +build-ubuntu: + image: ubuntu:latest + stage: build + except: + - tags + before_script: + - apt-get update + - apt-get install -y $UBUNTU_DEPENDENCIES + script: + - mkdir _build + - cd _build + - ../autogen.sh + - make + - make install + - make distcheck From 065a021a82edb1df85ba10e73368ccf9738e381f Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 11 Apr 2021 14:57:52 +0000 Subject: [PATCH 032/102] Move the abi check to its own job To make it easier to tell which check failed --- .gitlab-ci.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f1eba76a..d1d79757 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + - abi variables: FEDORA_DEPENDENCIES: @@ -43,10 +44,17 @@ build-fedora: - make - make install - make distcheck - - cd .. - - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash - - dnf install -y $FEDORA_DEPENDENCIES_ABI_CHECK - - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) + +abi-fedora: + image: fedora:latest + stage: abi + needs: + - build-fedora + before_script: + - dnf install -y $FEDORA_DEPENDENCIES_ABI_CHECK + script: + - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash + - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) build-ubuntu: image: ubuntu:latest From 757d90b2abef039cafe559ac0fb5c6f1a9644bca Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 11 Apr 2021 15:09:42 +0000 Subject: [PATCH 033/102] Install missing dependencies in abi step --- .gitlab-ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d1d79757..fa4a590e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -51,10 +51,12 @@ abi-fedora: needs: - build-fedora before_script: - - dnf install -y $FEDORA_DEPENDENCIES_ABI_CHECK + - dnf update -y --nogpgcheck + - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES + - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES_ABI_CHECK script: - - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash - - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) + - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash + - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) build-ubuntu: image: ubuntu:latest From e1b249d6b71cba1117ec3a7bf632afd2ded459e6 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 11 Apr 2021 15:31:10 +0000 Subject: [PATCH 034/102] Minor cleanup --- .gitlab-ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa4a590e..3ca70b09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,7 +36,7 @@ build-fedora: - tags before_script: - dnf update -y --nogpgcheck - - dnf -y install --nogpgcheck $FEDORA_DEPENDENCIES + - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES script: - mkdir _build - cd _build @@ -52,8 +52,7 @@ abi-fedora: - build-fedora before_script: - dnf update -y --nogpgcheck - - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES - - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES_ABI_CHECK + - dnf install -y --nogpgcheck $FEDORA_DEPENDENCIES $FEDORA_DEPENDENCIES_ABI_CHECK script: - curl https://gitlab.freedesktop.org/hadess/check-abi/-/raw/main/contrib/check-abi-fedora.sh | bash - check-abi ${LAST_ABI_BREAK} $(git rev-parse HEAD) From 5714b6089cecbbc78dd2fa20dc1a55fde24c7b6d Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 00:53:26 +0200 Subject: [PATCH 035/102] Fix openbsd procmap.c compile errors --- sysdeps/openbsd/procmap.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index eb3bb347..09b9f388 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -110,12 +110,12 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * We save the kernel pointers in {left,right}_kptr, so we have them * available to download children. */ - left_kptr = (unsigned long) RB_LEFT(entry, daddrs.addr_entry); - right_kptr = (unsigned long) RB_RIGHT(entry, daddrs.addr_entry); - RB_LEFT(entry, daddrs.addr_entry) = - RB_RIGHT(entry, daddrs.addr_entry) = NULL; + left_kptr = (unsigned long) RBT_LEFT(uvm_map_addr, entry); + right_kptr = (unsigned long) RBT_RIGHT(uvm_map_addr, entry); + //RBT_LEFT(uvm_map_addr, entry) = + //RBT_RIGHT(uvm_map_addr, entry) = NULL; /* Fill in parent pointer. */ - RB_PARENT(entry, daddrs.addr_entry) = parent; + //RBT_PARENT(uvm_map_addr, entry) = parent; /* * Consistent state reached, fill in *rptr. @@ -128,11 +128,11 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * unload_vmmap_entries. */ left_sz = load_vmmap_entries(server, left_kptr, - &RB_LEFT(entry, daddrs.addr_entry), entry); + RBT_LEFT(uvm_map_addr, entry), entry); if (left_sz == -1) return -1; right_sz = load_vmmap_entries(server, right_kptr, - &RB_RIGHT(entry, daddrs.addr_entry), entry); + RBT_RIGHT(uvm_map_addr, entry), entry); if (right_sz == -1) return -1; @@ -148,8 +148,8 @@ unload_vmmap_entries(struct vm_map_entry *entry) if (entry == NULL) return; - unload_vmmap_entries(RB_LEFT(entry, daddrs.addr_entry)); - unload_vmmap_entries(RB_RIGHT(entry, daddrs.addr_entry)); + unload_vmmap_entries(RBT_LEFT(uvm_map_addr, entry)); + unload_vmmap_entries(RBT_RIGHT(uvm_map_addr, entry)); free(entry); } @@ -201,12 +201,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } - RB_INIT(&root); + RBT_INIT(uvm_map_addr, &root); nentries = load_vmmap_entries(server, - (unsigned long) RB_ROOT(&vmspace.vm_map.addr), - &RB_ROOT(&root), NULL); + (unsigned long) RBT_ROOT(uvm_map_addr, &vmspace.vm_map.addr), + RBT_ROOT(uvm_map_addr, &root), NULL); if (nentries == -1) { - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_error_io_r (server, "kvm_read (entry)"); } @@ -226,7 +226,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, * to OBJT_DEFAULT so it seems this really works. */ - RB_FOREACH(entry, uvm_map_addr, &root) { + RBT_FOREACH(entry, uvm_map_addr, &root) { glibtop_map_entry *mentry; unsigned long inum, dev; guint len; @@ -242,7 +242,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) entry->object.uvm_obj, &vnode, sizeof (vnode)) != sizeof (vnode)) { glibtop_warn_io_r (server, "kvm_read (vnode)"); - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -258,7 +258,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) vnode.v_data, &inode, sizeof (inode)) != sizeof (inode)) { glibtop_warn_io_r (server, "kvm_read (inode)"); - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -296,7 +296,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, buf->size = sizeof (glibtop_map_entry); buf->total = buf->number * buf->size; - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); return (glibtop_map_entry*) g_array_free(maps, FALSE); } @@ -310,4 +310,4 @@ no_impl(void *p, void *q) return 0; } -RB_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); +RBT_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); From 9e68eb94c38914fc82990c8716767691fb6610de Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 02:45:57 +0200 Subject: [PATCH 036/102] Fix compilation issues in sysdeps/openbsd/netload.c --- sysdeps/openbsd/netload.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sysdeps/openbsd/netload.c b/sysdeps/openbsd/netload.c index 6591b4f9..60c6ae9a 100644 --- a/sysdeps/openbsd/netload.c +++ b/sysdeps/openbsd/netload.c @@ -34,12 +34,16 @@ #include +#include + +#include + +#define _KERNEL #include -#include -#define _KERNEL #include #undef _KERNEL + #include static const unsigned long _glibtop_sysdeps_netload = From 72124ab00565e8f7b87770d19182b9fdbb2d2fca Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 04:28:08 +0200 Subject: [PATCH 037/102] Undo some procmap.c changes --- sysdeps/openbsd/procmap.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index 09b9f388..882c9308 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -59,6 +59,11 @@ static const unsigned long _glibtop_sysdeps_map_entry = (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); +/* Ugly workaround */ +#define RBE_LEFT(elm, field) (elm)->field.rbt_left +#define RBE_RIGHT(elm, field) (elm)->field.rbt_right +#define RBE_PARENT(elm, field) (elm)->field.rbt_parent + /* Local helper functions. */ ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry**, @@ -110,12 +115,12 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * We save the kernel pointers in {left,right}_kptr, so we have them * available to download children. */ - left_kptr = (unsigned long) RBT_LEFT(uvm_map_addr, entry); - right_kptr = (unsigned long) RBT_RIGHT(uvm_map_addr, entry); - //RBT_LEFT(uvm_map_addr, entry) = - //RBT_RIGHT(uvm_map_addr, entry) = NULL; + left_kptr = (unsigned long) RBE_LEFT(entry, daddrs.addr_entry); + right_kptr = (unsigned long) RBE_RIGHT(entry, daddrs.addr_entry); + RBE_LEFT(entry, daddrs.addr_entry) = + RBE_RIGHT(entry, daddrs.addr_entry) = NULL; /* Fill in parent pointer. */ - //RBT_PARENT(uvm_map_addr, entry) = parent; + RBE_PARENT(entry, daddrs.addr_entry) = parent; /* * Consistent state reached, fill in *rptr. @@ -128,11 +133,11 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * unload_vmmap_entries. */ left_sz = load_vmmap_entries(server, left_kptr, - RBT_LEFT(uvm_map_addr, entry), entry); + &RBE_LEFT(entry, daddrs.addr_entry), entry); if (left_sz == -1) return -1; right_sz = load_vmmap_entries(server, right_kptr, - RBT_RIGHT(uvm_map_addr, entry), entry); + &RBE_RIGHT(entry, daddrs.addr_entry), entry); if (right_sz == -1) return -1; @@ -148,8 +153,8 @@ unload_vmmap_entries(struct vm_map_entry *entry) if (entry == NULL) return; - unload_vmmap_entries(RBT_LEFT(uvm_map_addr, entry)); - unload_vmmap_entries(RBT_RIGHT(uvm_map_addr, entry)); + unload_vmmap_entries(RBE_LEFT(entry, daddrs.addr_entry)); + unload_vmmap_entries(RBE_RIGHT(entry, daddrs.addr_entry)); free(entry); } @@ -201,12 +206,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } - RBT_INIT(uvm_map_addr, &root); + RB_INIT(&root); nentries = load_vmmap_entries(server, - (unsigned long) RBT_ROOT(uvm_map_addr, &vmspace.vm_map.addr), - RBT_ROOT(uvm_map_addr, &root), NULL); + (unsigned long) RB_ROOT(&vmspace.vm_map.addr), + &RB_ROOT(&root), NULL); if (nentries == -1) { - unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); + unload_vmmap_entries(RB_ROOT(&root)); glibtop_error_io_r (server, "kvm_read (entry)"); } @@ -242,7 +247,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) entry->object.uvm_obj, &vnode, sizeof (vnode)) != sizeof (vnode)) { glibtop_warn_io_r (server, "kvm_read (vnode)"); - unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); + unload_vmmap_entries(RB_ROOT(&root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -258,7 +263,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) vnode.v_data, &inode, sizeof (inode)) != sizeof (inode)) { glibtop_warn_io_r (server, "kvm_read (inode)"); - unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); + unload_vmmap_entries(RB_ROOT(&root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -296,7 +301,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, buf->size = sizeof (glibtop_map_entry); buf->total = buf->number * buf->size; - unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); + unload_vmmap_entries(RB_ROOT(&root)); return (glibtop_map_entry*) g_array_free(maps, FALSE); } From cfabe09ad8ae906c5c06077a8b4a8a77e4286f40 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 17:49:33 +0200 Subject: [PATCH 038/102] Fix some more procmap.c issues Commit acinclude getmntinfo workaround --- acinclude.m4 | 3 +-- sysdeps/openbsd/procmap.c | 14 +++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 79e0b374..8bbda0cb 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -263,8 +263,7 @@ AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo, [ ok= if test $ac_cv_func_getmntinfo = yes; then -AC_EGREP_HEADER(f_type;, sys/mount.h, -ok=yes) +AC_EGREP_HEADER(getmntinfo, sys/mount.h, ok=yes) fi test -n "$ok" \ && fu_cv_sys_mounted_getmntinfo=yes \ diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index 882c9308..06fab511 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -206,12 +206,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } - RB_INIT(&root); + //RB_INIT(&root); nentries = load_vmmap_entries(server, - (unsigned long) RB_ROOT(&vmspace.vm_map.addr), + (unsigned long) &RB_ROOT(&vmspace.vm_map.addr), &RB_ROOT(&root), NULL); if (nentries == -1) { - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(&RB_ROOT(&root)); glibtop_error_io_r (server, "kvm_read (entry)"); } @@ -231,7 +231,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, * to OBJT_DEFAULT so it seems this really works. */ - RBT_FOREACH(entry, uvm_map_addr, &root) { + RB_FOREACH(entry, uvm_map_addr, &root) { glibtop_map_entry *mentry; unsigned long inum, dev; guint len; @@ -247,7 +247,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) entry->object.uvm_obj, &vnode, sizeof (vnode)) != sizeof (vnode)) { glibtop_warn_io_r (server, "kvm_read (vnode)"); - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(&RB_ROOT(&root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -263,7 +263,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) vnode.v_data, &inode, sizeof (inode)) != sizeof (inode)) { glibtop_warn_io_r (server, "kvm_read (inode)"); - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(&RB_ROOT(&root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -301,7 +301,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, buf->size = sizeof (glibtop_map_entry); buf->total = buf->number * buf->size; - unload_vmmap_entries(RB_ROOT(&root)); + unload_vmmap_entries(&RB_ROOT(&root)); return (glibtop_map_entry*) g_array_free(maps, FALSE); } From 7c14ffaf548275557ab592abcc3c9c19a4a1cb8e Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 21:37:18 +0200 Subject: [PATCH 039/102] Another attempt at getting procmap.c to work I think this is the closest i've gotten to a version that both compiles and links. However it doesn't compile, so im not sure. I might undo all of this, not sure yet. --- sysdeps/openbsd/procmap.c | 13 +- sysdeps/openbsd/rb_workaround.h | 441 ++++++++++++++++++++++++++++++++ 2 files changed, 446 insertions(+), 8 deletions(-) create mode 100644 sysdeps/openbsd/rb_workaround.h diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index 06fab511..8e8aa3ad 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -26,6 +26,8 @@ #include +#include + #include #include #include @@ -59,11 +61,6 @@ static const unsigned long _glibtop_sysdeps_map_entry = (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); -/* Ugly workaround */ -#define RBE_LEFT(elm, field) (elm)->field.rbt_left -#define RBE_RIGHT(elm, field) (elm)->field.rbt_right -#define RBE_PARENT(elm, field) (elm)->field.rbt_parent - /* Local helper functions. */ ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry**, @@ -206,7 +203,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } - //RB_INIT(&root); + RB_INIT(&root); nentries = load_vmmap_entries(server, (unsigned long) &RB_ROOT(&vmspace.vm_map.addr), &RB_ROOT(&root), NULL); @@ -231,7 +228,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, * to OBJT_DEFAULT so it seems this really works. */ - RB_FOREACH(entry, uvm_map_addr, &root) { + RBE_FOREACH(entry, uvm_map_addr, &root) { glibtop_map_entry *mentry; unsigned long inum, dev; guint len; @@ -315,4 +312,4 @@ no_impl(void *p, void *q) return 0; } -RBT_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); +RBE_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); diff --git a/sysdeps/openbsd/rb_workaround.h b/sysdeps/openbsd/rb_workaround.h new file mode 100644 index 00000000..653eb4ed --- /dev/null +++ b/sysdeps/openbsd/rb_workaround.h @@ -0,0 +1,441 @@ +/* + * This entire header file is a horrible workaround that probably shouldn't be used, + * but exists until a better solution is found. + */ +#ifndef _RB_WORKAROUND_H_ +#define _RB_WORKAOURND_H_ + +#define RBE_LEFT(elm, field) (elm)->field.rbt_left +#define RBE_RIGHT(elm, field) (elm)->field.rbt_right +#define RBE_PARENT(elm, field) (elm)->field.rbt_parent +#define RBE_COLOR(elm, field) (elm)->field.rbt_color + +#define RBE_SET(elm, parent, field) do { \ + RBE_PARENT(elm, field) = parent; \ + RBE_LEFT(elm, field) = RBE_RIGHT(elm, field) = NULL; \ + RBE_COLOR(elm, field) = RB_RED; \ +} while (0) + +#define RBE_SET_BLACKRED(black, red, field) do { \ + RBE_COLOR(black, field) = RB_BLACK; \ + RBE_COLOR(red, field) = RB_RED; \ +} while (0) + +#ifndef RBE_AUGMENT +#define RBE_AUGMENT(x) do {} while (0) +#endif + +#define RBE_ROTATE_LEFT(head, elm, tmp, field) do { \ + (tmp) = RBE_RIGHT(elm, field); \ + if ((RBE_RIGHT(elm, field) = RBE_LEFT(tmp, field))) { \ + RBE_PARENT(RBE_LEFT(tmp, field), field) = (elm); \ + } \ + RBE_AUGMENT(elm); \ + if ((RBE_PARENT(tmp, field) = RBE_PARENT(elm, field))) { \ + if ((elm) == RBE_LEFT(RBE_PARENT(elm, field), field)) \ + RBE_LEFT(RBE_PARENT(elm, field), field) = (tmp);\ + else \ + RBE_RIGHT(RBE_PARENT(elm, field), field) = (tmp);\ + } else \ + (head)->rbh_root = (tmp); \ + RBE_LEFT(tmp, field) = (elm); \ + RBE_PARENT(elm, field) = (tmp); \ + RBE_AUGMENT(tmp); \ + if ((RBE_PARENT(tmp, field))) \ + RBE_AUGMENT(RBE_PARENT(tmp, field)); \ +} while (0) + +#define RBE_ROTATE_RIGHT(head, elm, tmp, field) do { \ + (tmp) = RBE_LEFT(elm, field); \ + if ((RBE_LEFT(elm, field) = RBE_RIGHT(tmp, field))) { \ + RBE_PARENT(RBE_RIGHT(tmp, field), field) = (elm); \ + } \ + RBE_AUGMENT(elm); \ + if ((RBE_PARENT(tmp, field) = RBE_PARENT(elm, field))) { \ + if ((elm) == RBE_LEFT(RBE_PARENT(elm, field), field)) \ + RBE_LEFT(RBE_PARENT(elm, field), field) = (tmp);\ + else \ + RBE_RIGHT(RBE_PARENT(elm, field), field) = (tmp);\ + } else \ + (head)->rbh_root = (tmp); \ + RBE_RIGHT(tmp, field) = (elm); \ + RBE_PARENT(elm, field) = (tmp); \ + RBE_AUGMENT(tmp); \ + if ((RBE_PARENT(tmp, field))) \ + RBE_AUGMENT(RBE_PARENT(tmp, field)); \ +} while (0) + +/* Generates prototypes and inline functions */ +#define RBE_PROTOTYPE(name, type, field, cmp) \ + RBE_PROTOTYPE_INTERNAL(name, type, field, cmp,) +#define RBE_PROTOTYPE_STATIC(name, type, field, cmp) \ + RBE_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) +#define RBE_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ +attr void name##_RBE_INSERT_COLOR(struct name *, struct type *); \ +attr void name##_RBE_REMOVE_COLOR(struct name *, struct type *, struct type *);\ +attr struct type *name##_RBE_REMOVE(struct name *, struct type *); \ +attr struct type *name##_RBE_INSERT(struct name *, struct type *); \ +attr struct type *name##_RBE_FIND(struct name *, struct type *); \ +attr struct type *name##_RBE_NFIND(struct name *, struct type *); \ +attr struct type *name##_RBE_NEXT(struct type *); \ +attr struct type *name##_RBE_PREV(struct type *); \ +attr struct type *name##_RBE_MINMAX(struct name *, int); \ + \ + +/* Main rb operation. + * Moves node close to the key of elm to top + */ +#define RBE_GENERATE(name, type, field, cmp) \ + RBE_GENERATE_INTERNAL(name, type, field, cmp,) +#define RBE_GENERATE_STATIC(name, type, field, cmp) \ + RBE_GENERATE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) +#define RBE_GENERATE_INTERNAL(name, type, field, cmp, attr) \ +attr void \ +name##_RBE_INSERT_COLOR(struct name *head, struct type *elm) \ +{ \ + struct type *parent, *gparent, *tmp; \ + while ((parent = RBE_PARENT(elm, field)) && \ + RBE_COLOR(parent, field) == RB_RED) { \ + gparent = RBE_PARENT(parent, field); \ + if (parent == RBE_LEFT(gparent, field)) { \ + tmp = RBE_RIGHT(gparent, field); \ + if (tmp && RBE_COLOR(tmp, field) == RB_RED) { \ + RBE_COLOR(tmp, field) = RB_BLACK; \ + RBE_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RBE_RIGHT(parent, field) == elm) { \ + RBE_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RBE_SET_BLACKRED(parent, gparent, field); \ + RBE_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = RBE_LEFT(gparent, field); \ + if (tmp && RBE_COLOR(tmp, field) == RB_RED) { \ + RBE_COLOR(tmp, field) = RB_BLACK; \ + RBE_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RBE_LEFT(parent, field) == elm) { \ + RBE_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RBE_SET_BLACKRED(parent, gparent, field); \ + RBE_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + RBE_COLOR(head->rbh_root, field) = RB_BLACK; \ +} \ + \ +attr void \ +name##_RBE_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ +{ \ + struct type *tmp; \ + while ((elm == NULL || RBE_COLOR(elm, field) == RB_BLACK) && \ + elm != RB_ROOT(head)) { \ + if (RBE_LEFT(parent, field) == elm) { \ + tmp = RBE_RIGHT(parent, field); \ + if (RBE_COLOR(tmp, field) == RB_RED) { \ + RBE_SET_BLACKRED(tmp, parent, field); \ + RBE_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = RBE_RIGHT(parent, field); \ + } \ + if ((RBE_LEFT(tmp, field) == NULL || \ + RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RBE_RIGHT(tmp, field) == NULL || \ + RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RBE_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RBE_PARENT(elm, field); \ + } else { \ + if (RBE_RIGHT(tmp, field) == NULL || \ + RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK) {\ + struct type *oleft; \ + if ((oleft = RBE_LEFT(tmp, field)))\ + RBE_COLOR(oleft, field) = RB_BLACK;\ + RBE_COLOR(tmp, field) = RB_RED;\ + RBE_ROTATE_RIGHT(head, tmp, oleft, field);\ + tmp = RBE_RIGHT(parent, field); \ + } \ + RBE_COLOR(tmp, field) = RBE_COLOR(parent, field);\ + RBE_COLOR(parent, field) = RB_BLACK; \ + if (RBE_RIGHT(tmp, field)) \ + RBE_COLOR(RBE_RIGHT(tmp, field), field) = RB_BLACK;\ + RBE_ROTATE_LEFT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = RBE_LEFT(parent, field); \ + if (RBE_COLOR(tmp, field) == RB_RED) { \ + RBE_SET_BLACKRED(tmp, parent, field); \ + RBE_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = RBE_LEFT(parent, field); \ + } \ + if ((RBE_LEFT(tmp, field) == NULL || \ + RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RBE_RIGHT(tmp, field) == NULL || \ + RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RBE_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RBE_PARENT(elm, field); \ + } else { \ + if (RBE_LEFT(tmp, field) == NULL || \ + RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) {\ + struct type *oright; \ + if ((oright = RBE_RIGHT(tmp, field)))\ + RBE_COLOR(oright, field) = RB_BLACK;\ + RBE_COLOR(tmp, field) = RB_RED; \ + RBE_ROTATE_LEFT(head, tmp, oright, field);\ + tmp = RBE_LEFT(parent, field); \ + } \ + RBE_COLOR(tmp, field) = RBE_COLOR(parent, field);\ + RBE_COLOR(parent, field) = RB_BLACK; \ + if (RBE_LEFT(tmp, field)) \ + RBE_COLOR(RBE_LEFT(tmp, field), field) = RB_BLACK;\ + RBE_ROTATE_RIGHT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + RBE_COLOR(elm, field) = RB_BLACK; \ +} \ + \ +attr struct type * \ +name##_RBE_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *child, *parent, *old = elm; \ + int color; \ + if (RBE_LEFT(elm, field) == NULL) \ + child = RBE_RIGHT(elm, field); \ + else if (RBE_RIGHT(elm, field) == NULL) \ + child = RBE_LEFT(elm, field); \ + else { \ + struct type *left; \ + elm = RBE_RIGHT(elm, field); \ + while ((left = RBE_LEFT(elm, field))) \ + elm = left; \ + child = RBE_RIGHT(elm, field); \ + parent = RBE_PARENT(elm, field); \ + color = RBE_COLOR(elm, field); \ + if (child) \ + RBE_PARENT(child, field) = parent; \ + if (parent) { \ + if (RBE_LEFT(parent, field) == elm) \ + RBE_LEFT(parent, field) = child; \ + else \ + RBE_RIGHT(parent, field) = child; \ + RBE_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + if (RBE_PARENT(elm, field) == old) \ + parent = elm; \ + (elm)->field = (old)->field; \ + if (RBE_PARENT(old, field)) { \ + if (RBE_LEFT(RBE_PARENT(old, field), field) == old)\ + RBE_LEFT(RBE_PARENT(old, field), field) = elm;\ + else \ + RBE_RIGHT(RBE_PARENT(old, field), field) = elm;\ + RBE_AUGMENT(RBE_PARENT(old, field)); \ + } else \ + RB_ROOT(head) = elm; \ + RBE_PARENT(RBE_LEFT(old, field), field) = elm; \ + if (RBE_RIGHT(old, field)) \ + RBE_PARENT(RBE_RIGHT(old, field), field) = elm; \ + if (parent) { \ + left = parent; \ + do { \ + RBE_AUGMENT(left); \ + } while ((left = RBE_PARENT(left, field))); \ + } \ + goto color; \ + } \ + parent = RBE_PARENT(elm, field); \ + color = RBE_COLOR(elm, field); \ + if (child) \ + RBE_PARENT(child, field) = parent; \ + if (parent) { \ + if (RBE_LEFT(parent, field) == elm) \ + RBE_LEFT(parent, field) = child; \ + else \ + RBE_RIGHT(parent, field) = child; \ + RBE_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ +color: \ + if (color == RB_BLACK) \ + name##_RBE_REMOVE_COLOR(head, parent, child); \ + return (old); \ +} \ + \ +/* Inserts a node into the RB tree */ \ +attr struct type * \ +name##_RBE_INSERT(struct name *head, struct type *elm) \ +{ \ + struct type *tmp; \ + struct type *parent = NULL; \ + int comp = 0; \ + tmp = RB_ROOT(head); \ + while (tmp) { \ + parent = tmp; \ + comp = (cmp)(elm, parent); \ + if (comp < 0) \ + tmp = RBE_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RBE_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + RBE_SET(elm, parent, field); \ + if (parent != NULL) { \ + if (comp < 0) \ + RBE_LEFT(parent, field) = elm; \ + else \ + RBE_RIGHT(parent, field) = elm; \ + RBE_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = elm; \ + name##_RBE_INSERT_COLOR(head, elm); \ + return (NULL); \ +} \ + \ +/* Finds the node with the same key as elm */ \ +attr struct type * \ +name##_RBE_FIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) \ + tmp = RBE_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RBE_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (NULL); \ +} \ + \ +/* Finds the first node greater than or equal to the search key */ \ +attr struct type * \ +name##_RBE_NFIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *res = NULL; \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) { \ + res = tmp; \ + tmp = RBE_LEFT(tmp, field); \ + } \ + else if (comp > 0) \ + tmp = RBE_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (res); \ +} \ + \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RBE_NEXT(struct type *elm) \ +{ \ + if (RBE_RIGHT(elm, field)) { \ + elm = RBE_RIGHT(elm, field); \ + while (RBE_LEFT(elm, field)) \ + elm = RBE_LEFT(elm, field); \ + } else { \ + if (RBE_PARENT(elm, field) && \ + (elm == RBE_LEFT(RBE_PARENT(elm, field), field))) \ + elm = RBE_PARENT(elm, field); \ + else { \ + while (RBE_PARENT(elm, field) && \ + (elm == RBE_RIGHT(RBE_PARENT(elm, field), field)))\ + elm = RBE_PARENT(elm, field); \ + elm = RBE_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} \ + \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RBE_PREV(struct type *elm) \ +{ \ + if (RBE_LEFT(elm, field)) { \ + elm = RBE_LEFT(elm, field); \ + while (RBE_RIGHT(elm, field)) \ + elm = RBE_RIGHT(elm, field); \ + } else { \ + if (RBE_PARENT(elm, field) && \ + (elm == RBE_RIGHT(RBE_PARENT(elm, field), field))) \ + elm = RBE_PARENT(elm, field); \ + else { \ + while (RBE_PARENT(elm, field) && \ + (elm == RBE_LEFT(RBE_PARENT(elm, field), field)))\ + elm = RBE_PARENT(elm, field); \ + elm = RBE_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} \ + \ +attr struct type * \ +name##_RBE_MINMAX(struct name *head, int val) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *parent = NULL; \ + while (tmp) { \ + parent = tmp; \ + if (val < 0) \ + tmp = RBE_LEFT(tmp, field); \ + else \ + tmp = RBE_RIGHT(tmp, field); \ + } \ + return (parent); \ +} + +#define RBE_NEGINF -1 +#define RBE_INF 1 + +#define RBE_INSERT(name, x, y) name##_RBE_INSERT(x, y) +#define RBE_REMOVE(name, x, y) name##_RBE_REMOVE(x, y) +#define RBE_FIND(name, x, y) name##_RBE_FIND(x, y) +#define RBE_NFIND(name, x, y) name##_RBE_NFIND(x, y) +#define RBE_NEXT(name, x, y) name##_RBE_NEXT(y) +#define RBE_PREV(name, x, y) name##_RBE_PREV(y) +#define RBE_MIN(name, x) name##_RBE_MINMAX(x, RBE_NEGINF) +#define RBE_MAX(name, x) name##_RBE_MINMAX(x, RBE_INF) + +#define RBE_FOREACH(x, name, head) \ + for ((x) = RBE_MIN(name, head); \ + (x) != NULL; \ + (x) = name##_RBE_NEXT(x)) + +#define RBE_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RBE_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RBE_NEXT(x), 1); \ + (x) = (y)) + +#define RBE_FOREACH_REVERSE(x, name, head) \ + for ((x) = RBE_MAX(name, head); \ + (x) != NULL; \ + (x) = name##_RBE_PREV(x)) + +#define RBE_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RBE_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RBE_PREV(x), 1); \ + (x) = (y)) + +#endif /* _RB_WORKAROUND_H_ */ From 76c2e7178afccd65834c94694ac447ee4c5d7d6f Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 23:36:43 +0200 Subject: [PATCH 040/102] Fix remaining compile errors Finalize(hopefully) procmap.c fix copy stub procio.c to fix compile errors undo rb workaround --- sysdeps/openbsd/Makefile.am | 2 +- sysdeps/openbsd/glibtop_server.h | 2 + sysdeps/openbsd/procio.c | 43 +++ sysdeps/openbsd/procmap.c | 69 +++-- sysdeps/openbsd/rb_workaround.h | 441 ------------------------------- 5 files changed, 79 insertions(+), 478 deletions(-) create mode 100644 sysdeps/openbsd/procio.c delete mode 100644 sysdeps/openbsd/rb_workaround.h diff --git a/sysdeps/openbsd/Makefile.am b/sysdeps/openbsd/Makefile.am index 8f62eae8..41b4b6b0 100644 --- a/sysdeps/openbsd/Makefile.am +++ b/sysdeps/openbsd/Makefile.am @@ -15,7 +15,7 @@ libgtop_sysdeps_suid_2_0_la_SOURCES = suid_open.c close.c swap.c \ proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c \ prockernel.c procsegment.c procargs.c \ - procmap.c netload.c ppp.c + procmap.c netload.c ppp.c procio.c # TODO should be made nosuid like FreeBSD libgtop_sysdeps_suid_2_0_la_SOURCES += shm_limits.c msg_limits.c sem_limits.c diff --git a/sysdeps/openbsd/glibtop_server.h b/sysdeps/openbsd/glibtop_server.h index fc9bb303..54ca8cbb 100644 --- a/sysdeps/openbsd/glibtop_server.h +++ b/sysdeps/openbsd/glibtop_server.h @@ -47,6 +47,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PROC_WD 0 #define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_IO 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 G_END_DECLS diff --git a/sysdeps/openbsd/procio.c b/sysdeps/openbsd/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/openbsd/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index 8e8aa3ad..ba0db2cf 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -26,8 +26,6 @@ #include -#include - #include #include #include @@ -47,7 +45,6 @@ #include typedef int boolean_t; -#undef _KERNEL #define _UVM_UVM_AMAP_I_H_ 1 #define _UVM_UVM_MAP_I_H_ 1 #include @@ -61,14 +58,26 @@ static const unsigned long _glibtop_sysdeps_map_entry = (1L << GLIBTOP_MAP_ENTRY_OFFSET) + (1L << GLIBTOP_MAP_ENTRY_PERM) + (1L << GLIBTOP_MAP_ENTRY_INODE) + (1L << GLIBTOP_MAP_ENTRY_DEVICE); +/* + * Don't implement address comparison. + */ +static int __inline +no_impl(const void *p, const void *q) +{ + abort(); /* Should not be called. */ + return 0; +} + +RBT_PROTOTYPE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); +RBT_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); + /* Local helper functions. */ -ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry**, +ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry*, struct vm_map_entry*); void unload_vmmap_entries(struct vm_map_entry *); /* Init function. */ - void _glibtop_init_proc_map_p (glibtop *server) { @@ -85,7 +94,7 @@ _glibtop_init_proc_map_p (glibtop *server) */ ssize_t load_vmmap_entries(glibtop *server, unsigned long kptr, - struct vm_map_entry **rptr, struct vm_map_entry *parent) + struct vm_map_entry *rptr, struct vm_map_entry *parent) { struct vm_map_entry *entry; unsigned long left_kptr, right_kptr; @@ -112,17 +121,17 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * We save the kernel pointers in {left,right}_kptr, so we have them * available to download children. */ - left_kptr = (unsigned long) RBE_LEFT(entry, daddrs.addr_entry); - right_kptr = (unsigned long) RBE_RIGHT(entry, daddrs.addr_entry); - RBE_LEFT(entry, daddrs.addr_entry) = - RBE_RIGHT(entry, daddrs.addr_entry) = NULL; + left_kptr = (unsigned long) RBT_LEFT(uvm_map_addr, entry); + right_kptr = (unsigned long) RBT_RIGHT(uvm_map_addr, entry); + entry->daddrs.addr_entry.rbt_left = + entry->daddrs.addr_entry.rbt_right = NULL; /* Fill in parent pointer. */ - RBE_PARENT(entry, daddrs.addr_entry) = parent; + entry->daddrs.addr_entry.rbt_parent = &parent->daddrs.addr_entry; /* * Consistent state reached, fill in *rptr. */ - *rptr = entry; + rptr = entry; /* * Download left, right. @@ -130,11 +139,11 @@ load_vmmap_entries(glibtop *server, unsigned long kptr, * unload_vmmap_entries. */ left_sz = load_vmmap_entries(server, left_kptr, - &RBE_LEFT(entry, daddrs.addr_entry), entry); + RBT_LEFT(uvm_map_addr, entry), entry); if (left_sz == -1) return -1; right_sz = load_vmmap_entries(server, right_kptr, - &RBE_RIGHT(entry, daddrs.addr_entry), entry); + RBT_RIGHT(uvm_map_addr, entry), entry); if (right_sz == -1) return -1; @@ -150,8 +159,8 @@ unload_vmmap_entries(struct vm_map_entry *entry) if (entry == NULL) return; - unload_vmmap_entries(RBE_LEFT(entry, daddrs.addr_entry)); - unload_vmmap_entries(RBE_RIGHT(entry, daddrs.addr_entry)); + unload_vmmap_entries(RBT_LEFT(uvm_map_addr, entry)); + unload_vmmap_entries(RBT_RIGHT(uvm_map_addr, entry)); free(entry); } @@ -203,12 +212,12 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, return NULL; } - RB_INIT(&root); + RBT_INIT(uvm_map_addr, &root); nentries = load_vmmap_entries(server, - (unsigned long) &RB_ROOT(&vmspace.vm_map.addr), - &RB_ROOT(&root), NULL); + (unsigned long) RBT_ROOT(uvm_map_addr, &vmspace.vm_map.addr), + RBT_ROOT(uvm_map_addr, &root), NULL); if (nentries == -1) { - unload_vmmap_entries(&RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_error_io_r (server, "kvm_read (entry)"); } @@ -228,7 +237,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, * to OBJT_DEFAULT so it seems this really works. */ - RBE_FOREACH(entry, uvm_map_addr, &root) { + RBT_FOREACH(entry, uvm_map_addr, &root) { glibtop_map_entry *mentry; unsigned long inum, dev; guint len; @@ -244,7 +253,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) entry->object.uvm_obj, &vnode, sizeof (vnode)) != sizeof (vnode)) { glibtop_warn_io_r (server, "kvm_read (vnode)"); - unload_vmmap_entries(&RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -260,7 +269,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, (unsigned long) vnode.v_data, &inode, sizeof (inode)) != sizeof (inode)) { glibtop_warn_io_r (server, "kvm_read (inode)"); - unload_vmmap_entries(&RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } @@ -298,18 +307,6 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, buf->size = sizeof (glibtop_map_entry); buf->total = buf->number * buf->size; - unload_vmmap_entries(&RB_ROOT(&root)); + unload_vmmap_entries(RBT_ROOT(uvm_map_addr, &root)); return (glibtop_map_entry*) g_array_free(maps, FALSE); } - -/* - * Don't implement address comparison. - */ -static __inline int -no_impl(void *p, void *q) -{ - abort(); /* Should not be called. */ - return 0; -} - -RBE_GENERATE(uvm_map_addr, vm_map_entry, daddrs.addr_entry, no_impl); diff --git a/sysdeps/openbsd/rb_workaround.h b/sysdeps/openbsd/rb_workaround.h deleted file mode 100644 index 653eb4ed..00000000 --- a/sysdeps/openbsd/rb_workaround.h +++ /dev/null @@ -1,441 +0,0 @@ -/* - * This entire header file is a horrible workaround that probably shouldn't be used, - * but exists until a better solution is found. - */ -#ifndef _RB_WORKAROUND_H_ -#define _RB_WORKAOURND_H_ - -#define RBE_LEFT(elm, field) (elm)->field.rbt_left -#define RBE_RIGHT(elm, field) (elm)->field.rbt_right -#define RBE_PARENT(elm, field) (elm)->field.rbt_parent -#define RBE_COLOR(elm, field) (elm)->field.rbt_color - -#define RBE_SET(elm, parent, field) do { \ - RBE_PARENT(elm, field) = parent; \ - RBE_LEFT(elm, field) = RBE_RIGHT(elm, field) = NULL; \ - RBE_COLOR(elm, field) = RB_RED; \ -} while (0) - -#define RBE_SET_BLACKRED(black, red, field) do { \ - RBE_COLOR(black, field) = RB_BLACK; \ - RBE_COLOR(red, field) = RB_RED; \ -} while (0) - -#ifndef RBE_AUGMENT -#define RBE_AUGMENT(x) do {} while (0) -#endif - -#define RBE_ROTATE_LEFT(head, elm, tmp, field) do { \ - (tmp) = RBE_RIGHT(elm, field); \ - if ((RBE_RIGHT(elm, field) = RBE_LEFT(tmp, field))) { \ - RBE_PARENT(RBE_LEFT(tmp, field), field) = (elm); \ - } \ - RBE_AUGMENT(elm); \ - if ((RBE_PARENT(tmp, field) = RBE_PARENT(elm, field))) { \ - if ((elm) == RBE_LEFT(RBE_PARENT(elm, field), field)) \ - RBE_LEFT(RBE_PARENT(elm, field), field) = (tmp);\ - else \ - RBE_RIGHT(RBE_PARENT(elm, field), field) = (tmp);\ - } else \ - (head)->rbh_root = (tmp); \ - RBE_LEFT(tmp, field) = (elm); \ - RBE_PARENT(elm, field) = (tmp); \ - RBE_AUGMENT(tmp); \ - if ((RBE_PARENT(tmp, field))) \ - RBE_AUGMENT(RBE_PARENT(tmp, field)); \ -} while (0) - -#define RBE_ROTATE_RIGHT(head, elm, tmp, field) do { \ - (tmp) = RBE_LEFT(elm, field); \ - if ((RBE_LEFT(elm, field) = RBE_RIGHT(tmp, field))) { \ - RBE_PARENT(RBE_RIGHT(tmp, field), field) = (elm); \ - } \ - RBE_AUGMENT(elm); \ - if ((RBE_PARENT(tmp, field) = RBE_PARENT(elm, field))) { \ - if ((elm) == RBE_LEFT(RBE_PARENT(elm, field), field)) \ - RBE_LEFT(RBE_PARENT(elm, field), field) = (tmp);\ - else \ - RBE_RIGHT(RBE_PARENT(elm, field), field) = (tmp);\ - } else \ - (head)->rbh_root = (tmp); \ - RBE_RIGHT(tmp, field) = (elm); \ - RBE_PARENT(elm, field) = (tmp); \ - RBE_AUGMENT(tmp); \ - if ((RBE_PARENT(tmp, field))) \ - RBE_AUGMENT(RBE_PARENT(tmp, field)); \ -} while (0) - -/* Generates prototypes and inline functions */ -#define RBE_PROTOTYPE(name, type, field, cmp) \ - RBE_PROTOTYPE_INTERNAL(name, type, field, cmp,) -#define RBE_PROTOTYPE_STATIC(name, type, field, cmp) \ - RBE_PROTOTYPE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) -#define RBE_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ -attr void name##_RBE_INSERT_COLOR(struct name *, struct type *); \ -attr void name##_RBE_REMOVE_COLOR(struct name *, struct type *, struct type *);\ -attr struct type *name##_RBE_REMOVE(struct name *, struct type *); \ -attr struct type *name##_RBE_INSERT(struct name *, struct type *); \ -attr struct type *name##_RBE_FIND(struct name *, struct type *); \ -attr struct type *name##_RBE_NFIND(struct name *, struct type *); \ -attr struct type *name##_RBE_NEXT(struct type *); \ -attr struct type *name##_RBE_PREV(struct type *); \ -attr struct type *name##_RBE_MINMAX(struct name *, int); \ - \ - -/* Main rb operation. - * Moves node close to the key of elm to top - */ -#define RBE_GENERATE(name, type, field, cmp) \ - RBE_GENERATE_INTERNAL(name, type, field, cmp,) -#define RBE_GENERATE_STATIC(name, type, field, cmp) \ - RBE_GENERATE_INTERNAL(name, type, field, cmp, __attribute__((__unused__)) static) -#define RBE_GENERATE_INTERNAL(name, type, field, cmp, attr) \ -attr void \ -name##_RBE_INSERT_COLOR(struct name *head, struct type *elm) \ -{ \ - struct type *parent, *gparent, *tmp; \ - while ((parent = RBE_PARENT(elm, field)) && \ - RBE_COLOR(parent, field) == RB_RED) { \ - gparent = RBE_PARENT(parent, field); \ - if (parent == RBE_LEFT(gparent, field)) { \ - tmp = RBE_RIGHT(gparent, field); \ - if (tmp && RBE_COLOR(tmp, field) == RB_RED) { \ - RBE_COLOR(tmp, field) = RB_BLACK; \ - RBE_SET_BLACKRED(parent, gparent, field);\ - elm = gparent; \ - continue; \ - } \ - if (RBE_RIGHT(parent, field) == elm) { \ - RBE_ROTATE_LEFT(head, parent, tmp, field);\ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RBE_SET_BLACKRED(parent, gparent, field); \ - RBE_ROTATE_RIGHT(head, gparent, tmp, field); \ - } else { \ - tmp = RBE_LEFT(gparent, field); \ - if (tmp && RBE_COLOR(tmp, field) == RB_RED) { \ - RBE_COLOR(tmp, field) = RB_BLACK; \ - RBE_SET_BLACKRED(parent, gparent, field);\ - elm = gparent; \ - continue; \ - } \ - if (RBE_LEFT(parent, field) == elm) { \ - RBE_ROTATE_RIGHT(head, parent, tmp, field);\ - tmp = parent; \ - parent = elm; \ - elm = tmp; \ - } \ - RBE_SET_BLACKRED(parent, gparent, field); \ - RBE_ROTATE_LEFT(head, gparent, tmp, field); \ - } \ - } \ - RBE_COLOR(head->rbh_root, field) = RB_BLACK; \ -} \ - \ -attr void \ -name##_RBE_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ -{ \ - struct type *tmp; \ - while ((elm == NULL || RBE_COLOR(elm, field) == RB_BLACK) && \ - elm != RB_ROOT(head)) { \ - if (RBE_LEFT(parent, field) == elm) { \ - tmp = RBE_RIGHT(parent, field); \ - if (RBE_COLOR(tmp, field) == RB_RED) { \ - RBE_SET_BLACKRED(tmp, parent, field); \ - RBE_ROTATE_LEFT(head, parent, tmp, field);\ - tmp = RBE_RIGHT(parent, field); \ - } \ - if ((RBE_LEFT(tmp, field) == NULL || \ - RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) &&\ - (RBE_RIGHT(tmp, field) == NULL || \ - RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK)) {\ - RBE_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RBE_PARENT(elm, field); \ - } else { \ - if (RBE_RIGHT(tmp, field) == NULL || \ - RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK) {\ - struct type *oleft; \ - if ((oleft = RBE_LEFT(tmp, field)))\ - RBE_COLOR(oleft, field) = RB_BLACK;\ - RBE_COLOR(tmp, field) = RB_RED;\ - RBE_ROTATE_RIGHT(head, tmp, oleft, field);\ - tmp = RBE_RIGHT(parent, field); \ - } \ - RBE_COLOR(tmp, field) = RBE_COLOR(parent, field);\ - RBE_COLOR(parent, field) = RB_BLACK; \ - if (RBE_RIGHT(tmp, field)) \ - RBE_COLOR(RBE_RIGHT(tmp, field), field) = RB_BLACK;\ - RBE_ROTATE_LEFT(head, parent, tmp, field);\ - elm = RB_ROOT(head); \ - break; \ - } \ - } else { \ - tmp = RBE_LEFT(parent, field); \ - if (RBE_COLOR(tmp, field) == RB_RED) { \ - RBE_SET_BLACKRED(tmp, parent, field); \ - RBE_ROTATE_RIGHT(head, parent, tmp, field);\ - tmp = RBE_LEFT(parent, field); \ - } \ - if ((RBE_LEFT(tmp, field) == NULL || \ - RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) &&\ - (RBE_RIGHT(tmp, field) == NULL || \ - RBE_COLOR(RBE_RIGHT(tmp, field), field) == RB_BLACK)) {\ - RBE_COLOR(tmp, field) = RB_RED; \ - elm = parent; \ - parent = RBE_PARENT(elm, field); \ - } else { \ - if (RBE_LEFT(tmp, field) == NULL || \ - RBE_COLOR(RBE_LEFT(tmp, field), field) == RB_BLACK) {\ - struct type *oright; \ - if ((oright = RBE_RIGHT(tmp, field)))\ - RBE_COLOR(oright, field) = RB_BLACK;\ - RBE_COLOR(tmp, field) = RB_RED; \ - RBE_ROTATE_LEFT(head, tmp, oright, field);\ - tmp = RBE_LEFT(parent, field); \ - } \ - RBE_COLOR(tmp, field) = RBE_COLOR(parent, field);\ - RBE_COLOR(parent, field) = RB_BLACK; \ - if (RBE_LEFT(tmp, field)) \ - RBE_COLOR(RBE_LEFT(tmp, field), field) = RB_BLACK;\ - RBE_ROTATE_RIGHT(head, parent, tmp, field);\ - elm = RB_ROOT(head); \ - break; \ - } \ - } \ - } \ - if (elm) \ - RBE_COLOR(elm, field) = RB_BLACK; \ -} \ - \ -attr struct type * \ -name##_RBE_REMOVE(struct name *head, struct type *elm) \ -{ \ - struct type *child, *parent, *old = elm; \ - int color; \ - if (RBE_LEFT(elm, field) == NULL) \ - child = RBE_RIGHT(elm, field); \ - else if (RBE_RIGHT(elm, field) == NULL) \ - child = RBE_LEFT(elm, field); \ - else { \ - struct type *left; \ - elm = RBE_RIGHT(elm, field); \ - while ((left = RBE_LEFT(elm, field))) \ - elm = left; \ - child = RBE_RIGHT(elm, field); \ - parent = RBE_PARENT(elm, field); \ - color = RBE_COLOR(elm, field); \ - if (child) \ - RBE_PARENT(child, field) = parent; \ - if (parent) { \ - if (RBE_LEFT(parent, field) == elm) \ - RBE_LEFT(parent, field) = child; \ - else \ - RBE_RIGHT(parent, field) = child; \ - RBE_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ - if (RBE_PARENT(elm, field) == old) \ - parent = elm; \ - (elm)->field = (old)->field; \ - if (RBE_PARENT(old, field)) { \ - if (RBE_LEFT(RBE_PARENT(old, field), field) == old)\ - RBE_LEFT(RBE_PARENT(old, field), field) = elm;\ - else \ - RBE_RIGHT(RBE_PARENT(old, field), field) = elm;\ - RBE_AUGMENT(RBE_PARENT(old, field)); \ - } else \ - RB_ROOT(head) = elm; \ - RBE_PARENT(RBE_LEFT(old, field), field) = elm; \ - if (RBE_RIGHT(old, field)) \ - RBE_PARENT(RBE_RIGHT(old, field), field) = elm; \ - if (parent) { \ - left = parent; \ - do { \ - RBE_AUGMENT(left); \ - } while ((left = RBE_PARENT(left, field))); \ - } \ - goto color; \ - } \ - parent = RBE_PARENT(elm, field); \ - color = RBE_COLOR(elm, field); \ - if (child) \ - RBE_PARENT(child, field) = parent; \ - if (parent) { \ - if (RBE_LEFT(parent, field) == elm) \ - RBE_LEFT(parent, field) = child; \ - else \ - RBE_RIGHT(parent, field) = child; \ - RBE_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = child; \ -color: \ - if (color == RB_BLACK) \ - name##_RBE_REMOVE_COLOR(head, parent, child); \ - return (old); \ -} \ - \ -/* Inserts a node into the RB tree */ \ -attr struct type * \ -name##_RBE_INSERT(struct name *head, struct type *elm) \ -{ \ - struct type *tmp; \ - struct type *parent = NULL; \ - int comp = 0; \ - tmp = RB_ROOT(head); \ - while (tmp) { \ - parent = tmp; \ - comp = (cmp)(elm, parent); \ - if (comp < 0) \ - tmp = RBE_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RBE_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - RBE_SET(elm, parent, field); \ - if (parent != NULL) { \ - if (comp < 0) \ - RBE_LEFT(parent, field) = elm; \ - else \ - RBE_RIGHT(parent, field) = elm; \ - RBE_AUGMENT(parent); \ - } else \ - RB_ROOT(head) = elm; \ - name##_RBE_INSERT_COLOR(head, elm); \ - return (NULL); \ -} \ - \ -/* Finds the node with the same key as elm */ \ -attr struct type * \ -name##_RBE_FIND(struct name *head, struct type *elm) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - int comp; \ - while (tmp) { \ - comp = cmp(elm, tmp); \ - if (comp < 0) \ - tmp = RBE_LEFT(tmp, field); \ - else if (comp > 0) \ - tmp = RBE_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - return (NULL); \ -} \ - \ -/* Finds the first node greater than or equal to the search key */ \ -attr struct type * \ -name##_RBE_NFIND(struct name *head, struct type *elm) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - struct type *res = NULL; \ - int comp; \ - while (tmp) { \ - comp = cmp(elm, tmp); \ - if (comp < 0) { \ - res = tmp; \ - tmp = RBE_LEFT(tmp, field); \ - } \ - else if (comp > 0) \ - tmp = RBE_RIGHT(tmp, field); \ - else \ - return (tmp); \ - } \ - return (res); \ -} \ - \ -/* ARGSUSED */ \ -attr struct type * \ -name##_RBE_NEXT(struct type *elm) \ -{ \ - if (RBE_RIGHT(elm, field)) { \ - elm = RBE_RIGHT(elm, field); \ - while (RBE_LEFT(elm, field)) \ - elm = RBE_LEFT(elm, field); \ - } else { \ - if (RBE_PARENT(elm, field) && \ - (elm == RBE_LEFT(RBE_PARENT(elm, field), field))) \ - elm = RBE_PARENT(elm, field); \ - else { \ - while (RBE_PARENT(elm, field) && \ - (elm == RBE_RIGHT(RBE_PARENT(elm, field), field)))\ - elm = RBE_PARENT(elm, field); \ - elm = RBE_PARENT(elm, field); \ - } \ - } \ - return (elm); \ -} \ - \ -/* ARGSUSED */ \ -attr struct type * \ -name##_RBE_PREV(struct type *elm) \ -{ \ - if (RBE_LEFT(elm, field)) { \ - elm = RBE_LEFT(elm, field); \ - while (RBE_RIGHT(elm, field)) \ - elm = RBE_RIGHT(elm, field); \ - } else { \ - if (RBE_PARENT(elm, field) && \ - (elm == RBE_RIGHT(RBE_PARENT(elm, field), field))) \ - elm = RBE_PARENT(elm, field); \ - else { \ - while (RBE_PARENT(elm, field) && \ - (elm == RBE_LEFT(RBE_PARENT(elm, field), field)))\ - elm = RBE_PARENT(elm, field); \ - elm = RBE_PARENT(elm, field); \ - } \ - } \ - return (elm); \ -} \ - \ -attr struct type * \ -name##_RBE_MINMAX(struct name *head, int val) \ -{ \ - struct type *tmp = RB_ROOT(head); \ - struct type *parent = NULL; \ - while (tmp) { \ - parent = tmp; \ - if (val < 0) \ - tmp = RBE_LEFT(tmp, field); \ - else \ - tmp = RBE_RIGHT(tmp, field); \ - } \ - return (parent); \ -} - -#define RBE_NEGINF -1 -#define RBE_INF 1 - -#define RBE_INSERT(name, x, y) name##_RBE_INSERT(x, y) -#define RBE_REMOVE(name, x, y) name##_RBE_REMOVE(x, y) -#define RBE_FIND(name, x, y) name##_RBE_FIND(x, y) -#define RBE_NFIND(name, x, y) name##_RBE_NFIND(x, y) -#define RBE_NEXT(name, x, y) name##_RBE_NEXT(y) -#define RBE_PREV(name, x, y) name##_RBE_PREV(y) -#define RBE_MIN(name, x) name##_RBE_MINMAX(x, RBE_NEGINF) -#define RBE_MAX(name, x) name##_RBE_MINMAX(x, RBE_INF) - -#define RBE_FOREACH(x, name, head) \ - for ((x) = RBE_MIN(name, head); \ - (x) != NULL; \ - (x) = name##_RBE_NEXT(x)) - -#define RBE_FOREACH_SAFE(x, name, head, y) \ - for ((x) = RBE_MIN(name, head); \ - ((x) != NULL) && ((y) = name##_RBE_NEXT(x), 1); \ - (x) = (y)) - -#define RBE_FOREACH_REVERSE(x, name, head) \ - for ((x) = RBE_MAX(name, head); \ - (x) != NULL; \ - (x) = name##_RBE_PREV(x)) - -#define RBE_FOREACH_REVERSE_SAFE(x, name, head, y) \ - for ((x) = RBE_MAX(name, head); \ - ((x) != NULL) && ((y) = name##_RBE_PREV(x), 1); \ - (x) = (y)) - -#endif /* _RB_WORKAROUND_H_ */ From b8a0475a421453fe3d53a0da733cdaa7a04370c3 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 18 Apr 2021 23:49:58 +0200 Subject: [PATCH 041/102] Fix deleted empty line --- sysdeps/openbsd/procmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index ba0db2cf..b2e4f89a 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -78,6 +78,7 @@ ssize_t load_vmmap_entries(glibtop*, unsigned long, struct vm_map_entry*, void unload_vmmap_entries(struct vm_map_entry *); /* Init function. */ + void _glibtop_init_proc_map_p (glibtop *server) { From fd162f9cb845d0c9533db261c6c6f1d88d1ce012 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 19 Apr 2021 02:50:48 +0200 Subject: [PATCH 042/102] Fix kvm_open issue --- sysdeps/openbsd/procmap.c | 2 +- sysdeps/openbsd/suid_open.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index b2e4f89a..7729f31a 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -61,7 +61,7 @@ static const unsigned long _glibtop_sysdeps_map_entry = /* * Don't implement address comparison. */ -static int __inline +static __inline int no_impl(const void *p, const void *q) { abort(); /* Should not be called. */ diff --git a/sysdeps/openbsd/suid_open.c b/sysdeps/openbsd/suid_open.c index b6b202f6..a25586b1 100644 --- a/sysdeps/openbsd/suid_open.c +++ b/sysdeps/openbsd/suid_open.c @@ -69,7 +69,7 @@ glibtop_open_p (glibtop *server, const char *program_name, server->machine->gid = getgid (); server->machine->egid = getegid (); /* Setup machine-specific data */ - server->machine->kd = kvm_openfiles (NULL, NULL, NULL, O_RDONLY, errbuf); + server->machine->kd = kvm_openfiles (NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (server->machine->kd == NULL) glibtop_error_io_r (server, "kvm_open"); From 43e4c5257918fafdfb32eb1cca40c7ae0b4806b4 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 19 Apr 2021 15:34:58 +0200 Subject: [PATCH 043/102] Fix shm_limits.c, sem_limits.c, and msg_limits.c by using sysctl instead of kvm_nlist Co-authored-by: jasper --- sysdeps/openbsd/msg_limits.c | 28 +++++++++++++++++----------- sysdeps/openbsd/sem_limits.c | 28 +++++++++++++++++----------- sysdeps/openbsd/shm_limits.c | 27 ++++++++++++++++----------- 3 files changed, 50 insertions(+), 33 deletions(-) diff --git a/sysdeps/openbsd/msg_limits.c b/sysdeps/openbsd/msg_limits.c index bc7c6e23..840d75e2 100644 --- a/sysdeps/openbsd/msg_limits.c +++ b/sysdeps/openbsd/msg_limits.c @@ -47,28 +47,34 @@ static const unsigned long _glibtop_sysdeps_msg_limits = * since `msginfo' is already declared external in . */ static struct msginfo _msginfo; -/* nlist structure for kernel access */ -static struct nlist nlst [] = { - { "_msginfo" }, - { 0 } -}; - /* Init function. */ void _glibtop_init_msg_limits_p (glibtop *server) { - if (kvm_nlist (server->machine->kd, nlst) < 0) { - glibtop_warn_io_r (server, "kvm_nlist (msg_limits)"); + int mib[3]; + struct msg_sysctl_info *msgsi; + + size_t len = sizeof(struct msginfo); + + mib[0] = CTL_KERN; + mib[1] = KERN_SYSVIPC_INFO; + mib[2] = KERN_SYSVIPC_MSG_INFO; + + if ((msgsi = malloc(len)) == NULL) { + glibtop_warn_io_r (server, "malloc (shm_limits)"); return; } - if (kvm_read (server->machine->kd, nlst [0].n_value, - &_msginfo, sizeof (_msginfo)) != sizeof (_msginfo)) { - glibtop_warn_io_r (server, "kvm_read (msginfo)"); + if (sysctl(mib, 3, msgsi, &len, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (shm_limits)"); return; } + _msginfo = msgsi->msginfo; + + free (msgsi); + server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; } diff --git a/sysdeps/openbsd/sem_limits.c b/sysdeps/openbsd/sem_limits.c index df1dfc29..12e88ff0 100644 --- a/sysdeps/openbsd/sem_limits.c +++ b/sysdeps/openbsd/sem_limits.c @@ -45,28 +45,34 @@ static unsigned long _glibtop_sysdeps_sem_limits = * since `seminfo' is already declared external in . */ static struct seminfo _seminfo; -/* nlist structure for kernel access */ -static struct nlist nlst [] = { - { "_seminfo" }, - { 0 } -}; - /* Init function. */ void _glibtop_init_sem_limits_p (glibtop *server) { - if (kvm_nlist (server->machine->kd, nlst) < 0) { - glibtop_warn_io_r (server, "kvm_nlist (sem_limits)"); + int mib[3]; + struct sem_sysctl_info *semsi; + + size_t len = sizeof(struct seminfo); + + mib[0] = CTL_KERN; + mib[1] = KERN_SYSVIPC_INFO; + mib[2] = KERN_SYSVIPC_SEM_INFO; + + if ((semsi = malloc(len)) == NULL) { + glibtop_warn_io_r (server, "malloc (shm_limits)"); return; } - if (kvm_read (server->machine->kd, nlst [0].n_value, - &_seminfo, sizeof (_seminfo)) != sizeof (_seminfo)) { - glibtop_warn_io_r (server, "kvm_read (seminfo)"); + if (sysctl(mib, 3, semsi, &len, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (shm_limits)"); return; } + _seminfo = semsi->seminfo; + + free (semsi); + server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; } diff --git a/sysdeps/openbsd/shm_limits.c b/sysdeps/openbsd/shm_limits.c index 16fc5cf7..fb43756a 100644 --- a/sysdeps/openbsd/shm_limits.c +++ b/sysdeps/openbsd/shm_limits.c @@ -39,28 +39,33 @@ static unsigned long _glibtop_sysdeps_shm_limits = * since `shminfo' is already declared external in . */ static struct shminfo _shminfo; -/* nlist structure for kernel access */ -static struct nlist nlst [] = { - { "_shminfo" }, - { 0 } -}; - /* Init function. */ void _glibtop_init_shm_limits_p (glibtop *server) { - if (kvm_nlist (server->machine->kd, nlst) < 0) { - glibtop_warn_io_r (server, "kvm_nlist (shm_limits)"); + int mib[3]; + struct shm_sysctl_info *shmsi; + size_t len = sizeof(struct shminfo); + + mib[0] = CTL_KERN; + mib[1] = KERN_SYSVIPC_INFO; + mib[2] = KERN_SYSVIPC_SHM_INFO; + + if ((shmsi = malloc(len)) == NULL) { + glibtop_warn_io_r (server, "malloc (shm_limits)"); return; } - if (kvm_read (server->machine->kd, nlst [0].n_value, - &_shminfo, sizeof (_shminfo)) != sizeof (_shminfo)) { - glibtop_warn_io_r (server, "kvm_read (shminfo)"); + if (sysctl(mib, 3, shmsi, &len, NULL, 0) < 0) { + glibtop_warn_io_r (server, "sysctl (shm_limits)"); return; } + _shminfo = shmsi->shminfo; + + free (shmsi); + server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; } From 68b52696076f270e590b8627a2d2f77660f6c436 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 19 Apr 2021 15:40:25 +0200 Subject: [PATCH 044/102] Fix msg_limits.c and sem_limits.c error message --- sysdeps/openbsd/msg_limits.c | 4 ++-- sysdeps/openbsd/sem_limits.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/openbsd/msg_limits.c b/sysdeps/openbsd/msg_limits.c index 840d75e2..63af68f3 100644 --- a/sysdeps/openbsd/msg_limits.c +++ b/sysdeps/openbsd/msg_limits.c @@ -62,12 +62,12 @@ _glibtop_init_msg_limits_p (glibtop *server) mib[2] = KERN_SYSVIPC_MSG_INFO; if ((msgsi = malloc(len)) == NULL) { - glibtop_warn_io_r (server, "malloc (shm_limits)"); + glibtop_warn_io_r (server, "malloc (msg_limits)"); return; } if (sysctl(mib, 3, msgsi, &len, NULL, 0) < 0) { - glibtop_warn_io_r (server, "sysctl (shm_limits)"); + glibtop_warn_io_r (server, "sysctl (msg_limits)"); return; } diff --git a/sysdeps/openbsd/sem_limits.c b/sysdeps/openbsd/sem_limits.c index 12e88ff0..b68e41b9 100644 --- a/sysdeps/openbsd/sem_limits.c +++ b/sysdeps/openbsd/sem_limits.c @@ -60,12 +60,12 @@ _glibtop_init_sem_limits_p (glibtop *server) mib[2] = KERN_SYSVIPC_SEM_INFO; if ((semsi = malloc(len)) == NULL) { - glibtop_warn_io_r (server, "malloc (shm_limits)"); + glibtop_warn_io_r (server, "malloc (sem_limits)"); return; } if (sysctl(mib, 3, semsi, &len, NULL, 0) < 0) { - glibtop_warn_io_r (server, "sysctl (shm_limits)"); + glibtop_warn_io_r (server, "sysctl (sem_limits)"); return; } From a067db056927db232a2eb8cf79d4af096962eced Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 10 Apr 2021 18:19:15 +0800 Subject: [PATCH 045/102] Revert "Revert "New API to retrieve disk stats in Linux"" This reverts commit 7e214414bf23d1ea34e7fdccb17a7f41040ffea9. --- glibtop.h | 2 + include/glibtop/disk.h | 74 +++++++++++++++++++++++++ include/glibtop/sysdeps.h | 4 +- include/glibtop/union.h | 2 + lib/Makefile.am | 2 +- lib/command.c | 1 + lib/libgtop.sym | 2 + lib/sysdeps.c | 4 ++ src/daemon/main.c | 4 ++ sysdeps/common/default.c | 14 +++++ sysdeps/common/sysdeps_suid.c | 3 ++ sysdeps/linux/Makefile.am | 2 +- sysdeps/linux/disk.c | 96 +++++++++++++++++++++++++++++++++ sysdeps/linux/glibtop_private.c | 18 +++++++ sysdeps/linux/glibtop_private.h | 3 ++ sysdeps/linux/glibtop_server.h | 1 + sysdeps/stub/disk.c | 42 +++++++++++++++ sysdeps/stub/glibtop_server.h | 1 + 18 files changed, 272 insertions(+), 3 deletions(-) create mode 100644 include/glibtop/disk.h create mode 100644 sysdeps/linux/disk.c create mode 100644 sysdeps/stub/disk.c diff --git a/glibtop.h b/glibtop.h index 3542249a..804294da 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,6 +80,8 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ + int ndisk; /* Number of DISKs, zero if single-disk */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h new file mode 100644 index 00000000..8843112c --- /dev/null +++ b/include/glibtop/disk.h @@ -0,0 +1,74 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GLIBTOP_DISK_H__ +#define __GLIBTOP_DISK_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_XDISK_SECTORS_READ 0 +#define GLIBTOP_XDISK_TIME_READ 1 +#define GLIBTOP_XDISK_SECTORS_WRITE 2 +#define GLIBTOP_XDISK_TIME_WRITE 3 + +#define GLIBTOP_MAX_DISK 4 + +/* Nobody should really be using more than 4 disk. + Yes we are :) + Nobody should really be using more than 32 disk. +*/ +#define GLIBTOP_NDISK 1024 + +typedef struct _glibtop_disk glibtop_disk; + +struct _glibtop_disk +{ + guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ + guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ + guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ + guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ +}; + +void glibtop_get_disk(glibtop_disk *buf); + +#if GLIBTOP_SUID_DISK +#define glibtop_get_disk_r glibtop_get_disk_p +#else +#define glibtop_get_disk_r glibtop_get_disk_s +#endif + +void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); + +#if GLIBTOP_SUID_DISK +void _glibtop_init_disk_p (glibtop *server); +void glibtop_get_disk_p (glibtop *server, glibtop_disk *buf); +#else +void _glibtop_init_disk_s (glibtop *server); +void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf); +#endif + + +G_END_DECLS + +#endif diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h index a18c69e6..a1db66d8 100644 --- a/include/glibtop/sysdeps.h +++ b/include/glibtop/sysdeps.h @@ -54,8 +54,9 @@ G_BEGIN_DECLS #define GLIBTOP_SYSDEPS_PROC_WD 25 #define GLIBTOP_SYSDEPS_PROC_AFFINITY 26 #define GLIBTOP_SYSDEPS_PROC_IO 27 +#define GLIBTOP_SYSDEPS_DISK 28 -#define GLIBTOP_MAX_SYSDEPS 28 +#define GLIBTOP_MAX_SYSDEPS 29 /* The 'features' args to glibtop_init_* is an unsigned long */ G_STATIC_ASSERT((1UL << (GLIBTOP_MAX_SYSDEPS - 1)) <= ULONG_MAX); @@ -69,6 +70,7 @@ struct _glibtop_sysdeps guint64 flags; guint64 features; /* server features */ guint64 cpu; /* glibtop_cpu */ + guint64 disk; /* glibtop_cpu */ guint64 mem; /* glibtop_mem */ guint64 swap; /* glibtop_swap */ guint64 uptime; /* glibtop_uptime */ diff --git a/include/glibtop/union.h b/include/glibtop/union.h index 334f0217..bda7c576 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -23,6 +23,7 @@ #define __GLIBTOP_UNION_H__ #include +#include #include #include #include @@ -60,6 +61,7 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; + glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/Makefile.am b/lib/Makefile.am index 90b82861..5a6f6511 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -29,7 +29,7 @@ if HAVE_INTROSPECTION introspection_sources = $(libgtop_2_0_la_SOURCES) lib.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/proctime.h ../include/glibtop/shm_limits.h ../include/glibtop/cpu.h ../include/glibtop/disk.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 \ diff --git a/lib/command.c b/lib/command.c index b6ccf1f2..cf2270e0 100644 --- a/lib/command.c +++ b/lib/command.c @@ -43,6 +43,7 @@ glibtop_call_l (glibtop *server, unsigned command, size_t send_size, CHECK_CMND(GLIBTOP_CMND_QUIT); CHECK_CMND(GLIBTOP_CMND_SYSDEPS); CHECK_CMND(GLIBTOP_CMND_CPU); + CHECK_CMND(GLIBTOP_CMND_DISK); CHECK_CMND(GLIBTOP_CMND_MEM); CHECK_CMND(GLIBTOP_CMND_SWAP); CHECK_CMND(GLIBTOP_CMND_UPTIME); diff --git a/lib/libgtop.sym b/lib/libgtop.sym index afa9d070..60316a72 100644 --- a/lib/libgtop.sym +++ b/lib/libgtop.sym @@ -3,6 +3,8 @@ glibtop_close glibtop_close_r glibtop_get_cpu glibtop_get_cpu_l +glibtop_get_disk +glibtop_get_disk_l glibtop_get_fsusage glibtop_get_fsusage_l glibtop_get_loadavg diff --git a/lib/sysdeps.c b/lib/sysdeps.c index 2a761576..96292568 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -27,6 +27,7 @@ const unsigned long glibtop_server_features = GLIBTOP_SUID_CPU + +GLIBTOP_SUID_DISK + GLIBTOP_SUID_MEM + GLIBTOP_SUID_SWAP + GLIBTOP_SUID_UPTIME + @@ -56,6 +57,9 @@ const _glibtop_init_func_t _glibtop_init_hook_s [] = { #if !GLIBTOP_SUID_CPU _glibtop_init_cpu_s, #endif +#if !GLIBTOP_SUID_DISK + _glibtop_init_disk_s, +#endif #if !GLIBTOP_SUID_MEM _glibtop_init_mem_s, #endif diff --git a/src/daemon/main.c b/src/daemon/main.c index b51addf6..34cbaf50 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -97,6 +97,10 @@ handle_parent_connection (int s) glibtop_get_cpu_l (server, &resp->u.data.cpu); do_output (s, resp, _offset_data (cpu), 0, NULL); break; + case GLIBTOP_CMND_DISK: + glibtop_get_disk_l (server, &resp->u.disk.cpu); + do_output (s, resp, _offset_data (disk), 0, NULL); + break; case GLIBTOP_CMND_MEM: glibtop_get_mem_l (server, &resp->u.data.mem); do_output (s, resp, _offset_data (mem), 0, NULL); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index e3b096f2..c20f2938 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -64,6 +64,20 @@ glibtop_get_cpu(glibtop_cpu *buf) } +/** + * glibtop_get_disk: + * @buf: A location to return the disk usage. + * + * Get the DISK usage. + * + */ +void +glibtop_get_cpu(glibtop_cpu *buf) +{ + glibtop_get_cpu_l(glibtop_global_server, buf); +} + + /** * glibtop_get_fsusage: * @buf: A location to return the file system usage. diff --git a/sysdeps/common/sysdeps_suid.c b/sysdeps/common/sysdeps_suid.c index 24953176..ecb1d53e 100644 --- a/sysdeps/common/sysdeps_suid.c +++ b/sysdeps/common/sysdeps_suid.c @@ -30,6 +30,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif +#if GLIBTOP_SUID_DISK + _glibtop_init_disk_p, +#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/sysdeps/linux/Makefile.am b/sysdeps/linux/Makefile.am index fdd54696..c51bb155 100644 --- a/sysdeps/linux/Makefile.am +++ b/sysdeps/linux/Makefile.am @@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la EXTRA_DIST = procmap_smaps.gperf procmap_smaps.c -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c new file mode 100644 index 00000000..159f8f12 --- /dev/null +++ b/sysdeps/linux/disk.c @@ -0,0 +1,96 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "glibtop_private.h" + +static const unsigned long _glibtop_sysdeps_disk = +(1L << GLIBTOP_XDISK_SECTORS_READ) + (1L << GLIBTOP_XDISK_TIME_READ) + +(1L << GLIBTOP_XDISK_SECTORS_WRITE) + (1L << GLIBTOP_XDISK_TIME_WRITE); + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn +#define STAT_BUFSIZ 81920 + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + char buffer [STAT_BUFSIZ], *p; + int i; + + memset (buf, 0, sizeof (glibtop_disk)); + + file_to_buffer(server, buffer, sizeof buffer, FILENAME); + + /* + * GLOBAL + */ + + p = buffer; /* "disk" */ + + /* + * PER DISK + */ + + for (i = 0; i <= server->ndisk; i++) { + + p = skip_multiple_token(p,2); + + // skip if disk is the raw device + if(!check_alphanumeric_word(p)){ + + p = skip_line(p); /* move to ^ */ + p = skip_multiple_token(p,2); + + } + + if (!check_disk_line_warn(server, p, i)) + break; + + p = skip_token(p); /* prev xdisk_name */ + p = skip_token(p); /* prev xdisk_reads_completed */ + p = skip_token(p); /* prev xdisk_reads_merged */ + + buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); + buf->xdisk_time_read [i] = strtoull (p, &p, 0); + + p = skip_token(p); /* prev xdisk_writes_completed */ + p = skip_token(p); /* prev xdisk_writes_merged */ + + buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); + buf->xdisk_time_write [i] = strtoull (p, &p, 0); + + p = skip_line(p); /* move to ^ */ + + } +} diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index d3a49aa6..7b36561c 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,6 +57,24 @@ skip_token (const char *p) } +int +check_alphanumeric_word (const char *p) +{ + int test = 0; + p = next_token(p); + while (*p && !g_ascii_isspace(*p)) { + if(g_ascii_isalpha(*p)){ + test = 0; + }else if(g_ascii_isdigit(*p)){ + test = 1; + } + p++; + }; + p = next_token(p); + return test; +} + + /* * Read functions */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 03761f4f..d42ee669 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,6 +61,9 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } +int +check_alphanumeric_word (const char *p); + /* * Smart strtoul which handles binary suffixes * e.g: get_scaled("Size: 32 kB", "Size:") == 32768 diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 6240d5de..43dd9d9f 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -23,6 +23,7 @@ #define __LINUX__GLIBTOP_SERVER_H__ #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 diff --git a/sysdeps/stub/disk.c b/sysdeps/stub/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/stub/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server.h index 1dd18bf0..0f8bd194 100644 --- a/sysdeps/stub/glibtop_server.h +++ b/sysdeps/stub/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 From 48595809ed33c216a05a7fb0b0ac73dcd4635624 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 10 Apr 2021 18:20:13 +0800 Subject: [PATCH 046/102] Revert "Revert "Handle LVM and RAID"" This reverts commit 30bf8d04183c26ca48c6cd4efe4c24058a082783. --- glibtop.h | 2 +- include/glibtop/disk.h | 10 +- sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 218 +++++++++++++++++++++++++++++--- sysdeps/linux/glibtop_private.c | 27 ++-- sysdeps/linux/glibtop_private.h | 4 +- 6 files changed, 229 insertions(+), 36 deletions(-) diff --git a/glibtop.h b/glibtop.h index 804294da..c196818c 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,7 +80,7 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk */ + int ndisk; /* Number of DISKs, zero if single-disk */ int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index 8843112c..cdde7796 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -42,6 +42,14 @@ G_BEGIN_DECLS typedef struct _glibtop_disk glibtop_disk; +struct _partition_info +{ + char name[256]; + char type[256]; + char raid_num[256]; + int max; +}; + struct _glibtop_disk { guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ @@ -50,7 +58,7 @@ struct _glibtop_disk guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ }; -void glibtop_get_disk(glibtop_disk *buf); +void glibtop_get_disk (glibtop_disk *buf); #if GLIBTOP_SUID_DISK #define glibtop_get_disk_r glibtop_get_disk_p diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index c20f2938..653a4f5a 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_cpu(glibtop_cpu *buf) +glibtop_get_cpu (glibtop_cpu *buf) { - glibtop_get_cpu_l(glibtop_global_server, buf); + glibtop_get_cpu_l (glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 159f8f12..3ad74bcc 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -39,58 +39,244 @@ _glibtop_init_disk_s (glibtop *server) /* Provides information about disk usage. */ -#define FILENAME "/proc/diskstats" //kernel reports sectors by 512 bytes even for AF 4kn +// Linux kernel reports sectors by 512 bytes even for AF 4kn // + +#define FILENAME "/proc/diskstats" +#define CMD_PIPE "lsblk --output NAME,TYPE -i -n | sed 's/`-//'|sed 's/|-//'|sed 's/|//'| sed -e 's/^[ \t]*//'|tr -s ' '" #define STAT_BUFSIZ 81920 +// Handle LVM and RAID // + +void +find_primary_part (_partition_info *primary_part, const char *m) +{ + int n = 0, tlvl = 0; + char name[256]="",type[256]=""; + + primary_part->max = 0; + + //scan by tree level + //0 = disk (to lvl 0) + //0 = disk, 1 = part (to lvl 1) + //0 = disk, 1 = part, 2 = lvm or raid (to lvl 2) + //0 = disk, 1 = part, 2 = raid, 3 = lvm (to lvl 3) + + while (sscanf(m, "%s %s", name, type) == 2) + { + + if (tlvl == 0) { + + if (strcmp (type, "disk") == 0) { + + primary_part->max++; + + } + else if ((strcmp (type, "part") == 0)){ + + tlvl = 1; + + } + + } + else if(tlvl == 1){ + + if (strcmp (type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (type, "part") == 0)) { + + n--; + + } + else if ((strcmp (type, "lvm") == 0)) { + + tlvl = 2; + primary_part->max++; + + } + else if ((strncmp (type, "raid", 4) == 0)) { + + tlvl = 2; + primary_part->max++; + + } + + } + else if( tlvl == 2){ + + if (strcmp(type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { + + n--; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { + + n--; + + } + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "lvm") == 0)){ + + tlvl = 3; + primary_part->max++; + + } + + } + else if (tlvl == 3) { + + if (strcmp (type, "disk") == 0) { + + n--; + tlvl = 0; + primary_part->max++; + + } + else if ((strcmp (type, "lvm") == 0)) { + + n--; + + } + else if ((strncmp (type, "raid", 4) == 0)) { + + n--; + tlvl = 2; + + } + else if ((strcmp (type, "part") == 0)) { + + n--; + tlvl = 1; + + } + } + + + strcpy (primary_part[n].name, name); + strncpy (primary_part[n].type, type, 4); + + if (strcmp (primary_part[n].type, "raid") == 0) { + + strcpy (primary_part[n].raid_num, type + 4); + + } + + m = skip_line (m); + n++; + + } +} + +int +is_virtual_drive (_partition_info *primary_part, const char *p) +{ + int i; + char name[256]; + int test = 1; + sscanf (p, "%s", name); + + if (*p) { + + for (i=0; imax; i++) { + + if (strcmp (primary_part[i].name, name) == 0) { + + test = 0; + break; + + } + + } + + } + else { + + test = 0; + + } + + return test; +} + void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - char buffer [STAT_BUFSIZ], *p; + _partition_info primary_part[GLIBTOP_NDISK]; + char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; int i; memset (buf, 0, sizeof (glibtop_disk)); - file_to_buffer(server, buffer, sizeof buffer, FILENAME); + file_to_buffer (server, buffer, sizeof buffer, FILENAME); + + get_from_pipe (map_buffer, CMD_PIPE); + + server->ndisk = GLIBTOP_NDISK; /* * GLOBAL */ p = buffer; /* "disk" */ + m = map_buffer; /* * PER DISK */ + find_primary_part (primary_part, m); + for (i = 0; i <= server->ndisk; i++) { - p = skip_multiple_token(p,2); + p = skip_multiple_token (p,2); - // skip if disk is the raw device - if(!check_alphanumeric_word(p)){ + // skip if disk is the raw device + if (!is_virtual_drive (primary_part, p)) { - p = skip_line(p); /* move to ^ */ - p = skip_multiple_token(p,2); + p = skip_line (p); /* move to ^ */ + p = skip_multiple_token (p, 2); - } + } - if (!check_disk_line_warn(server, p, i)) + if (!check_disk_line_warn (server, p, i)) break; - p = skip_token(p); /* prev xdisk_name */ - p = skip_token(p); /* prev xdisk_reads_completed */ - p = skip_token(p); /* prev xdisk_reads_merged */ + p = skip_token (p); /* prev xdisk_name */ + p = skip_token (p); /* prev xdisk_reads_completed */ + p = skip_token (p); /* prev xdisk_reads_merged */ buf->xdisk_sectors_read [i] = strtoull (p, &p, 0); buf->xdisk_time_read [i] = strtoull (p, &p, 0); - p = skip_token(p); /* prev xdisk_writes_completed */ - p = skip_token(p); /* prev xdisk_writes_merged */ + p = skip_token (p); /* prev xdisk_writes_completed */ + p = skip_token (p); /* prev xdisk_writes_merged */ buf->xdisk_sectors_write [i] = strtoull (p, &p, 0); buf->xdisk_time_write [i] = strtoull (p, &p, 0); - p = skip_line(p); /* move to ^ */ + p = skip_line (p); /* move to ^ */ } } diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index 7b36561c..7bca42a5 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -57,21 +57,20 @@ skip_token (const char *p) } -int -check_alphanumeric_word (const char *p) +void +get_from_pipe (char *buffer, const char *cmd) { - int test = 0; - p = next_token(p); - while (*p && !g_ascii_isspace(*p)) { - if(g_ascii_isalpha(*p)){ - test = 0; - }else if(g_ascii_isdigit(*p)){ - test = 1; - } - p++; - }; - p = next_token(p); - return test; + FILE* fp; + long psize; + + fp = popen (cmd, "r"); + + fseek (fp, 0, SEEK_END); + psize = ftell (fp); + fseek (fp, 0, SEEK_SET); + fread(buffer,1,psize,fp); + + pclose (fp); } diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index d42ee669..66fed54c 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -61,8 +61,8 @@ skip_line (const char *p) return (char *) (*p ? p+1 : p); } -int -check_alphanumeric_word (const char *p); +void +get_from_pipe (char *buffer, const char *cmd) /* * Smart strtoul which handles binary suffixes From 2ec1815e6ce8da65244c18fbad56c06721f737cb Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 10 Apr 2021 18:20:21 +0800 Subject: [PATCH 047/102] Revert "Revert "Code clean up and add example"" This reverts commit ea08151ae6582a438db76b738293a0194c964b88. --- autogen.sh | 28 +++++++++++++ configure.ac | 10 +++++ doc/reference/libgtop-sections.txt | 34 ++++++++++++++++ examples/Makefile.am | 3 ++ examples/disk.c | 65 ++++++++++++++++++++++++++++++ features.def | 1 + include/glibtop/Makefile.am | 2 +- include/glibtop/command.h | 3 +- include/glibtop/disk.h | 6 ++- include/glibtop/union.h | 2 +- lib/sysdeps.c | 3 ++ libgtop-2.0.pc.in | 2 +- libgtop.spec.in | 1 + src/daemon/main.c | 2 +- src/daemon/slave.c | 6 +++ sysdeps/common/default.c | 4 +- sysdeps/linux/disk.c | 33 ++++++++++----- sysdeps/linux/glibtop_private.h | 2 +- sysdeps/stub/Makefile.am | 2 +- sysdeps/stub_suid/Makefile.am | 2 +- sysdeps/stub_suid/disk.c | 47 +++++++++++++++++++++ 21 files changed, 238 insertions(+), 20 deletions(-) create mode 100644 examples/disk.c create mode 100644 sysdeps/stub_suid/disk.c diff --git a/autogen.sh b/autogen.sh index 9d394bff..ab75b974 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,33 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. +RED='\033[0;31m' +NC='\033[0m' # No Color + +case "$(uname -s)" in + Linux) + if ! [ -x "$(command -v lsblk)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} lsblk cannot be found. Try installing util-linux or util-linux-ng ${RED}***${NC}" >&2 + echo '' >&2 + exit 1 + fi + if ! [ -x "$(command -v sed)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} sed cannot be found. ***" >&2 + echo '' >&2 + exit 1 + fi + if ! [ -x "$(command -v tr)" ]; then + echo '' >&2 + echo -e "${RED}*** ERROR:${NC} tr cannot be found. ***" >&2 + echo '' >&2 + exit 1 + fi + ;; + *) + ;; +esac + test -n "$srcdir" || srcdir=$(dirname "$0") test -n "$srcdir" || srcdir=. diff --git a/configure.ac b/configure.ac index d7215bf0..5426daf1 100644 --- a/configure.ac +++ b/configure.ac @@ -71,6 +71,16 @@ dnl Most people should have a working perl interpreter on their system AC_CHECK_PROGS(PERL, perl5 perl) test -z "$PERL" && AC_MSG_ERROR([You need to have a working perl interpreter.]) +case "${host_os}" in + linux*) + AC_CHECK_TOOL(LSBLK,lsblk) + AC_CHECK_TOOL(SED,sed) + AC_CHECK_TOOL(TR,tr) + ;; + *) + ;; +esac + AC_CHECK_TOOL(CC,gcc) AC_CHECK_TOOL(RANLIB,ranlib) AC_CHECK_TOOL(AS,as) diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index ba878943..3d6d710d 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -29,6 +29,7 @@ glibtop_close_p GLIBTOP_CMND_QUIT GLIBTOP_CMND_SYSDEPS GLIBTOP_CMND_CPU +GLIBTOP_CMND_DISK GLIBTOP_CMND_MEM GLIBTOP_CMND_SWAP GLIBTOP_CMND_UPTIME @@ -678,6 +679,39 @@ glibtop_init_cpu_s glibtop_get_cpu_s
+glibtop/disk.h +
+disk +GLIBTOP_DISK_TOTAL +GLIBTOP_DISK_USER +GLIBTOP_DISK_NICE +GLIBTOP_DISK_SYS +GLIBTOP_DISK_IDLE +GLIBTOP_DISK_FREQUENCY +GLIBTOP_XDISK_TOTAL +GLIBTOP_XDISK_USER +GLIBTOP_XDISK_NICE +GLIBTOP_XDISK_SYS +GLIBTOP_XDISK_IDLE +GLIBTOP_XDISK_FLAGS +GLIBTOP_DISK_IOWAIT +GLIBTOP_DISK_IRQ +GLIBTOP_DISK_SOFTIRQ +GLIBTOP_XDISK_IOWAIT +GLIBTOP_XDISK_IRQ +GLIBTOP_XDISK_SOFTIRQ +GLIBTOP_MAX_DISK +GLIBTOP_NDISK +glibtop_disk +glibtop_get_disk +glibtop_get_disk_r +glibtop_get_disk_l +glibtop_init_disk_p +glibtop_get_disk_p +glibtop_init_disk_s +glibtop_get_disk_s +
+ glibtop/swap.h
swap diff --git a/examples/Makefile.am b/examples/Makefile.am index 25585e04..ef192787 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -34,6 +34,9 @@ mountlist_LDADD = $(top_builddir)/lib/libgtop-2.0.la smp_SOURCES = smp.c smp_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm +disk_SOURCES = disk.c +disk_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm + timings_SOURCES = timings.c timings_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/examples/disk.c b/examples/disk.c new file mode 100644 index 00000000..c3c61142 --- /dev/null +++ b/examples/disk.c @@ -0,0 +1,65 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include + +#include +#include + +int +main (int argc, char *argv []) +{ + glibtop_disk disk; + char separator [BUFSIZ]; + int ndisk, i; + + glibtop_init(); + + glibtop_get_disk (&disk); + + ndisk = glibtop_global_server->ndisk ? glibtop_global_server->ndisk : 1; + + memset (separator, '-', 91); + separator [92] = '\0'; + + printf("\n\n"); + printf ("ELAPSE "); + printf ("Read Time Read Write Time Write\n"); + printf ("%s\n", separator); + + for (i = 0; i < ndisk; i++) { + printf ("DISK %3d : %12lu %12lu %12lu %12lu\n", i, + (unsigned long) disk.xdisk_sectors_read [i], + (unsigned long) disk.xdisk_time_read [i], + (unsigned long) disk.xdisk_sectors_write [i], + (unsigned long) disk.xdisk_time_write [i]); + + } + + printf ("%s\n\n\n", separator); + + exit (0); +} diff --git a/features.def b/features.def index faab87b1..50cbe72a 100644 --- a/features.def +++ b/features.def @@ -1,4 +1,5 @@ void|cpu +void|disk void|mem void|swap void|uptime diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index 6d0e055f..da78ca93 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -2,7 +2,7 @@ glibtopdir = $(includedir)/libgtop-2.0/glibtop glibtop_HEADERS = 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 \ + proctime.h shm_limits.h cpu.h disk.h msg_limits.h \ procmem.h procuid.h swap.h \ procsegment.h sysdeps.h global.h \ procsignal.h union.h gnuserv.h \ diff --git a/include/glibtop/command.h b/include/glibtop/command.h index 9a0e47b1..31e89589 100644 --- a/include/glibtop/command.h +++ b/include/glibtop/command.h @@ -60,8 +60,9 @@ G_BEGIN_DECLS #define GLIBTOP_CMND_PROC_WD 26 #define GLIBTOP_CMND_PROC_AFFINITY 27 #define GLIBTOP_CMND_PROC_IO 28 +#define GLIBTOP_CMND_DISK 29 -#define GLIBTOP_MAX_CMND 29 +#define GLIBTOP_MAX_CMND 30 #define _GLIBTOP_PARAM_SIZE 16 diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index cdde7796..292924f6 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -46,16 +46,20 @@ struct _partition_info { char name[256]; char type[256]; - char raid_num[256]; + char raid_num[256]; int max; }; +typedef struct _partition_info partition_info; + struct _glibtop_disk { + guint64 flags; guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ + guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/include/glibtop/union.h b/include/glibtop/union.h index bda7c576..eb57cfc0 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -61,7 +61,7 @@ typedef union _glibtop_union glibtop_union; union _glibtop_union { glibtop_cpu cpu; - glibtop_disk disk; + glibtop_disk disk; glibtop_mem mem; glibtop_swap swap; glibtop_uptime uptime; diff --git a/lib/sysdeps.c b/lib/sysdeps.c index 96292568..beb950e8 100644 --- a/lib/sysdeps.c +++ b/lib/sysdeps.c @@ -139,6 +139,9 @@ const _glibtop_init_func_t _glibtop_init_hook_p [] = { #if GLIBTOP_SUID_CPU _glibtop_init_cpu_p, #endif +#if GLIBTOP_SUID_DISK + _glibtop_init_disk_p, +#endif #if GLIBTOP_SUID_MEM _glibtop_init_mem_p, #endif diff --git a/libgtop-2.0.pc.in b/libgtop-2.0.pc.in index e1753322..4381ab20 100644 --- a/libgtop-2.0.pc.in +++ b/libgtop-2.0.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: libgtop Description: Portable System Access Library -Requires: glib-2.0 +Requires: glib-2.0, util-linux Version: @VERSION@ Libs: -L${libdir} -lgtop-2.0 Cflags: -I${includedir}/libgtop-2.0 diff --git a/libgtop.spec.in b/libgtop.spec.in index 5957868e..f4fefa5b 100644 --- a/libgtop.spec.in +++ b/libgtop.spec.in @@ -5,6 +5,7 @@ %define prefix /usr Summary: LibGTop library +Requires: util-linux, sed Name: libgtop Version: %ver Release: %rel diff --git a/src/daemon/main.c b/src/daemon/main.c index 34cbaf50..88e19a09 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -98,7 +98,7 @@ handle_parent_connection (int s) do_output (s, resp, _offset_data (cpu), 0, NULL); break; case GLIBTOP_CMND_DISK: - glibtop_get_disk_l (server, &resp->u.disk.cpu); + glibtop_get_disk_l (server, &resp->u.data.disk); do_output (s, resp, _offset_data (disk), 0, NULL); break; case GLIBTOP_CMND_MEM: diff --git a/src/daemon/slave.c b/src/daemon/slave.c index e15f1efc..6e80b2b8 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -135,6 +135,12 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, resp->offset = _offset_data (cpu); break; #endif +#if GLIBTOP_SUID_DISK + case GLIBTOP_CMND_DISK: + glibtop_get_disk_p (server, &resp->u.data.disk); + resp->offset = _offset_data (disk); + break; +#endif #if GLIBTOP_SUID_MEM case GLIBTOP_CMND_MEM: glibtop_get_mem_p (server, &resp->u.data.mem); diff --git a/sysdeps/common/default.c b/sysdeps/common/default.c index 653a4f5a..ff6c3ecd 100644 --- a/sysdeps/common/default.c +++ b/sysdeps/common/default.c @@ -72,9 +72,9 @@ glibtop_get_cpu(glibtop_cpu *buf) * */ void -glibtop_get_cpu (glibtop_cpu *buf) +glibtop_get_disk (glibtop_disk *buf) { - glibtop_get_cpu_l (glibtop_global_server, buf); + glibtop_get_disk_l (glibtop_global_server, buf); } diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 3ad74bcc..c2d341f6 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -48,7 +48,7 @@ _glibtop_init_disk_s (glibtop *server) // Handle LVM and RAID // void -find_primary_part (_partition_info *primary_part, const char *m) +find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; char name[256]="",type[256]=""; @@ -190,7 +190,7 @@ find_primary_part (_partition_info *primary_part, const char *m) } int -is_virtual_drive (_partition_info *primary_part, const char *p) +is_virtual_drive (partition_info *primary_part, const char *p) { int i; char name[256]; @@ -220,10 +220,27 @@ is_virtual_drive (_partition_info *primary_part, const char *p) return test; } +int +max_lines (const char *p) +{ + char temp[10]; + int count = 0; + + while (sscanf (p, "%s", temp) == 1) + { + + p = skip_line(p); + count++; + + } + + return count; +} + void glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) { - _partition_info primary_part[GLIBTOP_NDISK]; + partition_info primary_part[GLIBTOP_NDISK]; char buffer [STAT_BUFSIZ], *p, map_buffer [STAT_BUFSIZ], *m; int i; @@ -233,8 +250,6 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) get_from_pipe (map_buffer, CMD_PIPE); - server->ndisk = GLIBTOP_NDISK; - /* * GLOBAL */ @@ -246,23 +261,23 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) * PER DISK */ + server->ndisk = max_lines(p); + find_primary_part (primary_part, m); - for (i = 0; i <= server->ndisk; i++) { + for (i = 0; i < server->ndisk; i++) { p = skip_multiple_token (p,2); // skip if disk is the raw device if (!is_virtual_drive (primary_part, p)) { + server->ndisk--; p = skip_line (p); /* move to ^ */ p = skip_multiple_token (p, 2); } - if (!check_disk_line_warn (server, p, i)) - break; - p = skip_token (p); /* prev xdisk_name */ p = skip_token (p); /* prev xdisk_reads_completed */ p = skip_token (p); /* prev xdisk_reads_merged */ diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 66fed54c..39101163 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -62,7 +62,7 @@ skip_line (const char *p) } void -get_from_pipe (char *buffer, const char *cmd) +get_from_pipe (char *buffer, const char *cmd); /* * Smart strtoul which handles binary suffixes diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am index f4219edb..6d9ce727 100644 --- a/sysdeps/stub/Makefile.am +++ b/sysdeps/stub/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am index fcc7daf9..3f1bf958 100644 --- a/sysdeps/stub_suid/Makefile.am +++ b/sysdeps/stub_suid/Makefile.am @@ -7,7 +7,7 @@ libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) -libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c siglist.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/stub_suid/disk.c b/sysdeps/stub_suid/disk.c new file mode 100644 index 00000000..ed5cda02 --- /dev/null +++ b/sysdeps/stub_suid/disk.c @@ -0,0 +1,47 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , April 1998. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_p (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_p (glibtop *server, glibtop_disk *buf) +{ + glibtop_init_p (server, GLIBTOP_SYSDEPS_DISK, 0); + + memset (buf, 0, sizeof (glibtop_disk)); +} From b738a0ae09d793edbde06519e04142cc72e6187c Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 10 Apr 2021 18:20:28 +0800 Subject: [PATCH 048/102] Revert "Revert "Updated config and added reference"" This reverts commit 2229253e11ae5c729a703f0c72e006f46746c592. --- configure.ac | 6 +-- doc/main.texi | 1 + doc/reference.texi | 59 +++++++++++++++++++++++++++++- doc/reference/libgtop-sections.txt | 22 ++--------- include/glibtop/disk.h | 18 ++++----- sysdeps/linux/disk.c | 31 +++++----------- 6 files changed, 84 insertions(+), 53 deletions(-) diff --git a/configure.ac b/configure.ac index 5426daf1..cc1d041f 100644 --- a/configure.ac +++ b/configure.ac @@ -8,16 +8,16 @@ m4_define([libgtop_micro_version], [0]) m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) dnl increment if the interface has additions, changes, removals. -m4_define([libgtop_current], [11]) +m4_define([libgtop_current], [12]) dnl increment any time the source changes; set to dnl 0 if you increment CURRENT -m4_define([libgtop_revision], [1]) +m4_define([libgtop_revision], [0]) dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. -m4_define([libgtop_age], [0]) +m4_define([libgtop_age], [1]) # Increase each time you change the client/server protocol. m4_define([libgtop_server_version], [5]) diff --git a/doc/main.texi b/doc/main.texi index 6945d651..f6a1ddde 100644 --- a/doc/main.texi +++ b/doc/main.texi @@ -49,6 +49,7 @@ System Dependent Functions * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. +* glibtop_disk:: DISK Usage. Common Functions diff --git a/doc/reference.texi b/doc/reference.texi index cdba6887..55970001 100644 --- a/doc/reference.texi +++ b/doc/reference.texi @@ -28,6 +28,7 @@ * glibtop_proc_map:: Process Memory Maps. * glibtop_netload:: Network Load. * glibtop_ppp:: PPP Usage. +* glibtop_disk:: DISK Usage. @end menu @node glibtop_cpu, glibtop_mem, System Dependent, System Dependent @@ -1343,7 +1344,7 @@ enum @{ @end example @page -@node glibtop_ppp, , glibtop_netload, System Dependent +@node glibtop_ppp, glibtop_disk, glibtop_netload, System Dependent @subsection PPP Statistics Library function @code{glibtop_get_ppp}: @@ -1403,6 +1404,62 @@ We're currently offline. We're currently online. @end table +@page +@node glibtop_disk, , glibtop_ppp, System Dependent +@subsection DISK Usage + +Library function @code{glibtop_get_disk}: + +@example +@cartouche +void glibtop_get_disk (glibtop_disk *buf); +void glibtop_get_disk_l (glibtop *server, glibtop_disk *buf); +@end cartouche +@end example + +Declaration of @code{glibtop_disk} in @file{}: + +@example +@cartouche +typedef struct _glibtop_disk glibtop_disk; + +struct _glibtop_disk +@{ + xdisk_sectors_read [GLIBTOP_NDISK], + xdisk_time_read [GLIBTOP_NDISK], + xdisk_sectors_write [GLIBTOP_NDISK], + xdisk_time_write [GLIBTOP_NDISK], +@}; +@end cartouche +@end example + +All DISK reads and writes are measured by @dfn{sectors} which are normally 512 bytes each. +All disk time are measured in milliseconds which is 1/1000th of a second. + +@table @code +@item xdisk_sectors_read +Number of sectors read since system boot. + +@item xdisk_time_read +Number of milliseconds spent reading since system boot. + +@item xdisk_sectors_write +Number of sectors written since system boot. + +@item xdisk_time_write +Number of milliseconds spent writing since system boot. + +@end table + +The @samp{xdisk_} are values from arrays of @code{GLIBTOP_NDISK} (defined in +@file{}) elements and contain one value for each DISK +in the system. + +Please note that all of the disk values are absolute values measured in +certain units since system boot. To get bandwidth values (bytes/s), you need to call @code{glibtop_disk}, save the +result, wait some time and then call it again and divide the differences of +the two values by the time spent reading or writing. + @page @node Common Functions, Library Functions, System Dependent, Reference Manual @section Common Functions diff --git a/doc/reference/libgtop-sections.txt b/doc/reference/libgtop-sections.txt index 3d6d710d..63137481 100644 --- a/doc/reference/libgtop-sections.txt +++ b/doc/reference/libgtop-sections.txt @@ -682,24 +682,10 @@ glibtop_get_cpu_s glibtop/disk.h
disk -GLIBTOP_DISK_TOTAL -GLIBTOP_DISK_USER -GLIBTOP_DISK_NICE -GLIBTOP_DISK_SYS -GLIBTOP_DISK_IDLE -GLIBTOP_DISK_FREQUENCY -GLIBTOP_XDISK_TOTAL -GLIBTOP_XDISK_USER -GLIBTOP_XDISK_NICE -GLIBTOP_XDISK_SYS -GLIBTOP_XDISK_IDLE -GLIBTOP_XDISK_FLAGS -GLIBTOP_DISK_IOWAIT -GLIBTOP_DISK_IRQ -GLIBTOP_DISK_SOFTIRQ -GLIBTOP_XDISK_IOWAIT -GLIBTOP_XDISK_IRQ -GLIBTOP_XDISK_SOFTIRQ +LIBTOP_XDISK_SECTORS_READ +GLIBTOP_XDISK_TIME_READ +GLIBTOP_XDISK_SECTORS_WRITE +GLIBTOP_XDISK_TIME_WRITE GLIBTOP_MAX_DISK GLIBTOP_NDISK glibtop_disk diff --git a/include/glibtop/disk.h b/include/glibtop/disk.h index 292924f6..e444d819 100644 --- a/include/glibtop/disk.h +++ b/include/glibtop/disk.h @@ -28,17 +28,17 @@ G_BEGIN_DECLS #define GLIBTOP_XDISK_SECTORS_READ 0 -#define GLIBTOP_XDISK_TIME_READ 1 +#define GLIBTOP_XDISK_TIME_READ 1 #define GLIBTOP_XDISK_SECTORS_WRITE 2 #define GLIBTOP_XDISK_TIME_WRITE 3 -#define GLIBTOP_MAX_DISK 4 +#define GLIBTOP_MAX_DISK 4 /* Nobody should really be using more than 4 disk. Yes we are :) Nobody should really be using more than 32 disk. */ -#define GLIBTOP_NDISK 1024 +#define GLIBTOP_NDISK 1024 typedef struct _glibtop_disk glibtop_disk; @@ -54,12 +54,12 @@ typedef struct _partition_info partition_info; struct _glibtop_disk { - guint64 flags; - guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ - guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ - guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ - guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ - guint64 xdisk_flags; + guint64 flags; /* NOT USED YET */ + guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */ + guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */ + guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */ + guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */ + guint64 xdisk_flags; }; void glibtop_get_disk (glibtop_disk *buf); diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index c2d341f6..dbd46dff 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -51,7 +51,7 @@ void find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; - char name[256]="",type[256]=""; + char name[256]="", type[256]=""; primary_part->max = 0; @@ -92,18 +92,12 @@ find_primary_part (partition_info *primary_part, const char *m) n--; } - else if ((strcmp (type, "lvm") == 0)) { + else if ((strcmp (type, "lvm") == 0) || (strncmp (type, "raid", 4) == 0)) { tlvl = 2; primary_part->max++; } - else if ((strncmp (type, "raid", 4) == 0)) { - - tlvl = 2; - primary_part->max++; - - } } else if( tlvl == 2){ @@ -115,23 +109,14 @@ find_primary_part (partition_info *primary_part, const char *m) primary_part->max++; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) { + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0) || + (strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { n--; } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { - - n--; - - } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) { - - n--; - tlvl = 1; - - } - else if ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0) || + (strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { n--; tlvl = 1; @@ -171,6 +156,7 @@ find_primary_part (partition_info *primary_part, const char *m) tlvl = 1; } + } @@ -195,11 +181,12 @@ is_virtual_drive (partition_info *primary_part, const char *p) int i; char name[256]; int test = 1; + sscanf (p, "%s", name); if (*p) { - for (i=0; imax; i++) { + for (i=0; i < primary_part->max; i++) { if (strcmp (primary_part[i].name, name) == 0) { From d8603f7692ebcc2b8ed00532b9978eac1e563c20 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 10 Apr 2021 18:29:08 +0800 Subject: [PATCH 049/102] restores original spec files --- libgtop-2.0.pc.in | 2 +- libgtop.spec.in | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/libgtop-2.0.pc.in b/libgtop-2.0.pc.in index 4381ab20..e1753322 100644 --- a/libgtop-2.0.pc.in +++ b/libgtop-2.0.pc.in @@ -5,7 +5,7 @@ includedir=@includedir@ Name: libgtop Description: Portable System Access Library -Requires: glib-2.0, util-linux +Requires: glib-2.0 Version: @VERSION@ Libs: -L${libdir} -lgtop-2.0 Cflags: -I${includedir}/libgtop-2.0 diff --git a/libgtop.spec.in b/libgtop.spec.in index f4fefa5b..5957868e 100644 --- a/libgtop.spec.in +++ b/libgtop.spec.in @@ -5,7 +5,6 @@ %define prefix /usr Summary: LibGTop library -Requires: util-linux, sed Name: libgtop Version: %ver Release: %rel From 572b195407ce3d8c78270b1fce6aa8e692b62ed8 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 08:00:09 +0000 Subject: [PATCH 050/102] Make ndisk comment clear --- glibtop.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glibtop.h b/glibtop.h index c196818c..352654f2 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,8 +80,8 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk */ - int real_ndisk; /* Number of PHYSICAL DISKs. Only ncpu is monitored */ + int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ From ae99056bdf7216e0594172fb6ec370cafe93f44c Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 08:01:24 +0000 Subject: [PATCH 051/102] Fix comment --- glibtop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glibtop.h b/glibtop.h index 352654f2..dd543f7e 100644 --- a/glibtop.h +++ b/glibtop.h @@ -81,7 +81,7 @@ struct _glibtop int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ - int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ From 3644ac0f80f3349a1176f56443cce932426ce975 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 08:04:17 +0000 Subject: [PATCH 052/102] fix comment 2 --- glibtop.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glibtop.h b/glibtop.h index dd543f7e..ed73dad5 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,8 +80,8 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ - int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ + int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ From dd342f648671be0fb52c49511eb6bac35000f2e8 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 08:09:29 +0000 Subject: [PATCH 053/102] Changed `reserved0` to `disk` --- include/glibtop/sysdeps.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h index a1db66d8..1164d449 100644 --- a/include/glibtop/sysdeps.h +++ b/include/glibtop/sysdeps.h @@ -70,7 +70,6 @@ struct _glibtop_sysdeps guint64 flags; guint64 features; /* server features */ guint64 cpu; /* glibtop_cpu */ - guint64 disk; /* glibtop_cpu */ guint64 mem; /* glibtop_mem */ guint64 swap; /* glibtop_swap */ guint64 uptime; /* glibtop_uptime */ @@ -97,7 +96,7 @@ struct _glibtop_sysdeps guint64 proc_wd; /* glibtop_proc_wd */ guint64 proc_affinity; /* glibtop_proc_affinity */ guint64 proc_io; /* glibtop_proc_io */ - guint64 reserved0; + guint64 disk; /* glibtop_disk */ guint64 reserved1; guint64 reserved2; guint64 reserved3; From 7889113b991710ba95ceb2ef90cdd312c12366d0 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 10:33:57 +0000 Subject: [PATCH 054/102] Fix comment --- sysdeps/stub_suid/disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/stub_suid/disk.c b/sysdeps/stub_suid/disk.c index ed5cda02..d83793ba 100644 --- a/sysdeps/stub_suid/disk.c +++ b/sysdeps/stub_suid/disk.c @@ -1,7 +1,7 @@ /* Copyright (C) 1998-99 Martin Baulig This file is part of LibGTop 1.0. - Contributed by Martin Baulig , April 1998. + Contributed by James Dominic P. Guana , May 2020. LibGTop is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From d4ac1eda0752d559db8737773d6894aadc700ce3 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Tue, 20 Apr 2021 10:39:13 +0000 Subject: [PATCH 055/102] Moved new api variables to the bottom of struct. --- glibtop.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/glibtop.h b/glibtop.h index ed73dad5..ee083cea 100644 --- a/glibtop.h +++ b/glibtop.h @@ -80,8 +80,6 @@ struct _glibtop int socket; /* Accepted connection of a socket */ int ncpu; /* Number of CPUs, zero if single-processor */ int real_ncpu; /* Real number of CPUs. Only ncpu are monitored */ - int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ - int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ unsigned long os_version_code; /* Version code of the operating system */ const char *name; /* Program name for error messages */ const char *server_command; /* Command used to invoke server */ @@ -100,6 +98,9 @@ struct _glibtop gid_t egid; glibtop_machine *machine; /* Machine dependent data */ + + int ndisk; /* Number of DISKs, zero if single-disk. This pertains to disk volumes */ + int real_ndisk; /* Number of PHYSICAL DISKs. Only ndisk is monitored for now */ }; extern glibtop *glibtop_global_server; From b9bbdf4c9f2e0452b0cc83bf29d72a611af22586 Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Fri, 23 Apr 2021 12:57:13 +0300 Subject: [PATCH 056/102] Update last ABI break id --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3ca70b09..8a080986 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ variables: FEDORA_DEPENDENCIES_ABI_CHECK: libabigail intltool - LAST_ABI_BREAK: "abccaf488a929de1e95e6a748485575dec52c998" + LAST_ABI_BREAK: "d4ac1eda0752d559db8737773d6894aadc700ce3" UBUNTU_DEPENDENCIES: autoconf automake From b51925dbd9fca8b7d570d16cab8565b2fd99127b Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Fri, 23 Apr 2021 12:57:27 +0300 Subject: [PATCH 057/102] Version bump --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index cc1d041f..b5f1fe61 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,8 @@ dnl Configure script for the Gnome library dnl m4_define([libgtop_major_version], [2]) -m4_define([libgtop_minor_version], [40]) -m4_define([libgtop_micro_version], [0]) +m4_define([libgtop_minor_version], [41]) +m4_define([libgtop_micro_version], [1]) m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) dnl increment if the interface has additions, changes, removals. From 24555c48d05a1f0a84e5258a9afe86bd2dbdd441 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sat, 24 Apr 2021 14:58:33 +0200 Subject: [PATCH 058/102] Copy stub sysdeps files to other OS impls to reduce compile errors. --- sysdeps/aix/Makefile.am | 4 +-- sysdeps/aix/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/aix/glibtop_server.h | 3 +++ sysdeps/aix/procio.c | 43 ++++++++++++++++++++++++++++++ sysdeps/bsd/Makefile.am | 2 +- sysdeps/bsd/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/bsd/glibtop_server.h | 3 +++ sysdeps/bsd/procio.c | 43 ++++++++++++++++++++++++++++++ sysdeps/cygwin/Makefile.am | 2 +- sysdeps/cygwin/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/cygwin/glibtop_server.h | 3 ++- sysdeps/darwin/Makefile.am | 2 +- sysdeps/darwin/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/darwin/glibtop_server.h | 1 + sysdeps/freebsd/Makefile.am | 2 +- sysdeps/freebsd/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/freebsd/glibtop_server.h | 3 ++- sysdeps/linux/glibtop_server.h | 2 +- sysdeps/openbsd/Makefile.am | 2 +- sysdeps/openbsd/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/openbsd/glibtop_server.h | 1 + sysdeps/osf1/Makefile.am | 2 +- sysdeps/osf1/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/osf1/glibtop_server.h | 3 +++ sysdeps/osf1/procio.c | 43 ++++++++++++++++++++++++++++++ sysdeps/solaris/Makefile.am | 2 +- sysdeps/solaris/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/solaris/glibtop_server.h | 3 +++ sysdeps/solaris/procio.c | 43 ++++++++++++++++++++++++++++++ sysdeps/stub/glibtop_server.h | 5 ++-- sysdeps/stub_suid/glibtop_server.h | 2 +- sysdeps/sun4/Makefile.am | 2 +- sysdeps/sun4/disk.c | 42 +++++++++++++++++++++++++++++ sysdeps/sun4/glibtop_server.h | 3 +++ sysdeps/sun4/procio.c | 43 ++++++++++++++++++++++++++++++ 35 files changed, 629 insertions(+), 16 deletions(-) create mode 100644 sysdeps/aix/disk.c create mode 100644 sysdeps/aix/procio.c create mode 100644 sysdeps/bsd/disk.c create mode 100644 sysdeps/bsd/procio.c create mode 100644 sysdeps/cygwin/disk.c create mode 100644 sysdeps/darwin/disk.c create mode 100644 sysdeps/freebsd/disk.c create mode 100644 sysdeps/openbsd/disk.c create mode 100644 sysdeps/osf1/disk.c create mode 100644 sysdeps/osf1/procio.c create mode 100644 sysdeps/solaris/disk.c create mode 100644 sysdeps/solaris/procio.c create mode 100644 sysdeps/sun4/disk.c create mode 100644 sysdeps/sun4/procio.c diff --git a/sysdeps/aix/Makefile.am b/sysdeps/aix/Makefile.am index 2ab38012..6fc527e1 100644 --- a/sysdeps/aix/Makefile.am +++ b/sysdeps/aix/Makefile.am @@ -5,9 +5,9 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la libgtop_sysdeps_2_0_la_SOURCES = siglist.c nosuid.c mem.c swap.c uptime.c \ procargs.c prockernel.c proclist.c procmap.c \ - procmem.c procsegment.c procsignal.c \ + procmem.c procsegment.c procsignal.c disk.c \ proctime.c procuid.c procmem.c utils.c \ - procstate.c sysinfo.c netlist.c + procstate.c sysinfo.c netlist.c procio.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/aix/disk.c b/sysdeps/aix/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/aix/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/aix/glibtop_server.h b/sysdeps/aix/glibtop_server.h index c6eacc42..705d4c13 100644 --- a/sysdeps/aix/glibtop_server.h +++ b/sysdeps/aix/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 @@ -45,6 +46,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/aix/procio.c b/sysdeps/aix/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/aix/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} diff --git a/sysdeps/bsd/Makefile.am b/sysdeps/bsd/Makefile.am index a6692376..1b973987 100644 --- a/sysdeps/bsd/Makefile.am +++ b/sysdeps/bsd/Makefile.am @@ -10,7 +10,7 @@ libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_suid_2_0_la_LIBADD = $(KVM_LIBS) libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ - sem_limits.c procaffinity.c \ + sem_limits.c disk.c procaffinity.c procio.c \ proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c netlist.c \ diff --git a/sysdeps/bsd/disk.c b/sysdeps/bsd/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/bsd/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/bsd/glibtop_server.h b/sysdeps/bsd/glibtop_server.h index ca4dde05..4e5fe35e 100644 --- a/sysdeps/bsd/glibtop_server.h +++ b/sysdeps/bsd/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) #define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) #define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) @@ -47,6 +48,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) #define GLIBTOP_SUID_PROC_WD 0 #define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/bsd/procio.c b/sysdeps/bsd/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/bsd/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} diff --git a/sysdeps/cygwin/Makefile.am b/sysdeps/cygwin/Makefile.am index e3c9f785..4e983a6b 100644 --- a/sysdeps/cygwin/Makefile.am +++ b/sysdeps/cygwin/Makefile.am @@ -2,7 +2,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la -libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c mem.c swap.c \ +libgtop_sysdeps_2_0_la_SOURCES = open.c close.c cpu.c disk.c mem.c swap.c \ uptime.c loadavg.c mountlist.c shm_limits.c msg_limits.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ diff --git a/sysdeps/cygwin/disk.c b/sysdeps/cygwin/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/cygwin/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/cygwin/glibtop_server.h b/sysdeps/cygwin/glibtop_server.h index bfd7cc65..ea29c287 100644 --- a/sysdeps/cygwin/glibtop_server.h +++ b/sysdeps/cygwin/glibtop_server.h @@ -23,6 +23,7 @@ #define __CYGWIN__GLIBTOP_SERVER_H__ #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 @@ -45,6 +46,6 @@ #define GLIBTOP_SUID_PROC_AFFINITY 0 #define GLIBTOP_SUID_PROC_WD 0 #define GLIBTOP_SUID_PPP 0 -#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 #endif /* __CYGWIN__GLIBTOP_SERVER_H__ */ diff --git a/sysdeps/darwin/Makefile.am b/sysdeps/darwin/Makefile.am index dab61b29..33a78353 100644 --- a/sysdeps/darwin/Makefile.am +++ b/sysdeps/darwin/Makefile.am @@ -4,7 +4,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c -libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c \ +libgtop_sysdeps_suid_2_0_la_SOURCES = open.c close.c disk.c \ cpu.c mem.c swap.c uptime.c loadavg.c shm_limits.c msg_limits.c \ sem_limits.c procaffinity.c proclist.c procstate.c procuid.c proctime.c \ procmem.c procsignal.c prockernel.c procsegment.c procargs.c \ diff --git a/sysdeps/darwin/disk.c b/sysdeps/darwin/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/darwin/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/darwin/glibtop_server.h b/sysdeps/darwin/glibtop_server.h index 92c433ab..a6cd922b 100644 --- a/sysdeps/darwin/glibtop_server.h +++ b/sysdeps/darwin/glibtop_server.h @@ -23,6 +23,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) #define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) #define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) diff --git a/sysdeps/freebsd/Makefile.am b/sysdeps/freebsd/Makefile.am index 7cacb707..1a00506a 100644 --- a/sysdeps/freebsd/Makefile.am +++ b/sysdeps/freebsd/Makefile.am @@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c shm_limits.c \ cpu.c msg_limits.c sem_limits.c loadavg.c \ - uptime.c netlist.c fsusage.c mem.c \ + uptime.c netlist.c fsusage.c mem.c disk.c \ mountlist.c procopenfiles.c procwd.c \ procaffinity.c glibtop_private.c open.c diff --git a/sysdeps/freebsd/disk.c b/sysdeps/freebsd/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/freebsd/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/freebsd/glibtop_server.h b/sysdeps/freebsd/glibtop_server.h index 86a02eea..56b1a0d0 100644 --- a/sysdeps/freebsd/glibtop_server.h +++ b/sysdeps/freebsd/glibtop_server.h @@ -38,6 +38,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_UPTIME 0 #define GLIBTOP_SUID_LOADAVG 0 @@ -47,7 +48,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PROC_WD 0 #define GLIBTOP_SUID_PROC_AFFINITY 0 -#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) +#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) #define GLIBTOP_SUID_PROC_OPEN_FILES 0 G_END_DECLS diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h index 43dd9d9f..0d2788c8 100644 --- a/sysdeps/linux/glibtop_server.h +++ b/sysdeps/linux/glibtop_server.h @@ -47,6 +47,6 @@ #define GLIBTOP_SUID_PROC_AFFINITY 0 #define GLIBTOP_SUID_PPP 0 #define GLIBTOP_SUID_PROC_OPEN_FILES 0 -#define GLIBTOP_SUID_PROC_IO 0 +#define GLIBTOP_SUID_PROC_IO 0 #endif /* __LINUX__GLIBTOP_SERVER_H__ */ diff --git a/sysdeps/openbsd/Makefile.am b/sysdeps/openbsd/Makefile.am index 41b4b6b0..97d5f8ad 100644 --- a/sysdeps/openbsd/Makefile.am +++ b/sysdeps/openbsd/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c sysinfo.c \ - cpu.c loadavg.c \ + cpu.c loadavg.c disk.c \ uptime.c netlist.c fsusage.c mem.c \ mountlist.c procopenfiles.c procwd.c \ procaffinity.c glibtop_private.c open.c diff --git a/sysdeps/openbsd/disk.c b/sysdeps/openbsd/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/openbsd/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/openbsd/glibtop_server.h b/sysdeps/openbsd/glibtop_server.h index 54ca8cbb..967bbe4a 100644 --- a/sysdeps/openbsd/glibtop_server.h +++ b/sysdeps/openbsd/glibtop_server.h @@ -41,6 +41,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_UPTIME 0 #define GLIBTOP_SUID_LOADAVG 0 diff --git a/sysdeps/osf1/Makefile.am b/sysdeps/osf1/Makefile.am index 9b87cc88..af2cecab 100644 --- a/sysdeps/osf1/Makefile.am +++ b/sysdeps/osf1/Makefile.am @@ -5,7 +5,7 @@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ uptime.c loadavg.c shm_limits.c msg_limits.c \ - sem_limits.c ppp.c + sem_limits.c ppp.c procio.c disk.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_2_0_la_LIBADD = -lmach diff --git a/sysdeps/osf1/disk.c b/sysdeps/osf1/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/osf1/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/osf1/glibtop_server.h b/sysdeps/osf1/glibtop_server.h index 11b37a4a..70901a14 100644 --- a/sysdeps/osf1/glibtop_server.h +++ b/sysdeps/osf1/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 @@ -45,6 +46,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/osf1/procio.c b/sysdeps/osf1/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/osf1/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} diff --git a/sysdeps/solaris/Makefile.am b/sysdeps/solaris/Makefile.am index 8ca9df04..b3d3d513 100644 --- a/sysdeps/solaris/Makefile.am +++ b/sysdeps/solaris/Makefile.am @@ -8,7 +8,7 @@ libgtop_sysdeps_2_0_la_SOURCES = open.c close.c siglist.c cpu.c mem.c \ proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c \ prockernel.c procsegment.c procargs.c \ - procopenfiles.c \ + procopenfiles.c procio.c disk.c \ procmap.c netload.c ppp.c procdata.c netlist.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/solaris/disk.c b/sysdeps/solaris/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/solaris/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/solaris/glibtop_server.h b/sysdeps/solaris/glibtop_server.h index e57057e0..cac573b5 100644 --- a/sysdeps/solaris/glibtop_server.h +++ b/sysdeps/solaris/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU 0 +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM 0 #define GLIBTOP_SUID_SWAP 0 #define GLIBTOP_SUID_UPTIME 0 @@ -45,6 +46,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD 0 #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/solaris/procio.c b/sysdeps/solaris/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/solaris/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server.h index 0f8bd194..1307efa0 100644 --- a/sysdeps/stub/glibtop_server.h +++ b/sysdeps/stub/glibtop_server.h @@ -46,8 +46,9 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD 0 #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP 0 -#define GLIBTOP_SUID_PROC_WD 0 -#define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_WD 0 +#define GLIBTOP_SUID_PROC_AFFINITY 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/stub_suid/glibtop_server.h b/sysdeps/stub_suid/glibtop_server.h index 15fe2e11..60e960ca 100644 --- a/sysdeps/stub_suid/glibtop_server.h +++ b/sysdeps/stub_suid/glibtop_server.h @@ -45,7 +45,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) -#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) +#define GLIBTOP_SUID_PROC_IO (1 << GLIBTOP_SYSDEPS_PROC_IO) G_END_DECLS diff --git a/sysdeps/sun4/Makefile.am b/sysdeps/sun4/Makefile.am index ec8fc431..a92458b7 100644 --- a/sysdeps/sun4/Makefile.am +++ b/sysdeps/sun4/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = @AM_CPPFLAGS@ noinst_LTLIBRARIES = libgtop_sysdeps-2.0.la libgtop_sysdeps_suid-2.0.la -libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c +libgtop_sysdeps_2_0_la_SOURCES = nosuid.c siglist.c disk.c procio.c libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_2_0_la_LIBADD = -lkvm diff --git a/sysdeps/sun4/disk.c b/sysdeps/sun4/disk.c new file mode 100644 index 00000000..a946fdf5 --- /dev/null +++ b/sysdeps/sun4/disk.c @@ -0,0 +1,42 @@ +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by James Dominic P. Guana , May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_disk = 0; + +/* Init function. */ + +void +_glibtop_init_disk_s (glibtop *server) +{ + server->sysdeps.disk = _glibtop_sysdeps_disk; +} + +/* Provides information about disk usage. */ + +void +glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) +{ + memset (buf, 0, sizeof (glibtop_disk)); +} diff --git a/sysdeps/sun4/glibtop_server.h b/sysdeps/sun4/glibtop_server.h index fa4439a2..123bc429 100644 --- a/sysdeps/sun4/glibtop_server.h +++ b/sysdeps/sun4/glibtop_server.h @@ -25,6 +25,7 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_CPU (1 << GLIBTOP_SYSDEPS_CPU) +#define GLIBTOP_SUID_DISK 0 #define GLIBTOP_SUID_MEM (1 << GLIBTOP_SYSDEPS_MEM) #define GLIBTOP_SUID_SWAP (1 << GLIBTOP_SYSDEPS_SWAP) #define GLIBTOP_SUID_UPTIME (1 << GLIBTOP_SYSDEPS_UPTIME) @@ -45,6 +46,8 @@ G_BEGIN_DECLS #define GLIBTOP_SUID_NETLOAD 0 #define GLIBTOP_SUID_NETLIST 0 #define GLIBTOP_SUID_PPP 0 +#define GLIBTOP_SUID_PROC_OPEN_FILES 0 +#define GLIBTOP_SUID_PROC_IO 0 G_END_DECLS diff --git a/sysdeps/sun4/procio.c b/sysdeps/sun4/procio.c new file mode 100644 index 00000000..a4846aee --- /dev/null +++ b/sysdeps/sun4/procio.c @@ -0,0 +1,43 @@ +/* Copyright (C) 2017 Robert Roth + This file is part of LibGTop. + + Contributed by Robert Roth , February 2017. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_proc_io = 0; + +/* Init function. */ + +void +_glibtop_init_proc_io_s (glibtop *server) +{ + server->sysdeps.proc_io = _glibtop_sysdeps_proc_io; +} + +/* Provides detailed information about a process. */ + +void +glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, + pid_t pid) +{ + memset (buf, 0, sizeof (glibtop_proc_io)); +} From 336d2480d38956d0f474480d54362b33c738f1a8 Mon Sep 17 00:00:00 2001 From: Pawan Chitrakar Date: Sun, 16 May 2021 09:12:47 +0000 Subject: [PATCH 059/102] Update Nepali translation --- po/ne.po | 105 +++++++++++++++++++++++++++---------------------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/po/ne.po b/po/ne.po index beeec056..e004af3e 100644 --- a/po/ne.po +++ b/po/ne.po @@ -12,188 +12,187 @@ msgid "" msgstr "" "Project-Id-Version: libgtop.gnome-2-20.ne\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-30 03:40+0100\n" -"PO-Revision-Date: 2007-12-19 12:53+0545\n" -"Last-Translator: Nabin Gautam \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2021-05-16 14:57+0545\n" +"Last-Translator: Pawan Chitrakar \n" "Language-Team: Nepali \n" "Language: ne\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Language: Nepali\n" -"X-Poedit-Country: NEPAL\n" "X-Poedit-SourceCharset: utf-8\n" -"X-Generator: KBabel 1.11.4\n" -"Plural-Forms: nplurals=2; plural=n !=1\n" +"X-Generator: Poedit 1.8.4\n" +"Plural-Forms: nplurals=2; plural=n !=1;\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "%d बाइट पढ्नुहोस्" msgstr[1] "%d बाइट पढ्नुहोस्" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "डेटा साइज पढ्नुहोस्" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "डेटाको %lu बाइट पढ्नुहोस्" msgstr[1] "डेटाको %lu बाइट पढ्नुहोस्" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "%d बाइट लेख्यो" msgstr[1] "%d बाइट लेख्यो" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "डिबगिङ सक्षम पार्नुहोस्" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "भर्बोज निर्गत सक्षम पार्नुहोस्" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" msgstr "पृष्ठभूमिमा बिभाजन नगर्नुहोस्" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "inetd बाट आह्वान गरिएको" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" -msgstr "उपलब्ध आदेश लाइन विकल्पको पूरै सूची हेर्न '%s --मद्दत' चलाउनुहोस् ।\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"उपलब्ध आदेश रेखा विकल्पको पूरा सूची हेर्न \"%s --help\" चलाउनुहोस् ।\n" +"\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "ह्याङअप" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "रोकावट" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "अन्त्य गर्नुहोस्" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "अवैध निर्देशन" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "पदचिन्ह ट्रयाप" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "परित्याग गर्नुहोस्" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "इएमटी (EMT) त्रुटि" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "उत्प्लावन बिन्दु अपवाद" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "नष्ट गर्नुहोस्" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "बस त्रुटि" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "खण्डीकरण बिखण्डन" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "प्रणाली कलमा खराब तर्क" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "विच्छेद पाइप" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "सचेतक घडी" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "अन्त्य" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "सकेटमा आकस्मिक अवस्था" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "रोक्नुहोस्" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "कुञ्जिपाटी बन्द गर्नुहोस्" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "जारी राख्नुहोस्" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" -msgstr "चाइल्ड वस्तुस्थिति परिवर्तन गरिएको छ" +msgstr "शाखा वस्तुस्थिति परिवर्तन गरिएको छ" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "tty बाट पृष्ठभूमि पढ्नुहोस्" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "tty मा पृष्ठभूमि लेख्नुहोस्" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "I/O अब सम्भव छ" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "सीपीयू (CPU) सीमा नाघ्यो" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "फाइल साइज सीमा नाघ्यो" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "अवास्तविक सचेतक घडी" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "सचेतक घडीको प्रोफाइल हुँदैछ" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "सञ्झ्याल साइज परिवर्तन" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "सूचना अनुरोध" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "प्रयोगकर्ता परिभषित सङ्केत १" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "प्रयोगकर्ता परिभषित सङ्केत २" - From c4ff3788b830a7271ec1943b133f555e995e25e3 Mon Sep 17 00:00:00 2001 From: Alexey Rubtsov Date: Tue, 29 Jun 2021 11:02:37 +0000 Subject: [PATCH 060/102] Update Russian translation --- po/ru.po | 99 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/po/ru.po b/po/ru.po index a4e9f60f..9337fa81 100644 --- a/po/ru.po +++ b/po/ru.po @@ -8,19 +8,20 @@ msgid "" msgstr "" "Project-Id-Version: libgtop trunk\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-05 19:11+0400\n" -"PO-Revision-Date: 2007-09-05 15:01+0200\n" -"Last-Translator: Nickolay V. Shmyrev \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2021-06-29 10:09+0300\n" +"Last-Translator: Alexey Rubtsov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" -"10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Poedit 3.0\n" -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" @@ -28,11 +29,11 @@ msgstr[0] "прочитан %d байт" msgstr[1] "прочитано %d байта" msgstr[2] "прочитано %d байтов" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "размер прочитанных данных" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" @@ -40,7 +41,7 @@ msgstr[0] "прочитан %lu байт данных" msgstr[1] "прочитано %lu байта данных" msgstr[2] "прочитано %lu байт данных" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" @@ -48,149 +49,149 @@ msgstr[0] "записан %d байт" msgstr[1] "записано %d байта" msgstr[2] "записано %d байт" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Включить отладку" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Включить подробный вывод" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" msgstr "Не разветвлять в фоновый режим" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Вызван из inetd" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Используйте \"%s --help\", чтобы увидеть полный список допустимых параметров " +"Выполните команду «%s --help», чтобы увидеть полный список доступных опций " "командной строки.\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Разорвать" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Прервать" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Выйти" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Недопустимая инструкция" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Захват трассировки" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Прекратить" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "Ошибка EMT" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Исключение плавающей точки" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Убить" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Ошибка шины" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Нарушение сегментации" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Неверный аргумент в системном вызове" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Нарушенный канал" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Таймер" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Завершение" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Требующие внимания условия сокета" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Остановить" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Останов клавиатуры" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Продолжить" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "Состояние потомка было изменено" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Фоновое чтение из tty" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Фоновая запись в tty" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "Сейчас возможен ввод/вывод" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "Превышен предел ЦПУ" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "Превышен предел размера файла" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Виртуальный таймер" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Профилированный таймер" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Изменение размера окна" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Запрос информации" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "Сигнал пользователя 1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "Сигнал пользователя 2" From 6b60695f99d08895ea526daad17d83839c53f382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20PAG=C3=88S?= Date: Sun, 4 Jul 2021 16:58:25 +0000 Subject: [PATCH 061/102] Update Occitan translation --- po/oc.po | 102 +++++++++++++++++++++++++++---------------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/po/oc.po b/po/oc.po index c10218de..17890857 100644 --- a/po/oc.po +++ b/po/oc.po @@ -7,188 +7,188 @@ msgid "" msgstr "" "Project-Id-Version: libgtop 2.9.91\n" -"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?" -"product=libgtop&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2016-05-05 20:08+0000\n" -"PO-Revision-Date: 2016-05-05 21:47+0200\n" -"Last-Translator: Cédric Valmary (totenoc.eu) \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2021-07-04 18:57+0200\n" +"Last-Translator: Quentin PAGÈS\n" "Language-Team: Tot En Òc\n" "Language: oc\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Virtaal 0.7.1\n" +"X-Generator: Poedit 3.0\n" "X-Project-Style: gnome\n" -#: ../lib/read.c:49 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "%d octet legit" msgstr[1] "%d octets legits" -#: ../lib/read_data.c:49 +#: lib/read_data.c:49 msgid "read data size" msgstr "talha de las donadas legidas" -#: ../lib/read_data.c:66 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "lectura de %lu octet de donadas" msgstr[1] "lectura de %lu octets de donadas" -#: ../lib/write.c:49 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "escritura de %d octet" msgstr[1] "escritura de %d octets" -#: ../src/daemon/gnuserv.c:456 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Activa lo desbugatge" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Activa la sortida verbosa" -#: ../src/daemon/gnuserv.c:460 -msgid "Don't fork into background" -msgstr "Aviar pas en prètzfait de fons" +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Aviar pas en prètzfait de rèireplan" -#: ../src/daemon/gnuserv.c:462 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Invocat a partir d'inetd" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" +msgid "" +"Run “%s --help” to see a full list of available command line options.\n" msgstr "" -"Aviar « %s --help » per afichar la lista de las opcions de la linha de " -"comanda.\n" +"Executar « %s --help » per afichar la lista de las opcions de la linha " +"de comanda.\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Hangup" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Interrupcion" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Quitar" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Instruccion illegala" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Punt d'arrèst rencontrat" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Anullacion" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "Error EMT" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Excepcion virgula flotanta" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Tuar" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Error bus" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Violacion de segmentacion" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Marrit argument d'apèl sistèma" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Tub copat" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Alarma de relòtge" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Senhal de fin" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Condicion urgenta sus socket" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Arrèst" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Arrèst dempuèi lo clavièr" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Contunhar" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "L'estat del filh a cambiat" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Lectura sus tty en rèireplan" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Escritura sus tty en rèireplan" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "E/S ara possibla" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "Limit de temps CPU depassat" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "Talha de fichièr excessiva" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Alarma virtuala" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Perfil de l'alarma" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Redimensionament de la fenèstra" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Demanda d'informacion" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "Senhal utilizaire 1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "Senhal utilizaire 2" From a5b2b6db98b748147c8a732a408ab4ebb30b7c0e Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Tue, 24 Aug 2021 00:54:06 +0200 Subject: [PATCH 062/102] Replace Bugzilla link with link to GitLab --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b5f1fe61..d31d9776 100644 --- a/configure.ac +++ b/configure.ac @@ -27,7 +27,7 @@ m4_define([libgtop_version_code], [m4_eval(libgtop_major_version * 1000000 + lib AC_PREREQ(2.62) AC_INIT([libgtop], [libgtop_version], - [http://bugzilla.gnome.org/enter_bug.cgi?product=libgtop]) + [https://gitlab.gnome.org/GNOME/libgtop/-/issues/]) AC_CONFIG_SRCDIR(copyright.txt) AC_CONFIG_HEADERS(config.h) From 027c959fa045a22af5b47e769cad13d2cd53fa14 Mon Sep 17 00:00:00 2001 From: Naala Nanba Date: Tue, 8 Feb 2022 21:15:11 +0000 Subject: [PATCH 063/102] Add Abkhazian translation --- po/LINGUAS | 1 + po/ab.po | 189 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+) create mode 100644 po/ab.po diff --git a/po/LINGUAS b/po/LINGUAS index bc50b017..dace747c 100644 --- a/po/LINGUAS +++ b/po/LINGUAS @@ -1,5 +1,6 @@ # # please keep this list sorted alphabetically +ab am ar as diff --git a/po/ab.po b/po/ab.po new file mode 100644 index 00000000..2b97cfb4 --- /dev/null +++ b/po/ab.po @@ -0,0 +1,189 @@ +# Abkhazian translation for libgtop. +# Copyright (C) 2022 libgtop's COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# Нанба Наала , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: libgtop master\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2021-09-12 23:06+0000\n" +"PO-Revision-Date: 2021-09-12 23:06+0000\n" +"Last-Translator: Нанба Наала \n" +"Language-Team: Abkhazian \n" +"Language: ab\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-DamnedLies-Scope: partial\n" + +#: lib/read.c:49 +#, c-format +msgid "read %d byte" +msgid_plural "read %d bytes" +msgstr[0] "%d баит шәрыԥхьахьеит" +msgstr[1] "%d баит шәрыԥхьахьеит" + +#: lib/read_data.c:49 +msgid "read data size" +msgstr "егьырҭ адыррақәа ршәага" + +#: lib/read_data.c:66 +#, c-format +msgid "read %lu byte of data" +msgid_plural "read %lu bytes of data" +msgstr[0] "%lu баитк адыррақәа ирыԥхьоуп" +msgstr[1] "%lu баитк адыррақәа ирыԥхьоуп" + +#: lib/write.c:49 +#, c-format +msgid "wrote %d byte" +msgid_plural "wrote %d bytes" +msgstr[0] "иҭаҩҩуп %d баитк" +msgstr[1] "иҭаҩҩуп %d баитк" + +#: src/daemon/gnuserv.c:456 +msgid "Enable debugging" +msgstr "Аиқәыршәара аҿакра" + +#: src/daemon/gnuserv.c:458 +msgid "Enable verbose output" +msgstr "Иԥкаау алкаа аҿакра" + +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "Ақәыԥшыларатә режим аиҿымгара" + +#: src/daemon/gnuserv.c:462 +msgid "Invoked from inetd" +msgstr "inetd аҟынтә ицәыргоуп" + +#: src/daemon/gnuserv.c:498 +#, c-format +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "Инашәыгӡа адҵа «%s --help», ишәзыманшәалоу адҵатә цәаҳәа алшарақәа резыкхьӡынҵа нарҭбааны ишәбарц азы.\n" + +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 +msgid "Hangup" +msgstr "Аԥжәара" + +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 +msgid "Interrupt" +msgstr "Аҟәыхра" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "Аҭыҵра" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "Иақәнагам абжьгара" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" +msgstr "Амҩалгара акра" + +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 +msgid "Abort" +msgstr "Аҟәыҵра" + +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 +msgid "EMT error" +msgstr "EMT агха " + +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 +msgid "Floating-point exception" +msgstr "Иӡсуа акәаԥ алцара" + +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 +msgid "Kill" +msgstr "Ашьра" + +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 +msgid "Bus error" +msgstr "Аҭелцаха агха" + +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 +msgid "Segmentation violation" +msgstr "Агҿаԥҵәара аилагара" + +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 +msgid "Bad argument to system call" +msgstr "Ииашам аҵаҵӷәы асистематә ааԥхьараҟны" + +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 +msgid "Broken pipe" +msgstr "Ацышьҭа аилагара" + +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 +msgid "Alarm clock" +msgstr "Аамҭарбага" + +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 +msgid "Termination" +msgstr "Ахырқәшара" + +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 +msgid "Urgent condition on socket" +msgstr "Азҿлымҳара зҭаху асокет азыҳәарақәа" + +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 +msgid "Stop" +msgstr "Аанкылара" + +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 +msgid "Keyboard stop" +msgstr "Арыдыкырақәа раанкылара" + +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 +msgid "Continue" +msgstr "Ацҵара" + +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 +msgid "Child status has changed" +msgstr "Ахылҵ иҭагылазаашьа ԥсахын" + +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 +msgid "Background read from tty" +msgstr "Ақәыԥшыларала аԥхьара tty аҟынтә" + +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 +msgid "Background write to tty" +msgstr "Ақәыԥшыларатә нҵамҭа tty аҟны" + +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 +msgid "I/O now possible" +msgstr "Уажәы иалшахоит аҭагалара/аҭгара" + +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 +msgid "CPU limit exceeded" +msgstr "ЦПУ анаӡара иахысит" + +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 +msgid "File size limit exceeded" +msgstr "Афаил амҿхак анаӡара иахысит" + +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 +msgid "Virtual alarm clock" +msgstr "Ихыҭҳәаау аамҭарбага" + +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 +msgid "Profiling alarm clock" +msgstr "Нада-аадала еиҟароу аамҭарбага" + +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 +msgid "Window size change" +msgstr "Аԥенџьыр ашәага аԥсахра" + +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 +msgid "Information request" +msgstr "Аинформациа азыҳәара" + +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 +msgid "User defined signal 1" +msgstr "Ахархәаҩ 1 идырга " + +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 +msgid "User defined signal 2" +msgstr "Ахархәаҩ 2 идырга " From e48d1a9c384c6d5c46cf8e09b8c4117bf8b303a9 Mon Sep 17 00:00:00 2001 From: Yosef Or Boczko Date: Mon, 14 Feb 2022 15:00:20 +0000 Subject: [PATCH 064/102] Update Hebrew translation --- po/he.po | 105 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 50 deletions(-) diff --git a/po/he.po b/po/he.po index 8bef2bdf..def361b3 100644 --- a/po/he.po +++ b/po/he.po @@ -3,191 +3,196 @@ # This file is distributed under the same license as the PACKAGE package. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # Gil 'Dolfin' Osher , 2003 +# Yosef Or Boczko , 2022. # msgid "" msgstr "" "Project-Id-Version: libgtop.libgtop-GNOME-2-0-port.he\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2007-09-30 03:40+0100\n" -"PO-Revision-Date: 2003-03-18 18:06+0200\n" -"Last-Translator: Yair Hershkovitz \n" -"Language-Team: Hebrew \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2020-05-29 05:44+0000\n" +"PO-Revision-Date: 2022-02-14 16:59+0200\n" +"Last-Translator: Yosef Or Boczko \n" +"Language-Team: Hebrew <>\n" "Language: he\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: KBabel 1.0\n" +"X-Generator: Gtranslator 40.0\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" # *** This library should not be translated (only copy the english msgs) *** # *** Old hebrew translation is commented for backup sake *** -#: ../lib/read.c:51 +#: lib/read.c:49 #, c-format msgid "read %d byte" msgid_plural "read %d bytes" msgstr[0] "read %d byte" msgstr[1] "read %d bytes" -#: ../lib/read_data.c:51 +#: lib/read_data.c:49 msgid "read data size" msgstr "read data size" -#: ../lib/read_data.c:70 +#: lib/read_data.c:66 #, c-format msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" msgstr[0] "read %lu byte of data" msgstr[1] "read %lu bytes of data" -#: ../lib/write.c:51 +#: lib/write.c:49 #, c-format msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "wrote %d byte" msgstr[1] "wrote %d bytes" -#: ../src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" msgstr "Enable debugging" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" msgstr "Enable verbose output" -#: ../src/daemon/gnuserv.c:462 -msgid "Don't fork into background" -msgstr "Don't fork into background" +#: src/daemon/gnuserv.c:460 +#| msgid "Don't fork into background" +msgid "Don’t fork into background" +msgstr "Don’t fork into background" -#: ../src/daemon/gnuserv.c:464 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" msgstr "Invoked from inetd" -#: ../src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:498 #, c-format -msgid "Run '%s --help' to see a full list of available command line options.\n" -msgstr "Run '%s --help' to see a full list of available command line options.\n" +#| msgid "" +#| "Run '%s --help' to see a full list of available command line options.\n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "" +"Run “%s --help” to see a full list of available command line options.\n" -#: ../sysdeps/osf1/siglist.c:27 ../sysdeps/sun4/siglist.c:27 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" msgstr "Hangup" -#: ../sysdeps/osf1/siglist.c:28 ../sysdeps/sun4/siglist.c:28 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" msgstr "Interrupt" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 msgid "Quit" msgstr "Quit" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 msgid "Illegal instruction" msgstr "Illegal instruction" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" msgstr "Trace trap" -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "Abort" -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "EMT error" -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" msgstr "Floating-point exception" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" msgstr "Kill" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" msgstr "Bus error" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" msgstr "Segmentation violation" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" msgstr "Bad argument to system call" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" msgstr "Broken pipe" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" msgstr "Alarm clock" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" msgstr "Termination" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" msgstr "Urgent condition on socket" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "Stop" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" msgstr "Keyboard stop" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "Continue" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" msgstr "Child status has changed" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" msgstr "Background read from tty" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" msgstr "Background write to tty" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" msgstr "I/O now possible" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" msgstr "CPU limit exceeded" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" msgstr "File size limit exceeded" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" msgstr "Virtual alarm clock" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" msgstr "Profiling alarm clock" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" msgstr "Window size change" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" msgstr "Information request" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" msgstr "User defined signal 1" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "User defined signal 2" From 48ad21d3293148034e11c3b85b23733b7cc708c6 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Wed, 15 Sep 2021 16:00:56 +0000 Subject: [PATCH 065/102] Skip loop and rom --- sysdeps/linux/disk.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index dbd46dff..3a8d9e09 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -66,7 +66,13 @@ find_primary_part (partition_info *primary_part, const char *m) if (tlvl == 0) { - if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { + + n--; + tlvl = 0; + + } + else if (strcmp (type, "disk") == 0) { primary_part->max++; @@ -80,7 +86,13 @@ find_primary_part (partition_info *primary_part, const char *m) } else if(tlvl == 1){ - if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { + + n--; + tlvl = 0; + + } + else if (strcmp (type, "disk") == 0) { n--; tlvl = 0; @@ -102,7 +114,13 @@ find_primary_part (partition_info *primary_part, const char *m) } else if( tlvl == 2){ - if (strcmp(type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { + + n--; + tlvl = 0; + + } + else if (strcmp(type, "disk") == 0) { n--; tlvl = 0; @@ -132,7 +150,13 @@ find_primary_part (partition_info *primary_part, const char *m) } else if (tlvl == 3) { - if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { + + n--; + tlvl = 0; + + } + else if (strcmp (type, "disk") == 0) { n--; tlvl = 0; From e68d20f739e6e3ea9ec601831f55d2b51fd81d85 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Wed, 15 Sep 2021 16:27:46 +0000 Subject: [PATCH 066/102] Skip loop and rom --- sysdeps/linux/disk.c | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 3a8d9e09..f79c1a06 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -66,13 +66,7 @@ find_primary_part (partition_info *primary_part, const char *m) if (tlvl == 0) { - if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { - - n--; - tlvl = 0; - - } - else if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0 || strcmp (type, "disk") == 0) { primary_part->max++; @@ -86,13 +80,7 @@ find_primary_part (partition_info *primary_part, const char *m) } else if(tlvl == 1){ - if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { - - n--; - tlvl = 0; - - } - else if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0 || strcmp (type, "disk") == 0) { n--; tlvl = 0; @@ -114,13 +102,7 @@ find_primary_part (partition_info *primary_part, const char *m) } else if( tlvl == 2){ - if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { - - n--; - tlvl = 0; - - } - else if (strcmp(type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0 || strcmp(type, "disk") == 0) { n--; tlvl = 0; @@ -150,13 +132,7 @@ find_primary_part (partition_info *primary_part, const char *m) } else if (tlvl == 3) { - if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0) { - - n--; - tlvl = 0; - - } - else if (strcmp (type, "disk") == 0) { + if (strcmp (type, "loop") == 0 || strcmp (type, "rom") == 0 || strcmp (type, "disk") == 0) { n--; tlvl = 0; From 246ec92cab64db5d966f197aa910d647570798b2 Mon Sep 17 00:00:00 2001 From: Josselin Mouette Date: Fri, 29 Jan 2016 11:37:37 +0100 Subject: [PATCH 067/102] daemon: Install to libexecdir, not bindir https://bugzilla.gnome.org/show_bug.cgi?id=602664 https://gitlab.gnome.org/GNOME/libgtop/-/issues/17 --- configure.ac | 4 ++-- libgtop-sysdeps.m4 | 14 +++++++------- src/daemon/Makefile.am | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index d31d9776..3ebd2103 100644 --- a/configure.ac +++ b/configure.ac @@ -295,8 +295,8 @@ libgtop_save_prefix="$prefix" libgtop_save_exec_prefix="$exec_prefix" test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=$prefix -LIBGTOP_BINDIR=`eval echo "${bindir}"` -LIBGTOP_SERVER=`eval echo "${bindir}/libgtop_server2"` +LIBGTOP_BINDIR=`eval echo "${libexecdir}"` +LIBGTOP_SERVER=`eval echo "${libexecdir}/libgtop_server2"` prefix="$libgtop_save_prefix" exec_prefix="$libgtop_save_exec_prefix" diff --git a/libgtop-sysdeps.m4 b/libgtop-sysdeps.m4 index b363dae0..f7a2405d 100644 --- a/libgtop-sysdeps.m4 +++ b/libgtop-sysdeps.m4 @@ -36,43 +36,43 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ libgtop_need_server=yes libgtop_sysdeps_private_mountlist=yes libgtop_sysdeps_private_fsusage=yes - libgtop_postinstall='chown root $(bindir)/libgtop_server2 && chmod 4755 $(bindir)/libgtop_server2' + libgtop_postinstall='chown root $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod 4755 $(DESTDIR)$(libexecdir)/libgtop_server2' ;; netbsd*|bsdi*) libgtop_sysdeps_dir=bsd libgtop_need_server=yes - libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + libgtop_postinstall='chgrp kmem $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod 2755 $(DESTDIR)$(libexecdir)/libgtop_server2' ;; openbsd*) libgtop_sysdeps_dir=openbsd libgtop_need_server=yes libgtop_sysdeps_private_mountlist=yes libgtop_sysdeps_private_fsusage=yes - libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2555 $(bindir)/libgtop_server2' + libgtop_postinstall='chgrp kmem $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod 2555 $(DESTDIR)$(libexecdir)/libgtop_server2' ;; freebsd*|kfreebsd*) libgtop_sysdeps_dir=freebsd libgtop_need_server=yes libgtop_sysdeps_private_mountlist=yes libgtop_sysdeps_private_fsusage=yes - libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 2755 $(bindir)/libgtop_server2' + libgtop_postinstall='chgrp kmem $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod 2755 $(DESTDIR)$(libexecdir)/libgtop_server2' ;; solaris*) libgtop_sysdeps_dir=solaris libgtop_need_server=yes - libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 $(bindir)/libgtop_server' + libgtop_postinstall='chgrp sys $(DESTDIR)$(libexecdir)/libgtop_server && chmod 2755 $(DESTDIR)$(libexecdir)/libgtop_server' ;; aix*) libgtop_sysdeps_dir=aix libgtop_need_server=yes libgtop_have_sysinfo=yes - libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod g+s $(bindir)/libgtop_server2' + libgtop_postinstall='chgrp system $(DESTDIR)$(libexecdir)/libgtop_server && chmod g+s $(DESTDIR)$(libexecdir)/libgtop_server2' ;; darwin*) libgtop_sysdeps_dir=darwin libgtop_need_server=yes libgtop_have_sysinfo=yes - libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod g+s $(bindir)/libgtop_server2' + libgtop_postinstall='chgrp kmem $(DESTDIR)$(libexecdir)/libgtop_server2 && chmod g+s $(DESTDIR)$(libexecdir)/libgtop_server2' ;; cygwin*) libgtop_sysdeps_dir=cygwin diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index f29d0a62..33d9a10d 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -26,7 +26,7 @@ suid_sysdeps = suid_common = endif -bin_PROGRAMS = libgtop_daemon2 @server_programs@ +libexec_PROGRAMS = libgtop_daemon2 @server_programs@ EXTRA_PROGRAMS = libgtop_server2 From cfe1ef95d47143fb47e24f57e60821e3f9f1423e Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 2 Feb 2022 16:57:09 +0000 Subject: [PATCH 068/102] daemon: Do not attempt chown/chmod with DESTDIR https://gitlab.gnome.org/GNOME/libgtop/-/issues/48 --- src/daemon/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/daemon/Makefile.am b/src/daemon/Makefile.am index 33d9a10d..e7eb1f28 100644 --- a/src/daemon/Makefile.am +++ b/src/daemon/Makefile.am @@ -52,5 +52,5 @@ libgtop_server2_LDADD = $(top_builddir)/lib/libgtop-2.0.la \ EXTRA_DIST = server_config.h.in server_config.pl install-exec-hook: - -@libgtop_postinstall@ + -test -n "$(DESTDIR)" || @libgtop_postinstall@ From b1b05985b13f7bea410ee188782469fa76e09f74 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 10 Jan 2022 18:27:36 +0100 Subject: [PATCH 069/102] Change some openbsd errors to warnings This allows the gnome-system-monitor to run. It causes continous log spam and the network monitor doesn't work, but it doesn't crash on startup anymore. --- sysdeps/openbsd/netload.c | 4 ++-- sysdeps/openbsd/ppp.c | 2 +- sysdeps/openbsd/suid_open.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/openbsd/netload.c b/sysdeps/openbsd/netload.c index 60c6ae9a..8b9e2132 100644 --- a/sysdeps/openbsd/netload.c +++ b/sysdeps/openbsd/netload.c @@ -78,7 +78,7 @@ _glibtop_init_netload_p (glibtop *server) server->sysdeps.netload = _glibtop_sysdeps_netload; if (kvm_nlist (server->machine->kd, nlst) < 0) - glibtop_error_io_r (server, "kvm_nlist"); + glibtop_warn_io_r (server, "kvm_nlist"); } /* Provides Network statistics. */ @@ -103,7 +103,7 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, if (kvm_read (server->machine->kd, nlst [0].n_value, &ifnetaddr, sizeof (ifnetaddr)) != sizeof (ifnetaddr)) - glibtop_error_io_r (server, "kvm_read (ifnet)"); + glibtop_warn_io_r (server, "kvm_read (ifnet)"); while (ifnetaddr) { struct sockaddr_in *sin; diff --git a/sysdeps/openbsd/ppp.c b/sysdeps/openbsd/ppp.c index 44032725..7b51cafa 100644 --- a/sysdeps/openbsd/ppp.c +++ b/sysdeps/openbsd/ppp.c @@ -78,7 +78,7 @@ _glibtop_init_ppp_p (glibtop *server) #endif /* HAVE_I4B */ if (kvm_nlist (server->machine->kd, nlst) < 0) - glibtop_error_io_r (server, "kvm_nlist"); + glibtop_warn_io_r (server, "kvm_nlist"); } /* Provides information about ppp usage. */ diff --git a/sysdeps/openbsd/suid_open.c b/sysdeps/openbsd/suid_open.c index a25586b1..6c507684 100644 --- a/sysdeps/openbsd/suid_open.c +++ b/sysdeps/openbsd/suid_open.c @@ -72,7 +72,7 @@ glibtop_open_p (glibtop *server, const char *program_name, server->machine->kd = kvm_openfiles (NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (server->machine->kd == NULL) - glibtop_error_io_r (server, "kvm_open"); + glibtop_error_io_r (server, "kvm_openfiles"); /* Drop priviledges. */ From 1cb23c7b83cde737944a5b0ab7e142eea6417c19 Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Mon, 20 Dec 2021 12:59:41 +0530 Subject: [PATCH 070/102] Place parentheses to silence clang warnings --- sysdeps/linux/disk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index f79c1a06..86d19652 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -109,14 +109,14 @@ find_primary_part (partition_info *primary_part, const char *m) primary_part->max++; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0) || - (strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0)) { + else if (((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "lvm") == 0)) || + ((strcmp (primary_part[n-1].type, "raid") == 0) && (strncmp (type, "raid", 4) == 0))) { n--; } - else if ((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0) || - (strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0)) { + else if (((strcmp (primary_part[n-1].type, "lvm") == 0) && (strcmp (type, "part") == 0)) || + ((strcmp (primary_part[n-1].type, "raid") == 0) && (strcmp (type, "part") == 0))) { n--; tlvl = 1; From f5ced2028d1edb81c710c756859b9abb0d866e16 Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Mon, 20 Dec 2021 13:04:40 +0530 Subject: [PATCH 071/102] Declare functions as `static` to silence clang warnings --- sysdeps/linux/disk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 86d19652..89acd686 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -47,7 +47,7 @@ _glibtop_init_disk_s (glibtop *server) // Handle LVM and RAID // -void +static void find_primary_part (partition_info *primary_part, const char *m) { int n = 0, tlvl = 0; @@ -175,7 +175,7 @@ find_primary_part (partition_info *primary_part, const char *m) } } -int +static int is_virtual_drive (partition_info *primary_part, const char *p) { int i; @@ -207,7 +207,7 @@ is_virtual_drive (partition_info *primary_part, const char *p) return test; } -int +static int max_lines (const char *p) { char temp[10]; From 7e9fed1513a7937b62bae641b76cee405c6add5a Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Mon, 20 Dec 2021 13:16:44 +0530 Subject: [PATCH 072/102] Use correct format specifiers --- src/daemon/io.c | 6 +++--- src/daemon/main.c | 10 +++++----- src/daemon/slave.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/daemon/io.c b/src/daemon/io.c index 36c526f5..c3a504a1 100644 --- a/src/daemon/io.c +++ b/src/daemon/io.c @@ -27,7 +27,7 @@ void do_output (int s, glibtop_response *resp, off_t offset, size_t data_size, const void *data) { - glibtop_debug ("Really writing %d bytes at offset %lu.", + glibtop_debug ("Really writing %zu bytes at offset %lu.", sizeof (glibtop_response), offset); resp->offset = offset; @@ -42,7 +42,7 @@ do_output (int s, glibtop_response *resp, off_t offset, } if (resp->data_size) { - glibtop_debug ("Writing %d bytes of data.", resp->data_size); + glibtop_debug ("Writing %lu bytes of data.", resp->data_size); if (s == 0) { if (write (1, data, resp->data_size) < 0) @@ -84,7 +84,7 @@ do_read (int s, void *ptr, size_t total_size) tmp_ptr += nread; ptr = tmp_ptr; - glibtop_debug ("READ (%d): %d - %d - %d", + glibtop_debug ("READ (%d): %zu - %zu - %zu", nread, already_read, remaining, total_size); } diff --git a/src/daemon/main.c b/src/daemon/main.c index 88e19a09..cd940353 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -49,7 +49,7 @@ handle_parent_connection (int s) glibtop_server_features); if (enable_debug) - syslog_message (LOG_DEBUG, "SIZEOF: %u - %u - %u - %u - %u - %u", + syslog_message (LOG_DEBUG, "SIZEOF: %zu - %zu - %zu - %zu - %zu - %zu", sizeof (glibtop_command), sizeof (glibtop_response), sizeof (glibtop_mountentry), sizeof (glibtop_union), sizeof (glibtop_sysdeps), @@ -58,12 +58,12 @@ handle_parent_connection (int s) while (do_read (s, cmnd, sizeof (glibtop_command))) { if (enable_debug) syslog_message (LOG_DEBUG, - "Parent (%d) received command %llu from client.", + "Parent (%d) received command %lu from client.", getpid (), cmnd->command); if (cmnd->data_size >= BUFSIZ) { syslog_message (LOG_WARNING, - "Client sent %llu bytes, but buffer is %lu", + "Client sent %lu bytes, but buffer is %lu", cmnd->data_size, (unsigned long)BUFSIZ); return; } @@ -74,7 +74,7 @@ handle_parent_connection (int s) if (cmnd->data_size) { if (enable_debug) - syslog_message (LOG_DEBUG, "Client has %llu bytes of data.", + syslog_message (LOG_DEBUG, "Client has %lu bytes of data.", cmnd->data_size); do_read (s, parameter, cmnd->data_size); @@ -244,7 +244,7 @@ handle_parent_connection (int s) 0, NULL); break; default: - syslog_message (LOG_ERR, "Parent received unknown command %llu.", + syslog_message (LOG_ERR, "Parent received unknown command %lu.", cmnd->command); break; } diff --git a/src/daemon/slave.c b/src/daemon/slave.c index 6e80b2b8..80b2b5ab 100644 --- a/src/daemon/slave.c +++ b/src/daemon/slave.c @@ -42,10 +42,10 @@ handle_slave_connection (int input, int output) while (do_read (input, cmnd, sizeof (glibtop_command))) { glibtop_debug ("Slave %d received command " - "%llu from client.", getpid (), cmnd->command); + "%lu from client.", getpid (), cmnd->command); if (cmnd->data_size >= BUFSIZ) - glibtop_error ("Client sent %llu bytes, " + glibtop_error ("Client sent %lu bytes, " "but buffer is %lu", cmnd->size, (unsigned long)BUFSIZ); @@ -54,7 +54,7 @@ handle_slave_connection (int input, int output) memset (parameter, 0, sizeof (parameter)); if (cmnd->data_size) { - glibtop_debug ("Client has %llu bytes of data.", + glibtop_debug ("Client has %lu bytes of data.", cmnd->data_size); do_read (input, parameter, cmnd->data_size); @@ -261,7 +261,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp, break; #endif default: - glibtop_error ("Child received unknown command %llu", + glibtop_error ("Child received unknown command %lu", cmnd->command); break; } From df6393ac0cd785727329a97f731a4067334c0ace Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Mon, 20 Dec 2021 13:33:42 +0530 Subject: [PATCH 073/102] Pass correct parameter --- src/daemon/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index cd940353..47a94586 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -226,8 +226,9 @@ handle_parent_connection (int s) 0, NULL); break; case GLIBTOP_CMND_PROC_IO: + memcpy (&pid, parameter, sizeof (pid_t)); glibtop_get_proc_io_l - (server, &resp->u.data.proc_io, parameter); + (server, &resp->u.data.proc_io, pid); do_output (s, resp, _offset_data (proc_io), 0, NULL); break; From fca7a38be891571f8962fc82901215867738f7fd Mon Sep 17 00:00:00 2001 From: Avinash Sonawane Date: Mon, 20 Dec 2021 11:57:57 +0530 Subject: [PATCH 074/102] Remove obsolete macro AC_HEADER_TIME --- configure.ac | 4 +++- include/glibtop/global.h | 10 ++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/configure.ac b/configure.ac index 3ebd2103..5686c5ba 100644 --- a/configure.ac +++ b/configure.ac @@ -120,10 +120,12 @@ AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_STRUCT_ST_RDEV -AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UID_T +dnl Check sys/time.h +AC_CHECK_HEADERS([sys/time.h]) + dnl For SunOS AC_CHECK_TYPE(ssize_t, int) AC_CHECK_HEADERS(memory.h) diff --git a/include/glibtop/global.h b/include/glibtop/global.h index bd29802c..beb26b26 100644 --- a/include/glibtop/global.h +++ b/include/glibtop/global.h @@ -28,17 +28,11 @@ #endif /* _IN_LIBGTOP */ -#if TIME_WITH_SYS_TIME +#if HAVE_SYS_TIME_H # include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif #endif +#include #include #include From b381fe4e5c01cd9e59a64fd17fe0f9cec9f7a77b Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 12 Sep 2021 23:43:29 +0000 Subject: [PATCH 075/102] update ubuntu glib2 dependency to install fewer useless packages --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a080986..1e3695d8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,9 +21,9 @@ variables: automake autopoint gettext - glib2.0 gtk-doc-tools libgirepository1.0-dev + libglib2.0-dev libtool make texinfo From 1352f06f6a2110643c1facc38c06f3979489a428 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Sun, 12 Sep 2021 23:58:35 +0000 Subject: [PATCH 076/102] Fix tzdata config breaking workflow Also remove libglib2.0 installation since libgirepository1.0-dev should install that anyways --- .gitlab-ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e3695d8..082c13c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,6 @@ variables: gettext gtk-doc-tools libgirepository1.0-dev - libglib2.0-dev libtool make texinfo @@ -64,7 +63,7 @@ build-ubuntu: - tags before_script: - apt-get update - - apt-get install -y $UBUNTU_DEPENDENCIES + - DEBIAN_FRONTEND=noninteractive apt-get install -y $UBUNTU_DEPENDENCIES script: - mkdir _build - cd _build From 854d0c7547c6cb701dd7157be601327711aafb94 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 13 Sep 2021 00:44:00 +0000 Subject: [PATCH 077/102] remove needless fedora packages --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 082c13c3..3184ce0f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,14 +4,10 @@ stages: variables: FEDORA_DEPENDENCIES: - gawk gettext-devel - glib2-devel gobject-introspection-devel gtk-doc - perl texinfo - texinfo-tex FEDORA_DEPENDENCIES_ABI_CHECK: libabigail intltool From 4c686019fa4778c78191ddcabfddd763733d302b Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 13 Sep 2021 00:50:44 +0000 Subject: [PATCH 078/102] Try replacing texinfo package with texinfo-tex package --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3184ce0f..117ae2ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ variables: gettext-devel gobject-introspection-devel gtk-doc - texinfo + texinfo-tex FEDORA_DEPENDENCIES_ABI_CHECK: libabigail intltool From 3f4dac881b14eae0575bf821939ba51e9fdb6ebf Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Mon, 13 Sep 2021 01:14:20 +0000 Subject: [PATCH 079/102] remove autoconf from deps list since it will be installed anyways --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 117ae2ee..0ee71324 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,6 @@ variables: intltool LAST_ABI_BREAK: "d4ac1eda0752d559db8737773d6894aadc700ce3" UBUNTU_DEPENDENCIES: - autoconf automake autopoint gettext From 1e3547406a48a5a92c7040610680cc61184767c2 Mon Sep 17 00:00:00 2001 From: "Dr. James Dominic P. Guana" Date: Fri, 20 Aug 2021 02:34:48 +0800 Subject: [PATCH 080/102] Add processor model Add processor model Signed off: Dr. James Dominic P. Guana --- .gitignore | 1 + config.rpath | 684 ++++++++++++++++++++++++++++++++++++++ examples/Makefile.am | 5 +- examples/sysinfo.c | 41 +++ include/glibtop/sysinfo.h | 1 + sysdeps/linux/sysinfo.c | 19 ++ 6 files changed, 750 insertions(+), 1 deletion(-) create mode 100755 config.rpath create mode 100644 examples/sysinfo.c diff --git a/.gitignore b/.gitignore index 5d981f26..63dec343 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ examples/smp examples/sysdeps examples/timings examples/wd +examples/sysinfo gtk-doc.make install-sh lib/GTop-2.0.gir diff --git a/config.rpath b/config.rpath new file mode 100755 index 00000000..98183ff2 --- /dev/null +++ b/config.rpath @@ -0,0 +1,684 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in an executable. +# +# Copyright 1996-2016 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# The first argument passed to this file is the canonical host specification, +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +# should be set by the caller. +# +# The set of defined variables is at the end of this script. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <, May 2020. + + LibGTop is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, + or (at your option) any later version. + + LibGTop is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with LibGTop; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include + +#include +#include + +int +main (int argc, char *argv []) +{ + const glibtop_sysinfo * sysinfo = glibtop_get_sysinfo (); + + printf ("\nProcessor Model: %s\n", sysinfo->model); + printf ("Number of Cores: %d\n\n", sysinfo->ncpu); + + exit (0); +} diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h index bc249513..52e204ff 100644 --- a/include/glibtop/sysinfo.h +++ b/include/glibtop/sysinfo.h @@ -50,6 +50,7 @@ struct _glibtop_sysinfo { guint64 flags; guint64 ncpu; + gchar *model; glibtop_entry cpuinfo [GLIBTOP_NCPU]; }; diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index 7dbd5eeb..c9a66653 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -37,6 +37,7 @@ static void init_sysinfo (glibtop *server) { char* buffer; + gchar *buf, *line; gchar ** processors; if(G_LIKELY(sysinfo.flags)) return; @@ -48,6 +49,24 @@ init_sysinfo (glibtop *server) /* cpuinfo records are seperated by a blank line */ processors = g_strsplit(buffer, "\n\n", 0); + line = strtok(processors[0], "\n"); + + while(line != NULL) + { + if (strstr(line, "model name") != NULL) + { + buf = strchr(line, ':'); + + if (buf != NULL) + { + buf+=2; // we want to look at what's _after_ the ':' + sysinfo.model = buf; + } + break; + } + line = strtok(NULL, "\n"); + } + g_free(buffer); sysinfo.ncpu = 0; From 69457ccfa9cbfaa87f9e1a5793ddf62156b0ae8d Mon Sep 17 00:00:00 2001 From: "Dr. James Dominic P. Guana" Date: Fri, 20 Aug 2021 02:39:07 +0800 Subject: [PATCH 081/102] Add processor model Add processor model Signed off: Dr. James Dominic P. Guana --- examples/sysinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sysinfo.c b/examples/sysinfo.c index 8b7c9223..ed6fb162 100644 --- a/examples/sysinfo.c +++ b/examples/sysinfo.c @@ -1,7 +1,7 @@ /* Copyright (C) 1998-99 Martin Baulig This file is part of LibGTop 1.0. - Contributed by James Dominic P. Guana , May 2020. + Contributed by Dr. James Dominic P. Guana , August 2021. LibGTop is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From 04bf09341203173bc2ee6ff1cd990cc78c2c38c0 Mon Sep 17 00:00:00 2001 From: "Dr. James Dominic P. Guana" Date: Fri, 20 Aug 2021 02:41:23 +0800 Subject: [PATCH 082/102] Add processor model Add processor model Signed off: Dr. James Dominic P. Guana --- config.rpath | 684 --------------------------------------------------- 1 file changed, 684 deletions(-) delete mode 100755 config.rpath diff --git a/config.rpath b/config.rpath deleted file mode 100755 index 98183ff2..00000000 --- a/config.rpath +++ /dev/null @@ -1,684 +0,0 @@ -#! /bin/sh -# Output a system dependent set of variables, describing how to set the -# run time search path of shared libraries in an executable. -# -# Copyright 1996-2016 Free Software Foundation, Inc. -# Taken from GNU libtool, 2001 -# Originally by Gordon Matzigkeit , 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. -# -# The first argument passed to this file is the canonical host specification, -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld -# should be set by the caller. -# -# The set of defined variables is at the end of this script. - -# Known limitations: -# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer -# than 256 bytes, otherwise the compiler driver will dump core. The only -# known workaround is to choose shorter directory names for the build -# directory and/or the installation directory. - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -shrext=.so - -host="$1" -host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - -# Code taken from libtool.m4's _LT_CC_BASENAME. - -for cc_temp in $CC""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` - -# Code taken from libtool.m4's _LT_COMPILER_PIC. - -wl= -if test "$GCC" = yes; then - wl='-Wl,' -else - case "$host_os" in - aix*) - wl='-Wl,' - ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) - ;; - hpux9* | hpux10* | hpux11*) - wl='-Wl,' - ;; - irix5* | irix6* | nonstopux*) - wl='-Wl,' - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - ecc*) - wl='-Wl,' - ;; - icc* | ifort*) - wl='-Wl,' - ;; - lf95*) - wl='-Wl,' - ;; - nagfor*) - wl='-Wl,-Wl,,' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - wl='-Wl,' - ;; - ccc*) - wl='-Wl,' - ;; - xl* | bgxl* | bgf* | mpixl*) - wl='-Wl,' - ;; - como) - wl='-lopt=' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - wl= - ;; - *Sun\ C*) - wl='-Wl,' - ;; - esac - ;; - esac - ;; - newsos6) - ;; - *nto* | *qnx*) - ;; - osf3* | osf4* | osf5*) - wl='-Wl,' - ;; - rdos*) - ;; - solaris*) - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - wl='-Qoption ld ' - ;; - *) - wl='-Wl,' - ;; - esac - ;; - sunos4*) - wl='-Qoption ld ' - ;; - sysv4 | sysv4.2uw2* | sysv4.3*) - wl='-Wl,' - ;; - sysv4*MP*) - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - wl='-Wl,' - ;; - unicos*) - wl='-Wl,' - ;; - uts4*) - ;; - esac -fi - -# Code taken from libtool.m4's _LT_LINKER_SHLIBS. - -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no - -case "$host_os" in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - # Unlike libtool, we use -rpath here, not --rpath, since the documented - # option of GNU ld is called -rpath, not --rpath. - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - case "$host_os" in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - fi - ;; - amigaos*) - case "$host_cpu" in - powerpc) - ;; - m68k) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32* | cegcc*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - haiku*) - ;; - interix[3-9]*) - hardcode_direct=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - netbsd*) - ;; - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - else - ld_shlibs=no - fi - ;; - esac - ;; - sunos4*) - hardcode_direct=yes - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - : - else - ld_shlibs=no - fi - ;; - esac - if test "$ld_shlibs" = no; then - hardcode_libdir_flag_spec= - fi -else - case "$host_os" in - aix3*) - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - else - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - fi - hardcode_direct=yes - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - fi - # Begin _LT_AC_SYS_LIBPATH_AIX. - echo 'int main () { return 0; }' > conftest.c - ${CC} ${LDFLAGS} conftest.c -o conftest - aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` - if test -z "$aix_libpath"; then - aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` - fi - if test -z "$aix_libpath"; then - aix_libpath="/usr/lib:/lib" - fi - rm -f conftest.c conftest - # End _LT_AC_SYS_LIBPATH_AIX. - if test "$aix_use_runtimelinking" = yes; then - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - else - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - fi - fi - ;; - amigaos*) - case "$host_cpu" in - powerpc) - ;; - m68k) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - bsdi[45]*) - ;; - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - libext=lib - ;; - darwin* | rhapsody*) - hardcode_direct=no - if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then - : - else - ld_shlibs=no - fi - ;; - dgux*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - freebsd2.[01]*) - hardcode_direct=yes - hardcode_minus_L=yes - ;; - freebsd* | dragonfly*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - hpux9*) - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - hpux10*) - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - hpux11*) - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - ;; - *) - hardcode_direct=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - irix5* | irix6* | nonstopux*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - netbsd*) - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - ;; - newsos6) - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - *nto* | *qnx*) - ;; - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - else - case "$host_os" in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - osf3*) - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) - if test "$GCC" = yes; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - # Both cc and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - solaris*) - hardcode_libdir_flag_spec='-R$libdir' - ;; - sunos4*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - ;; - sysv4) - case $host_vendor in - sni) - hardcode_direct=yes # is this really true??? - ;; - siemens) - hardcode_direct=no - ;; - motorola) - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - ;; - sysv4.3*) - ;; - sysv4*MP*) - if test -d /usr/nec; then - ld_shlibs=yes - fi - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - ;; - sysv5* | sco3.2v5* | sco5v6*) - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - ;; - uts4*) - hardcode_libdir_flag_spec='-L$libdir' - ;; - *) - ld_shlibs=no - ;; - esac -fi - -# Check dynamic linker characteristics -# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. -# Unlike libtool.m4, here we don't care about _all_ names of the library, but -# only about the one the linker finds when passed -lNAME. This is the last -# element of library_names_spec in libtool.m4, or possibly two of them if the -# linker has special search rules. -library_names_spec= # the last element of library_names_spec in libtool.m4 -libname_spec='lib$name' -case "$host_os" in - aix3*) - library_names_spec='$libname.a' - ;; - aix[4-9]*) - library_names_spec='$libname$shrext' - ;; - amigaos*) - case "$host_cpu" in - powerpc*) - library_names_spec='$libname$shrext' ;; - m68k) - library_names_spec='$libname.a' ;; - esac - ;; - beos*) - library_names_spec='$libname$shrext' - ;; - bsdi[45]*) - library_names_spec='$libname$shrext' - ;; - cygwin* | mingw* | pw32* | cegcc*) - shrext=.dll - library_names_spec='$libname.dll.a $libname.lib' - ;; - darwin* | rhapsody*) - shrext=.dylib - library_names_spec='$libname$shrext' - ;; - dgux*) - library_names_spec='$libname$shrext' - ;; - freebsd[23].*) - library_names_spec='$libname$shrext$versuffix' - ;; - freebsd* | dragonfly*) - library_names_spec='$libname$shrext' - ;; - gnu*) - library_names_spec='$libname$shrext' - ;; - haiku*) - library_names_spec='$libname$shrext' - ;; - hpux9* | hpux10* | hpux11*) - case $host_cpu in - ia64*) - shrext=.so - ;; - hppa*64*) - shrext=.sl - ;; - *) - shrext=.sl - ;; - esac - library_names_spec='$libname$shrext' - ;; - interix[3-9]*) - library_names_spec='$libname$shrext' - ;; - irix5* | irix6* | nonstopux*) - library_names_spec='$libname$shrext' - case "$host_os" in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; - *) libsuff= shlibsuff= ;; - esac - ;; - esac - ;; - linux*oldld* | linux*aout* | linux*coff*) - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - library_names_spec='$libname$shrext' - ;; - knetbsd*-gnu) - library_names_spec='$libname$shrext' - ;; - netbsd*) - library_names_spec='$libname$shrext' - ;; - newsos6) - library_names_spec='$libname$shrext' - ;; - *nto* | *qnx*) - library_names_spec='$libname$shrext' - ;; - openbsd*) - library_names_spec='$libname$shrext$versuffix' - ;; - os2*) - libname_spec='$name' - shrext=.dll - library_names_spec='$libname.a' - ;; - osf3* | osf4* | osf5*) - library_names_spec='$libname$shrext' - ;; - rdos*) - ;; - solaris*) - library_names_spec='$libname$shrext' - ;; - sunos4*) - library_names_spec='$libname$shrext$versuffix' - ;; - sysv4 | sysv4.3*) - library_names_spec='$libname$shrext' - ;; - sysv4*MP*) - library_names_spec='$libname$shrext' - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - library_names_spec='$libname$shrext' - ;; - tpf*) - library_names_spec='$libname$shrext' - ;; - uts4*) - library_names_spec='$libname$shrext' - ;; -esac - -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` -shlibext=`echo "$shrext" | sed -e 's,^\.,,'` -escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` -escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` - -LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < Date: Fri, 20 Aug 2021 19:08:15 +0800 Subject: [PATCH 083/102] Exposes the processor model Accessing processor model becomes easier Signed off: Dr. James Dominic P. Guana --- examples/Makefile.am | 2 +- examples/sysinfo.c | 8 +++++++- include/glibtop/sysinfo.h | 2 +- sysdeps/linux/sysinfo.c | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/examples/Makefile.am b/examples/Makefile.am index fb95f825..e2b72115 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -72,4 +72,4 @@ diskio_SOURCES = diskio.c diskio_LDADD = $(top_builddir)/lib/libgtop-2.0.la sysinfo_SOURCES = sysinfo.c -sysinfo_LDADD = $(top_builddir)/lib/libgtop-2.0.la -lm +sysinfo_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/examples/sysinfo.c b/examples/sysinfo.c index ed6fb162..40eed37a 100644 --- a/examples/sysinfo.c +++ b/examples/sysinfo.c @@ -32,10 +32,16 @@ int main (int argc, char *argv []) { - const glibtop_sysinfo * sysinfo = glibtop_get_sysinfo (); + const glibtop_sysinfo * sysinfo; + + glibtop_init(); + + sysinfo = glibtop_get_sysinfo (); printf ("\nProcessor Model: %s\n", sysinfo->model); printf ("Number of Cores: %d\n\n", sysinfo->ncpu); + glibtop_close (); + exit (0); } diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h index 52e204ff..30598f16 100644 --- a/include/glibtop/sysinfo.h +++ b/include/glibtop/sysinfo.h @@ -50,7 +50,7 @@ struct _glibtop_sysinfo { guint64 flags; guint64 ncpu; - gchar *model; + gchar *model; glibtop_entry cpuinfo [GLIBTOP_NCPU]; }; diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index c9a66653..2ebe0ec5 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -59,8 +59,9 @@ init_sysinfo (glibtop *server) if (buf != NULL) { - buf+=2; // we want to look at what's _after_ the ':' - sysinfo.model = buf; + /* we want to look at what's _after_ the ':' */ + buf+=2; + sysinfo.model = g_strdup (buf); } break; } From e89475c0b22108a24faaa1bded7b9beef5f235ce Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Fri, 20 Aug 2021 23:18:58 +0000 Subject: [PATCH 084/102] Exposes the processor model Accessing processor model becomes easier Signed off: Dr. James Dominic P. Guana --- include/glibtop/sysinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h index 30598f16..93e9b509 100644 --- a/include/glibtop/sysinfo.h +++ b/include/glibtop/sysinfo.h @@ -50,8 +50,8 @@ struct _glibtop_sysinfo { guint64 flags; guint64 ncpu; - gchar *model; glibtop_entry cpuinfo [GLIBTOP_NCPU]; + gchar *model; }; #define glibtop_get_sysinfo_r glibtop_get_sysinfo_s From f92f6ea029e62023aecb7a29d98f102e7e13f544 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 21 Aug 2021 16:17:13 +0000 Subject: [PATCH 085/102] Add sysinfo example Retrieve cpu model via hashtable & number of logical cpu via exposed variable Signed off: Dr. James Dominic P. Guana --- examples/sysinfo.c | 5 +++-- include/glibtop/sysinfo.h | 1 - sysdeps/linux/sysinfo.c | 20 -------------------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/examples/sysinfo.c b/examples/sysinfo.c index 40eed37a..f1350cdd 100644 --- a/examples/sysinfo.c +++ b/examples/sysinfo.c @@ -32,13 +32,14 @@ int main (int argc, char *argv []) { + char *model; const glibtop_sysinfo * sysinfo; glibtop_init(); - sysinfo = glibtop_get_sysinfo (); + model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name"); - printf ("\nProcessor Model: %s\n", sysinfo->model); + printf ("\nProcessor Model: %s\n", g_strdup (model)); printf ("Number of Cores: %d\n\n", sysinfo->ncpu); glibtop_close (); diff --git a/include/glibtop/sysinfo.h b/include/glibtop/sysinfo.h index 93e9b509..bc249513 100644 --- a/include/glibtop/sysinfo.h +++ b/include/glibtop/sysinfo.h @@ -51,7 +51,6 @@ struct _glibtop_sysinfo guint64 flags; guint64 ncpu; glibtop_entry cpuinfo [GLIBTOP_NCPU]; - gchar *model; }; #define glibtop_get_sysinfo_r glibtop_get_sysinfo_s diff --git a/sysdeps/linux/sysinfo.c b/sysdeps/linux/sysinfo.c index 2ebe0ec5..7dbd5eeb 100644 --- a/sysdeps/linux/sysinfo.c +++ b/sysdeps/linux/sysinfo.c @@ -37,7 +37,6 @@ static void init_sysinfo (glibtop *server) { char* buffer; - gchar *buf, *line; gchar ** processors; if(G_LIKELY(sysinfo.flags)) return; @@ -49,25 +48,6 @@ init_sysinfo (glibtop *server) /* cpuinfo records are seperated by a blank line */ processors = g_strsplit(buffer, "\n\n", 0); - line = strtok(processors[0], "\n"); - - while(line != NULL) - { - if (strstr(line, "model name") != NULL) - { - buf = strchr(line, ':'); - - if (buf != NULL) - { - /* we want to look at what's _after_ the ':' */ - buf+=2; - sysinfo.model = g_strdup (buf); - } - break; - } - line = strtok(NULL, "\n"); - } - g_free(buffer); sysinfo.ncpu = 0; From 3d7870c961e41f99ad31caf2c4bcbc875fce40a7 Mon Sep 17 00:00:00 2001 From: "James Dominic P. Guana" Date: Sat, 21 Aug 2021 16:20:52 +0000 Subject: [PATCH 086/102] Add sysinfo example Retrieve cpu model via hashtable & number of logical cpu via exposed variable Signed off: Dr. James Dominic P. Guana --- examples/sysinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/sysinfo.c b/examples/sysinfo.c index f1350cdd..3c570e9f 100644 --- a/examples/sysinfo.c +++ b/examples/sysinfo.c @@ -39,10 +39,10 @@ main (int argc, char *argv []) sysinfo = glibtop_get_sysinfo (); model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name"); - printf ("\nProcessor Model: %s\n", g_strdup (model)); - printf ("Number of Cores: %d\n\n", sysinfo->ncpu); + printf ("\nProcessor Model: %s\n", g_strdup (model)); + printf ("Number of Cores: %d\n\n", sysinfo->ncpu); glibtop_close (); - exit (0); + exit (0); } From 3b078fafa5e409b786d9975bbf16683aebccabb5 Mon Sep 17 00:00:00 2001 From: Changqing Li Date: Fri, 21 May 2021 11:14:36 +0800 Subject: [PATCH 087/102] configure.ac: fix cross compile error On some distros, such as fedora32, cross compile failed with following error since host library is used. undefined reference to `stat64@GLIBC_2.33' According doc of ld, set searchdir begins with "=", but not hardcoded locations. Signed-off-by: Changqing Li --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5686c5ba..5df6bc54 100644 --- a/configure.ac +++ b/configure.ac @@ -284,8 +284,8 @@ AC_ARG_ENABLE(fatal-warnings, [Define to enable fatal warnings])) dnl These definitions are expanded in make. -LIBGTOP_LIBS='-L$(libdir)' -LIBGTOP_INCS='-I$(includedir)/libgtop-2.0' +LIBGTOP_LIBS='-L=$(libdir)' +LIBGTOP_INCS='-I=$(includedir)/libgtop-2.0' if test x$libgtop_have_sysinfo = xyes ; then LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_LIBGTOP_SYSINFO" From 99803b3959a3e1543c95281ecc659e436444627c Mon Sep 17 00:00:00 2001 From: Charles Monzat Date: Thu, 7 Jul 2022 17:12:28 +0000 Subject: [PATCH 088/102] Update French translation --- po/fr.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/fr.po b/po/fr.po index 7e3da9c4..8e4c54f2 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,14 +7,14 @@ # Christophe Merlet , 2000-2004. # Benoit Dejean , 2004. # Stéphane Raimbault , 2007. -# Charles Monzat , 2018-2021. +# Charles Monzat , 2018-2022. # msgid "" msgstr "" "Project-Id-Version: libgtop 2.9.91\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" -"POT-Creation-Date: 2020-05-29 05:44+0000\n" -"PO-Revision-Date: 2021-03-11 10:22+0100\n" +"POT-Creation-Date: 2021-08-23 22:54+0000\n" +"PO-Revision-Date: 2022-04-08 15:50+0200\n" "Last-Translator: Charles Monzat \n" "Language-Team: GNOME French Team \n" "Language: fr\n" @@ -22,7 +22,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Gtranslator 3.38.0\n" +"X-Generator: Gtranslator 40.0\n" #: lib/read.c:49 #, c-format @@ -63,7 +63,7 @@ msgstr "Ne pas lancer en tâche de fond" #: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" -msgstr "Invoqué à partir de inetd" +msgstr "Invoqué à partir de inetd" #: src/daemon/gnuserv.c:498 #, c-format From b08c3d868503e9437fa4c50f37fdaf639bff3248 Mon Sep 17 00:00:00 2001 From: Zurab Kargareteli Date: Thu, 7 Jul 2022 18:12:31 +0000 Subject: [PATCH 089/102] Update Georgian translation --- po/ka.po | 223 +++++++++++++++++++++++-------------------------------- 1 file changed, 94 insertions(+), 129 deletions(-) diff --git a/po/ka.po b/po/ka.po index 92389643..24f5b0b7 100644 --- a/po/ka.po +++ b/po/ka.po @@ -1,221 +1,186 @@ -# translation of libgtop.po to Georgian -# Copyright (C) 2006 Gnome Georgian Translators -# This file is distributed under the same license as the libgtop package. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. # -# Alexander Didebulidze , 2006. msgid "" msgstr "" "Project-Id-Version: libgtop\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-02-25 08:57+0100\n" -"PO-Revision-Date: 2006-03-18 03:28+0100\n" -"Last-Translator: Alexander Didebulidze \n" -"Language-Team: Georgian \n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2022-03-28 13:02+0000\n" +"PO-Revision-Date: 2022-07-03 06:30+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" "Language: ka\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.1\n" -#: ../lib/read.c:65 +#: lib/read.c:49 #, c-format -#, fuzzy msgid "read %d byte" msgid_plural "read %d bytes" -msgstr[0] "byte" +msgstr[0] "წაკითხულია %d ბაიტი" -#: ../lib/read_data.c:53 -#, fuzzy +#: lib/read_data.c:49 msgid "read data size" -msgstr "სიდიდე" +msgstr "წაკითხული მონაცემების ზომა" -#: ../lib/read_data.c:72 +#: lib/read_data.c:66 #, c-format -#, fuzzy msgid "read %lu byte of data" msgid_plural "read %lu bytes of data" -msgstr[0] "byte" +msgstr[0] "წაკითხულია %lu ბაიტი ინფორმაცა" -#: ../lib/write.c:52 +#: lib/write.c:49 #, c-format -#, fuzzy msgid "wrote %d byte" msgid_plural "wrote %d bytes" -msgstr[0] "byte" +msgstr[0] "ჩაწერილია %d ბაიტი" -#: ../src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:456 msgid "Enable debugging" -msgstr "" +msgstr "გამართვის კოდის ჩართვა" -#: ../src/daemon/gnuserv.c:460 -msgid "DEBUG" -msgstr "DEBUG" - -#: ../src/daemon/gnuserv.c:462 +#: src/daemon/gnuserv.c:458 msgid "Enable verbose output" -msgstr "" +msgstr "უფრო მეტის ჩვენება" -#: ../src/daemon/gnuserv.c:462 -msgid "VERBOSE" -msgstr "VERBOSE" +#: src/daemon/gnuserv.c:460 +msgid "Don’t fork into background" +msgstr "ფონზე გადასვლის გათიშვა" -#: ../src/daemon/gnuserv.c:464 -msgid "Don't fork into background" -msgstr "" - -#: ../src/daemon/gnuserv.c:464 -msgid "NO-DAEMON" -msgstr "" - -#: ../src/daemon/gnuserv.c:466 +#: src/daemon/gnuserv.c:462 msgid "Invoked from inetd" -msgstr "" +msgstr "გაშვებულია inetd-დან" -#: ../src/daemon/gnuserv.c:466 -msgid "INETD" -msgstr "INETD" - -#: ../src/daemon/gnuserv.c:500 +#: src/daemon/gnuserv.c:498 #, c-format -#, fuzzy -msgid "" -"Error on option %s: %s.\n" -"Run '%s --help' to see a full list of available command line options.\n" -msgstr "შეცდომა -სკენ a ხაზი n" +msgid "Run “%s --help” to see a full list of available command line options.\n" +msgstr "გაშვების ხელმისაწვდომი პარამეტრების სანახავად გაუშვით \"%s --help\".\n" -#: ../sysdeps/osf1/siglist.c:29 ../sysdeps/sun4/siglist.c:29 +#: sysdeps/osf1/siglist.c:27 sysdeps/sun4/siglist.c:27 msgid "Hangup" -msgstr "" +msgstr "გათიშვა" -#: ../sysdeps/osf1/siglist.c:30 ../sysdeps/sun4/siglist.c:30 +#: sysdeps/osf1/siglist.c:28 sysdeps/sun4/siglist.c:28 msgid "Interrupt" +msgstr "შეწყვეტა" + +#: sysdeps/osf1/siglist.c:29 sysdeps/sun4/siglist.c:29 +msgid "Quit" +msgstr "გასვლა" + +#: sysdeps/osf1/siglist.c:30 sysdeps/sun4/siglist.c:30 +msgid "Illegal instruction" +msgstr "არასწორი ინსტრუქცია" + +#: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 +msgid "Trace trap" msgstr "" -#: ../sysdeps/osf1/siglist.c:31 ../sysdeps/sun4/siglist.c:31 -msgid "Quit" -msgstr "გამოსვლა" - -#: ../sysdeps/osf1/siglist.c:32 ../sysdeps/sun4/siglist.c:32 -msgid "Illegal instruction" -msgstr "არალეგალური ინსტრუქცია" - -#: ../sysdeps/osf1/siglist.c:33 ../sysdeps/sun4/siglist.c:33 -#, fuzzy -msgid "Trace trap" -msgstr "გამოთვალე" - -#: ../sysdeps/osf1/siglist.c:34 ../sysdeps/sun4/siglist.c:34 +#: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" msgstr "შეწყვეტა" -#: ../sysdeps/osf1/siglist.c:35 ../sysdeps/sun4/siglist.c:35 +#: sysdeps/osf1/siglist.c:33 sysdeps/sun4/siglist.c:33 msgid "EMT error" msgstr "EMT შეცდომა" -#: ../sysdeps/osf1/siglist.c:36 ../sysdeps/sun4/siglist.c:36 +#: sysdeps/osf1/siglist.c:34 sysdeps/sun4/siglist.c:34 msgid "Floating-point exception" -msgstr "" +msgstr "წილადი რიცხვების ანგარიშის შეცდომა" -#: ../sysdeps/osf1/siglist.c:37 ../sysdeps/sun4/siglist.c:37 +#: sysdeps/osf1/siglist.c:35 sysdeps/sun4/siglist.c:35 msgid "Kill" -msgstr "" +msgstr "მოკვლა" -#: ../sysdeps/osf1/siglist.c:38 ../sysdeps/sun4/siglist.c:38 -#, fuzzy +#: sysdeps/osf1/siglist.c:36 sysdeps/sun4/siglist.c:36 msgid "Bus error" -msgstr "შეცდომა" +msgstr "მატარებლის შეცდომა" -#: ../sysdeps/osf1/siglist.c:39 ../sysdeps/sun4/siglist.c:39 +#: sysdeps/osf1/siglist.c:37 sysdeps/sun4/siglist.c:37 msgid "Segmentation violation" -msgstr "" +msgstr "სეგმენტაციის შეცდომა" -#: ../sysdeps/osf1/siglist.c:40 ../sysdeps/sun4/siglist.c:40 -#, fuzzy +#: sysdeps/osf1/siglist.c:38 sysdeps/sun4/siglist.c:38 msgid "Bad argument to system call" -msgstr "-სკენ" +msgstr "სისტემური ფუნქციის არასწორი არგუმენტები" -#: ../sysdeps/osf1/siglist.c:41 ../sysdeps/sun4/siglist.c:41 +#: sysdeps/osf1/siglist.c:39 sysdeps/sun4/siglist.c:39 msgid "Broken pipe" -msgstr "" +msgstr "გაფუჭებული მილი" -#: ../sysdeps/osf1/siglist.c:42 ../sysdeps/sun4/siglist.c:42 +#: sysdeps/osf1/siglist.c:40 sysdeps/sun4/siglist.c:40 msgid "Alarm clock" -msgstr "" +msgstr "მაღვიძარა" -#: ../sysdeps/osf1/siglist.c:43 ../sysdeps/sun4/siglist.c:43 +#: sysdeps/osf1/siglist.c:41 sysdeps/sun4/siglist.c:41 msgid "Termination" -msgstr "" +msgstr "შეწყვეტა" -#: ../sysdeps/osf1/siglist.c:44 ../sysdeps/sun4/siglist.c:44 +#: sysdeps/osf1/siglist.c:42 sysdeps/sun4/siglist.c:42 msgid "Urgent condition on socket" -msgstr "" +msgstr "სოკეტის სასწრაფო მდგომარეობა" -#: ../sysdeps/osf1/siglist.c:45 ../sysdeps/sun4/siglist.c:45 +#: sysdeps/osf1/siglist.c:43 sysdeps/sun4/siglist.c:43 msgid "Stop" msgstr "შეჩერება" -#: ../sysdeps/osf1/siglist.c:46 ../sysdeps/sun4/siglist.c:46 -#, fuzzy +#: sysdeps/osf1/siglist.c:44 sysdeps/sun4/siglist.c:44 msgid "Keyboard stop" -msgstr "კლავიატურა" +msgstr "კლავიაუტით გაჩერება" -#: ../sysdeps/osf1/siglist.c:47 ../sysdeps/sun4/siglist.c:47 +#: sysdeps/osf1/siglist.c:45 sysdeps/sun4/siglist.c:45 msgid "Continue" msgstr "გაგრძელება" -#: ../sysdeps/osf1/siglist.c:48 ../sysdeps/sun4/siglist.c:48 +#: sysdeps/osf1/siglist.c:46 sysdeps/sun4/siglist.c:46 msgid "Child status has changed" -msgstr "" +msgstr "შვილის სტატუსი შეცვლილია" -#: ../sysdeps/osf1/siglist.c:49 ../sysdeps/sun4/siglist.c:49 -#, fuzzy +#: sysdeps/osf1/siglist.c:47 sysdeps/sun4/siglist.c:47 msgid "Background read from tty" -msgstr "ფონი" +msgstr "TTY-დან ფონურად კითხვა" -#: ../sysdeps/osf1/siglist.c:50 ../sysdeps/sun4/siglist.c:50 -#, fuzzy +#: sysdeps/osf1/siglist.c:48 sysdeps/sun4/siglist.c:48 msgid "Background write to tty" -msgstr "ფონი -სკენ" +msgstr "TTY-ში ფონურად ჩაწერა" -#: ../sysdeps/osf1/siglist.c:51 ../sysdeps/sun4/siglist.c:51 +#: sysdeps/osf1/siglist.c:49 sysdeps/sun4/siglist.c:49 msgid "I/O now possible" -msgstr "I/O ახლა შესაძლებელია" +msgstr "I/O ახლა შესაძელებელია" -#: ../sysdeps/osf1/siglist.c:52 ../sysdeps/sun4/siglist.c:52 -#, fuzzy +#: sysdeps/osf1/siglist.c:50 sysdeps/sun4/siglist.c:50 msgid "CPU limit exceeded" -msgstr "CPU" +msgstr "CPU-ის ლიმიტი გადაჭარბებულია" -#: ../sysdeps/osf1/siglist.c:53 ../sysdeps/sun4/siglist.c:53 -#, fuzzy +#: sysdeps/osf1/siglist.c:51 sysdeps/sun4/siglist.c:51 msgid "File size limit exceeded" -msgstr "ფაილი სიდიდე" +msgstr "ფაილის ზომის ლიმიტი გადაჭარბებულია" -#: ../sysdeps/osf1/siglist.c:54 ../sysdeps/sun4/siglist.c:54 +#: sysdeps/osf1/siglist.c:52 sysdeps/sun4/siglist.c:52 msgid "Virtual alarm clock" -msgstr "" +msgstr "ვირტუალური მაღვიძარა" -#: ../sysdeps/osf1/siglist.c:55 ../sysdeps/sun4/siglist.c:55 +#: sysdeps/osf1/siglist.c:53 sysdeps/sun4/siglist.c:53 msgid "Profiling alarm clock" -msgstr "" +msgstr "მაღვიძარის ზარის პროფილირება" -#: ../sysdeps/osf1/siglist.c:56 ../sysdeps/sun4/siglist.c:56 -#, fuzzy +#: sysdeps/osf1/siglist.c:54 sysdeps/sun4/siglist.c:54 msgid "Window size change" -msgstr "ფანჯარა სიდიდე" +msgstr "ფანჯრის ზომის შეცვლა" -#: ../sysdeps/osf1/siglist.c:57 ../sysdeps/sun4/siglist.c:57 -#, fuzzy +#: sysdeps/osf1/siglist.c:55 sysdeps/sun4/siglist.c:55 msgid "Information request" -msgstr "ინფორმაცია" +msgstr "ინფორმაციის მოთხოვნა" -#: ../sysdeps/osf1/siglist.c:58 ../sysdeps/sun4/siglist.c:58 -#, fuzzy +#: sysdeps/osf1/siglist.c:56 sysdeps/sun4/siglist.c:56 msgid "User defined signal 1" -msgstr "მომხმარებელი 1" +msgstr "მომხმარებლის მიერ განსაზღვრული სიგნალი 1" -#: ../sysdeps/osf1/siglist.c:59 ../sysdeps/sun4/siglist.c:59 -#, fuzzy +#: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" -msgstr "მომხმარებელი 2" - +msgstr "მომხმარებლის მიერ განსაზღვრული სიგნალი 2" From 9159e2580476152e5c00150fded1df20d59565cc Mon Sep 17 00:00:00 2001 From: Zurab Kargareteli Date: Thu, 21 Jul 2022 15:28:41 +0000 Subject: [PATCH 090/102] Update Georgian translation --- po/ka.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/po/ka.po b/po/ka.po index 24f5b0b7..2e760795 100644 --- a/po/ka.po +++ b/po/ka.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: libgtop\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" "POT-Creation-Date: 2022-03-28 13:02+0000\n" -"PO-Revision-Date: 2022-07-03 06:30+0200\n" +"PO-Revision-Date: 2022-07-21 17:28+0200\n" "Last-Translator: Temuri Doghonadze \n" "Language-Team: Georgian <(nothing)>\n" "Language: ka\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.1\n" +"X-Generator: Poedit 3.1.1\n" #: lib/read.c:49 #, c-format @@ -79,7 +79,7 @@ msgstr "არასწორი ინსტრუქცია" #: sysdeps/osf1/siglist.c:31 sysdeps/sun4/siglist.c:31 msgid "Trace trap" -msgstr "" +msgstr "ტრეისის ჩაჭერა" #: sysdeps/osf1/siglist.c:32 sysdeps/sun4/siglist.c:32 msgid "Abort" From 507809b648634c6251e9aeeb8ffae1d38c5be5f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Sun, 18 Sep 2022 08:01:28 +0000 Subject: [PATCH 091/102] Update Turkish translation --- po/tr.po | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/po/tr.po b/po/tr.po index 0f086310..80efda86 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,17 +1,18 @@ # translation of libgtop to Turkish # Copyright (C) 2004 Free Software Foundation, Inc. +# Copyright (C) 2009-2022 libgtop's COPYRIGHT HOLDER +# This file is distributed under the same license as the libgtop package. +# # Görkem Çetin , 2001. # Ömer Fadıl USTA ,2002. -# # Baris Cicek , 2004, 2008. # Emin Tufan Çetin , 2017. # msgid "" msgstr "" "Project-Id-Version: libgtop\n" -"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?" -"product=libgtop&keywords=I18N+L10N&component=general\n" -"POT-Creation-Date: 2017-04-07 11:45+0000\n" +"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" +"POT-Creation-Date: 2022-07-07 17:11+0000\n" "PO-Revision-Date: 2017-09-05 07:33+0300\n" "Last-Translator: Emin Tufan Çetin \n" "Language-Team: Türkçe \n" @@ -53,7 +54,6 @@ msgid "Enable verbose output" msgstr "Detaylı çıktıyı etkinleştir" #: src/daemon/gnuserv.c:460 -#| msgid "Don't fork into background" msgid "Don’t fork into background" msgstr "Arka plana çatallama" @@ -63,8 +63,6 @@ msgstr "Inetd’den çalıştırıldı" #: src/daemon/gnuserv.c:498 #, c-format -#| msgid "" -#| "Run '%s --help' to see a full list of available command line options.\n" msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" "Kullanılabilir tüm komut satırı seçeneklerinin tam listesini görmek için “%s " @@ -193,15 +191,3 @@ msgstr "Kullanıcı tanımlı sinyal 1" #: sysdeps/osf1/siglist.c:57 sysdeps/sun4/siglist.c:57 msgid "User defined signal 2" msgstr "Kullanıcı tanımlı sinyal 2" - -#~ msgid "DEBUG" -#~ msgstr "HATA AYIKLA" - -#~ msgid "VERBOSE" -#~ msgstr "DETAYLI" - -#~ msgid "NO-DAEMON" -#~ msgstr "SERVİS-YOK" - -#~ msgid "INETD" -#~ msgstr "INETD" From 66721198b640a241c2c666e0f628a665b4bf8c23 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Thu, 1 Dec 2022 22:02:07 +0100 Subject: [PATCH 092/102] Don't try to read System process procargs --- sysdeps/openbsd/procargs.c | 5 +++++ sysdeps/openbsd/procmap.c | 1 + 2 files changed, 6 insertions(+) diff --git a/sysdeps/openbsd/procargs.c b/sysdeps/openbsd/procargs.c index c686bd35..3a3e68ab 100644 --- a/sysdeps/openbsd/procargs.c +++ b/sysdeps/openbsd/procargs.c @@ -70,6 +70,11 @@ glibtop_get_proc_args_p (glibtop *server, glibtop_proc_args *buf, return NULL; } + if (pinfo[0].p_flag & P_SYSTEM) { + glibtop_suid_leave (server); + return NULL; + } + args = kvm_getargv (server->machine->kd, pinfo, max_len); if (args == NULL) { glibtop_suid_leave (server); diff --git a/sysdeps/openbsd/procmap.c b/sysdeps/openbsd/procmap.c index 7729f31a..c6537f9a 100644 --- a/sysdeps/openbsd/procmap.c +++ b/sysdeps/openbsd/procmap.c @@ -200,6 +200,7 @@ glibtop_get_proc_map_p (glibtop *server, glibtop_proc_map *buf, pinfo = kvm_getprocs (server->machine->kd, KERN_PROC_PID, pid, sizeof(struct kinfo_proc), &count); if (pinfo == NULL) { glibtop_warn_io_r (server, "kvm_getprocs (%d)", pid); + glibtop_suid_leave (server); return (glibtop_map_entry*) g_array_free(maps, TRUE); } From 5e97014fea8153f42e21062f2f2f32bfcf6a29e9 Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 6 Jun 2022 17:30:40 +0100 Subject: [PATCH 093/102] Avoid some deprecated networking functions rpminspect trips up on some old networking functions in libgtop, which are mentioned as deprecated in the Linux man pages. inet_ntoa() only works on IPv4 addresses, whereas the newer inet_ntop() works on both IPv4 and IPv6 addresses, so use inet_ntop() instead. Similarly, use getaddrinfo() rather than gethostbyname(), and avoid inet_addr() entirely. https://bugzilla.redhat.com/show_bug.cgi?id=2050712 --- examples/netload.c | 10 +++------- src/daemon/gnuserv.c | 20 ++++++++++++++------ sysdeps/common/gnuslib.c | 16 ++++++++++------ 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/examples/netload.c b/examples/netload.c index 979b245d..520b5040 100644 --- a/examples/netload.c +++ b/examples/netload.c @@ -66,7 +66,7 @@ main (int argc, char *argv []) glibtop_netload netload; unsigned method, count, port; struct in_addr addr, subnet; - char *address_string, *subnet_string; + char address_string[INET_ADDRSTRLEN], subnet_string[INET_ADDRSTRLEN]; char address6_string[INET6_ADDRSTRLEN], prefix6_string[INET6_ADDRSTRLEN]; char *hwaddress_string; char buffer [BUFSIZ]; @@ -105,9 +105,8 @@ main (int argc, char *argv []) addr.s_addr = netload.address; subnet.s_addr = netload.subnet; - address_string = g_strdup (inet_ntoa (addr)); - subnet_string = g_strdup (inet_ntoa (subnet)); - + inet_ntop (AF_INET, &addr, address_string, INET_ADDRSTRLEN); + inet_ntop (AF_INET, &subnet, subnet_string, INET_ADDRSTRLEN); inet_ntop (AF_INET6, netload.address6, address6_string, INET6_ADDRSTRLEN); inet_ntop (AF_INET6, netload.prefix6, prefix6_string, INET6_ADDRSTRLEN); @@ -153,9 +152,6 @@ main (int argc, char *argv []) hwaddress_string); - g_free (address_string); - g_free (subnet_string); - glibtop_close (); exit (0); diff --git a/src/daemon/gnuserv.c b/src/daemon/gnuserv.c index 78ebb643..26e9dd92 100644 --- a/src/daemon/gnuserv.c +++ b/src/daemon/gnuserv.c @@ -392,6 +392,7 @@ handle_internet_request (int ls) int s; size_t addrlen = sizeof (struct sockaddr_in); struct sockaddr_in peer; /* for peer socket address */ + char addrstr[addrlen]; pid_t pid; memset ((char *) &peer, 0, sizeof (struct sockaddr_in)); @@ -401,21 +402,24 @@ handle_internet_request (int ls) exit (1); } + /* TODO: Check errno. */ + inet_ntop (AF_INET, &peer, addrstr, addrlen); + if (verbose_output) syslog_message (LOG_INFO, "Connection was made from %s port %u.", - inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + addrstr, ntohs (peer.sin_port)); /* Check that access is allowed - if not return crud to the client */ if (!permitted (peer.sin_addr.s_addr, s)) { close (s); syslog_message (LOG_CRIT, "Refused connection from %s.", - inet_ntoa (peer.sin_addr)); + addrstr); return; } /* if */ if (verbose_output) syslog_message (LOG_INFO, "Accepted connection from %s port %u.", - inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + addrstr, ntohs (peer.sin_port)); pid = fork (); @@ -436,7 +440,7 @@ handle_internet_request (int ls) if (verbose_output) syslog_message (LOG_INFO, "Closed connection to %s port %u.", - inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + addrstr, ntohs (peer.sin_port)); _exit (0); } /* handle_internet_request */ @@ -560,6 +564,7 @@ main (int argc, char **argv) if (invoked_from_inetd) { size_t addrlen = sizeof (struct sockaddr_in); struct sockaddr_in peer; + char addrstr[addrlen]; memset ((char *) &peer, 0, sizeof (struct sockaddr_in)); @@ -568,15 +573,18 @@ main (int argc, char **argv) exit (1); } + /* TODO: Check errno. */ + inet_ntop (AF_INET, &peer, addrstr, addrlen); + if (verbose_output) syslog_message (LOG_INFO, "Connection was made from %s port %u.", - inet_ntoa (peer.sin_addr), ntohs (peer.sin_port)); + addrstr, ntohs (peer.sin_port)); /* Check that access is allowed - if not return crud to the client */ if (!permitted (peer.sin_addr.s_addr, 0)) { close (0); syslog_message (LOG_CRIT, "Refused connection from %s.", - inet_ntoa (peer.sin_addr)); + addrstr); exit (1); } diff --git a/sysdeps/common/gnuslib.c b/sysdeps/common/gnuslib.c index 79295485..3f994f2c 100644 --- a/sysdeps/common/gnuslib.c +++ b/sysdeps/common/gnuslib.c @@ -202,16 +202,20 @@ connect_to_unix_server (void) long glibtop_internet_addr (const char *host) { - struct hostent *hp; /* pointer to host info for remote host */ + /* specify IPv4 and TCP */ + struct addrinfo hints = { AF_INET, SOCK_STREAM, }; + struct addrinfo *result;/* pointer to host info for remote host */ IN_ADDR numeric_addr; /* host address */ - numeric_addr = inet_addr (host); - if (!NUMERIC_ADDR_ERROR) + if (getaddrinfo (NULL, host, &hints, &result) == 0) { + /* Take only the first address. */ + struct sockaddr_in *res = (struct sockaddr_in *)result->ai_addr; + numeric_addr = res->sin_addr.s_addr; + freeaddrinfo (result); return numeric_addr; - else if ((hp = gethostbyname (host)) != NULL) - return ((struct in_addr *) (hp->h_addr))->s_addr; + } else { - glibtop_warn_io ("gethostbyname (%s)", host); + glibtop_warn_io ("getaddrinfo (%s)", host); return -1; } From 9d385bdd1a1a5cef1a625316119880abad339d7f Mon Sep 17 00:00:00 2001 From: Andrea Azzarone Date: Mon, 26 Mar 2018 14:11:12 +0200 Subject: [PATCH 094/102] Ignore file systems if mounted with x-gdu.hide userspace mount option. Scan /run/mount/utab file if present and hide all file systems mounted with x-gdu.hide userspace mount options. https://gitlab.gnome.org/GNOME/libgtop/issues/38 --- sysdeps/linux/mountlist.c | 61 ++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 13 deletions(-) diff --git a/sysdeps/linux/mountlist.c b/sysdeps/linux/mountlist.c index 7c376fdc..c5a3c273 100644 --- a/sysdeps/linux/mountlist.c +++ b/sysdeps/linux/mountlist.c @@ -40,7 +40,8 @@ End: typedef struct { - GHashTable *table; + GHashTable *table_fstype; + GHashTable *table_mntdir; } IgnoreList; @@ -49,7 +50,8 @@ ignore_list_new(void) { IgnoreList* ig; ig = g_new(IgnoreList, 1); - ig->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + ig->table_fstype = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + ig->table_mntdir = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); return ig; } @@ -58,24 +60,38 @@ static void ignore_list_delete(IgnoreList* ig) { if (ig) { - g_hash_table_destroy(ig->table); + g_hash_table_destroy(ig->table_fstype); + g_hash_table_destroy(ig->table_mntdir); g_free(ig); } } static void -ignore_list_add(IgnoreList* ig, const char* fs) +ignore_list_add_fstype(IgnoreList* ig, const char* fstype) { - g_hash_table_insert(ig->table, g_strdup(fs), GINT_TO_POINTER(1)); + g_hash_table_insert(ig->table_fstype, g_strdup(fstype), GINT_TO_POINTER(1)); } +static void +ignore_list_add_mntdir(IgnoreList* ig, const char* mntdir) +{ + g_hash_table_insert(ig->table_mntdir, g_strdup(mntdir), GINT_TO_POINTER(1)); +} static gboolean -ignore_list_has(IgnoreList* ig, const char* fs) +ignore_list_has_fstype(IgnoreList* ig, const char* fstype) { gpointer data; - data = g_hash_table_lookup(ig->table, fs); + data = g_hash_table_lookup(ig->table_fstype, fstype); + return data != NULL; +} + +static gboolean +ignore_list_has_mntdir(IgnoreList* ig, const char* mntdir) +{ + gpointer data; + data = g_hash_table_lookup(ig->table_mntdir, mntdir); return data != NULL; } @@ -84,7 +100,7 @@ ignore_list_has(IgnoreList* ig, const char* fs) static gboolean -ignore_fs(const char *fstype, IgnoreList** ig) +ignore_fs(const char *mntdir, const char *fstype, IgnoreList** ig) { if (!*ig) { FILE* fs; @@ -92,24 +108,43 @@ ignore_fs(const char *fstype, IgnoreList** ig) *ig = ignore_list_new(); - ignore_list_add(*ig, "none"); + ignore_list_add_fstype(*ig, "none"); if ((fs = fopen("/proc/filesystems", "r")) != NULL) { while (fgets(line, sizeof line, fs)) { if (!strncmp(line, "nodev", 5)) { char *type; type = g_strstrip(line + 5); - ignore_list_add(*ig, type); + ignore_list_add_fstype(*ig, type); } } fclose(fs); } + + if ((fs = fopen("/run/mount/utab", "r")) != NULL) { + size_t len = 0; + char *uline = NULL; + + while (getline(&uline, &len, fs) != -1) { + if (strstr(uline, "x-gdu.hide")) { + char * pch = strtok (uline, " "); + while (pch != NULL) { + if (!strncmp(pch, "TARGET=", 7)) { + ignore_list_add_mntdir(*ig, pch+7); + } + pch = strtok (NULL, " "); + } + } + } + + free(uline); + fclose(fs); + } } - return ignore_list_has(*ig, fstype); + return ignore_list_has_fstype(*ig, fstype) || ignore_list_has_mntdir(*ig, mntdir); } - glibtop_mountentry * glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) { @@ -136,7 +171,7 @@ glibtop_get_mountlist_s(glibtop *server, glibtop_mountlist *buf, int all_fs) const char *devopt; gsize len; - if (!all_fs && ignore_fs(mnt->mnt_type, &ig)) + if (!all_fs && ignore_fs(mnt->mnt_dir, mnt->mnt_type, &ig)) continue; len = entries->len; From f7a00681a9c7ccb69dcbafe10151e1398a6db3d7 Mon Sep 17 00:00:00 2001 From: Robert Antoni Buj Gelonch Date: Sun, 14 Apr 2019 13:12:04 +0200 Subject: [PATCH 095/102] ZFS on Linux don't should be added to ignore list See https://github.com/mate-desktop/mate-system-monitor/pull/146 --- sysdeps/linux/mountlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/linux/mountlist.c b/sysdeps/linux/mountlist.c index c5a3c273..7fd17a94 100644 --- a/sysdeps/linux/mountlist.c +++ b/sysdeps/linux/mountlist.c @@ -112,7 +112,7 @@ ignore_fs(const char *mntdir, const char *fstype, IgnoreList** ig) if ((fs = fopen("/proc/filesystems", "r")) != NULL) { while (fgets(line, sizeof line, fs)) { - if (!strncmp(line, "nodev", 5)) { + if (!strncmp(line, "nodev", 5) && strncmp(line+strlen(line)-4, "zfs", 3)) { char *type; type = g_strstrip(line + 5); ignore_list_add_fstype(*ig, type); From 80cfde7c7fa570b8d47cf0ddffcabef6805a2049 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Tue, 25 Apr 2023 15:20:26 +0200 Subject: [PATCH 096/102] DOAP: Fix 'bug-database' value to point to GNOME GitLab Issues --- libgtop.doap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libgtop.doap b/libgtop.doap index 56a7d919..c0b1a9db 100644 --- a/libgtop.doap +++ b/libgtop.doap @@ -6,8 +6,9 @@ libgtop LibGTop2 + A library for collecting system monitoring data - + C From 306f5d0c8f7554611cea57f4d7c652adbdf58903 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Fri, 4 Aug 2023 09:26:02 +0000 Subject: [PATCH 097/102] Add util-linux to fedora dependencies to fix pipeline failures --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0ee71324..dfa7d68b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ variables: gettext-devel gobject-introspection-devel gtk-doc + util-linux texinfo-tex FEDORA_DEPENDENCIES_ABI_CHECK: libabigail From 079b9e17c50407d6f1e2b9f9189693a4ba357357 Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Fri, 4 Aug 2023 11:09:12 +0200 Subject: [PATCH 098/102] Fix get_from_pipe potentially reading more bytes than its buffer size --- .gitignore | 1 + examples/Makefile.am | 2 +- sysdeps/linux/disk.c | 2 +- sysdeps/linux/glibtop_private.c | 10 ++++------ sysdeps/linux/glibtop_private.h | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 63dec343..4b36b554 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,7 @@ doc/texinfo.tex doc/version.texi examples/affinity examples/df +examples/disk examples/diskio examples/first examples/free diff --git a/examples/Makefile.am b/examples/Makefile.am index e2b72115..84e074e5 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -11,7 +11,7 @@ AM_LDFLAGS = $(LIBGTOP_EXTRA_LIBS) noinst_PROGRAMS = first second pprint procargs df netlist \ mountlist procmap netload sysdeps timings \ - openfiles smp proclist free wd affinity diskio sysinfo + openfiles smp proclist free wd affinity disk diskio sysinfo first_SOURCES = first.c first_LDADD = $(top_builddir)/lib/libgtop-2.0.la diff --git a/sysdeps/linux/disk.c b/sysdeps/linux/disk.c index 89acd686..bafd346f 100644 --- a/sysdeps/linux/disk.c +++ b/sysdeps/linux/disk.c @@ -235,7 +235,7 @@ glibtop_get_disk_s (glibtop *server, glibtop_disk *buf) file_to_buffer (server, buffer, sizeof buffer, FILENAME); - get_from_pipe (map_buffer, CMD_PIPE); + get_from_pipe (map_buffer, STAT_BUFSIZ, CMD_PIPE); /* * GLOBAL diff --git a/sysdeps/linux/glibtop_private.c b/sysdeps/linux/glibtop_private.c index 7bca42a5..18cb7a6e 100644 --- a/sysdeps/linux/glibtop_private.c +++ b/sysdeps/linux/glibtop_private.c @@ -58,17 +58,15 @@ skip_token (const char *p) void -get_from_pipe (char *buffer, const char *cmd) +get_from_pipe (char *buffer, const size_t bufsiz, const char *cmd) { FILE* fp; - long psize; fp = popen (cmd, "r"); - fseek (fp, 0, SEEK_END); - psize = ftell (fp); - fseek (fp, 0, SEEK_SET); - fread(buffer,1,psize,fp); + size_t psize = fread(buffer,1,bufsiz,fp); + if (psize == bufsiz) + g_warning("Read bufsiz bytes, there may be more"); pclose (fp); } diff --git a/sysdeps/linux/glibtop_private.h b/sysdeps/linux/glibtop_private.h index 39101163..b9b7b9fc 100644 --- a/sysdeps/linux/glibtop_private.h +++ b/sysdeps/linux/glibtop_private.h @@ -62,7 +62,7 @@ skip_line (const char *p) } void -get_from_pipe (char *buffer, const char *cmd); +get_from_pipe (char *buffer, const size_t bufsiz, const char *cmd); /* * Smart strtoul which handles binary suffixes From f579574b86768d5a38f19431efc0b9a8ad05d0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sabri=20=C3=9Cnal?= Date: Tue, 8 Aug 2023 10:46:58 +0000 Subject: [PATCH 099/102] Update Turkish translation --- po/tr.po | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/po/tr.po b/po/tr.po index 80efda86..2d1de2e9 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,21 +1,21 @@ # translation of libgtop to Turkish # Copyright (C) 2004 Free Software Foundation, Inc. -# Copyright (C) 2009-2022 libgtop's COPYRIGHT HOLDER +# Copyright (C) 2009-2023 libgtop's COPYRIGHT HOLDER # This file is distributed under the same license as the libgtop package. # # Görkem Çetin , 2001. # Ömer Fadıl USTA ,2002. -# Baris Cicek , 2004, 2008. +# Baris Çicek , 2004, 2008. # Emin Tufan Çetin , 2017. # msgid "" msgstr "" "Project-Id-Version: libgtop\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libgtop/issues\n" -"POT-Creation-Date: 2022-07-07 17:11+0000\n" +"POT-Creation-Date: 2023-01-25 20:47+0000\n" "PO-Revision-Date: 2017-09-05 07:33+0300\n" "Last-Translator: Emin Tufan Çetin \n" -"Language-Team: Türkçe \n" +"Language-Team: Türkçe \n" "Language: tr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -45,23 +45,23 @@ msgid "wrote %d byte" msgid_plural "wrote %d bytes" msgstr[0] "%d bayt yazıldı" -#: src/daemon/gnuserv.c:456 +#: src/daemon/gnuserv.c:460 msgid "Enable debugging" msgstr "Hata ayıklamayı etkinleştir" -#: src/daemon/gnuserv.c:458 +#: src/daemon/gnuserv.c:462 msgid "Enable verbose output" msgstr "Detaylı çıktıyı etkinleştir" -#: src/daemon/gnuserv.c:460 +#: src/daemon/gnuserv.c:464 msgid "Don’t fork into background" msgstr "Arka plana çatallama" -#: src/daemon/gnuserv.c:462 +#: src/daemon/gnuserv.c:466 msgid "Invoked from inetd" msgstr "Inetd’den çalıştırıldı" -#: src/daemon/gnuserv.c:498 +#: src/daemon/gnuserv.c:502 #, c-format msgid "Run “%s --help” to see a full list of available command line options.\n" msgstr "" From 1efbbd12977a4d0e27d78e52b8125581b0993db8 Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Tue, 5 Sep 2023 08:09:44 +0300 Subject: [PATCH 100/102] Fixed build on solaris (fixes #47) --- sysdeps/solaris/Makefile.am | 3 ++- sysdeps/solaris/procio.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sysdeps/solaris/Makefile.am b/sysdeps/solaris/Makefile.am index b3d3d513..663b4b18 100644 --- a/sysdeps/solaris/Makefile.am +++ b/sysdeps/solaris/Makefile.am @@ -16,7 +16,8 @@ libgtop_sysdeps_2_0_la_LDFLAGS = $(LT_VERSION_INFO) libgtop_sysdeps_2_0_la_LIBADD = @DL_LIB@ libgtop_sysdeps_suid_2_0_la_SOURCES = open_suid.c close_suid.c \ - shm_limits.c msg_limits.c sem_limits.c + shm_limits.c msg_limits.c sem_limits.c \ + procio.c libgtop_sysdeps_suid_2_0_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/solaris/procio.c b/sysdeps/solaris/procio.c index a4846aee..9b2313ee 100644 --- a/sysdeps/solaris/procio.c +++ b/sysdeps/solaris/procio.c @@ -21,6 +21,7 @@ #include #include +#include #include static const unsigned long _glibtop_sysdeps_proc_io = 0; @@ -40,4 +41,5 @@ glibtop_get_proc_io_s (glibtop *server, glibtop_proc_io *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_io)); + buf->flags = _glibtop_sysdeps_proc_io; } From c7be3497440804179b7e3095cc24f5ec7a3a970d Mon Sep 17 00:00:00 2001 From: ToMe25 Date: Wed, 13 Sep 2023 17:59:03 +0200 Subject: [PATCH 101/102] Change disk example read/write unit to bytes Also add units to headers --- examples/disk.c | 10 +++++----- examples/sysinfo.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/disk.c b/examples/disk.c index c3c61142..9fc1e624 100644 --- a/examples/disk.c +++ b/examples/disk.c @@ -46,15 +46,15 @@ main (int argc, char *argv []) separator [92] = '\0'; printf("\n\n"); - printf ("ELAPSE "); - printf ("Read Time Read Write Time Write\n"); + printf ("ELAPSE "); + printf ("Read (b) Time Read (ms) Write (b) Time Write (ms)\n"); printf ("%s\n", separator); for (i = 0; i < ndisk; i++) { - printf ("DISK %3d : %12lu %12lu %12lu %12lu\n", i, - (unsigned long) disk.xdisk_sectors_read [i], + printf ("DISK %3d : %15lu %15lu %15lu %15lu\n", i, + (unsigned long) disk.xdisk_sectors_read [i] * 512, (unsigned long) disk.xdisk_time_read [i], - (unsigned long) disk.xdisk_sectors_write [i], + (unsigned long) disk.xdisk_sectors_write [i] * 512, (unsigned long) disk.xdisk_time_write [i]); } diff --git a/examples/sysinfo.c b/examples/sysinfo.c index 3c570e9f..3b714e78 100644 --- a/examples/sysinfo.c +++ b/examples/sysinfo.c @@ -40,7 +40,7 @@ main (int argc, char *argv []) model = g_hash_table_lookup (sysinfo->cpuinfo [1].values, "model name"); printf ("\nProcessor Model: %s\n", g_strdup (model)); - printf ("Number of Cores: %d\n\n", sysinfo->ncpu); + printf ("Number of Cores: %lu\n\n", sysinfo->ncpu); glibtop_close (); From b8460a20ff70233f8230f78d3f99ff13cc4d2096 Mon Sep 17 00:00:00 2001 From: Robert Roth Date: Sun, 15 Oct 2023 14:58:30 +0300 Subject: [PATCH 102/102] Prepared release 2.41.2 --- NEWS | 28 ++++++++++++++++++++++++++++ configure.ac | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 21c7e299..90b54dab 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,31 @@ +15 October 2023: Overview of changes in 2.41.2 +================================================ + +* Solaris + - Fix build #47 +* Linux + - Change disk example read/write unit to bytes + - Fixed potential Buffer overflow when reading disk stats + - Changed disk read/write unit to bytes in example +* CI + - Fixed CI by adding missing dependency + + +10 January 2023 : Overview of changes in 2.41.1 +================================================ + +* FreeBSD + - Build fixes + - Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry +* OpenBSD + - Build fixes +* Linux + - skip loop and rom devices +* Allow building with gettext >= 0.20 +* Updated translations +* CI build setup + + 11 March 2019: Overview of changes in 2.40.0 ================================================ diff --git a/configure.ac b/configure.ac index 5df6bc54..6204a5e2 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ dnl m4_define([libgtop_major_version], [2]) m4_define([libgtop_minor_version], [41]) -m4_define([libgtop_micro_version], [1]) +m4_define([libgtop_micro_version], [2]) m4_define([libgtop_version], [libgtop_major_version.libgtop_minor_version.libgtop_micro_version]) dnl increment if the interface has additions, changes, removals.