Commit Graph

873 Commits

Author SHA1 Message Date
James Dominic P. Guana
2ec1815e6c Revert "Revert "Code clean up and add example""
This reverts commit ea08151ae6.
2021-04-23 09:48:11 +00:00
James Dominic P. Guana
48595809ed Revert "Revert "Handle LVM and RAID""
This reverts commit 30bf8d0418.
2021-04-23 09:48:11 +00:00
James Dominic P. Guana
a067db0569 Revert "Revert "New API to retrieve disk stats in Linux""
This reverts commit 7e214414bf.
2021-04-23 09:48:11 +00:00
ToMe25
68b5269607 Fix msg_limits.c and sem_limits.c error message 2021-04-19 15:40:25 +02:00
robert
43e4c52579 Fix shm_limits.c, sem_limits.c, and msg_limits.c
by using sysctl instead of kvm_nlist

Co-authored-by: jasper <jasper@openbsd.org>
2021-04-19 15:34:58 +02:00
ToMe25
fd162f9cb8 Fix kvm_open issue 2021-04-19 02:50:48 +02:00
ToMe25
b8a0475a42 Fix deleted empty line 2021-04-18 23:49:58 +02:00
ToMe25
76c2e7178a Fix remaining compile errors
Finalize(hopefully) procmap.c fix
copy stub procio.c to fix compile errors
undo rb workaround
2021-04-18 23:36:43 +02:00
ToMe25
7c14ffaf54 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.
2021-04-18 21:37:18 +02:00
ToMe25
cfabe09ad8 Fix some more procmap.c issues
Commit acinclude getmntinfo workaround
2021-04-18 17:49:33 +02:00
ToMe25
72124ab005 Undo some procmap.c changes 2021-04-18 04:28:08 +02:00
ToMe25
9e68eb94c3 Fix compilation issues in sysdeps/openbsd/netload.c 2021-04-18 02:45:57 +02:00
ToMe25
5714b6089c Fix openbsd procmap.c compile errors 2021-04-18 01:04:59 +02:00
Michael Catanzaro
7e214414bf Revert "New API to retrieve disk stats in Linux"
This reverts commit 9e62440b31.
2020-11-06 09:52:01 -06:00
Michael Catanzaro
30bf8d0418 Revert "Handle LVM and RAID"
This reverts commit 9cbb3b91f1.
2020-11-06 09:52:00 -06:00
Michael Catanzaro
ea08151ae6 Revert "Code clean up and add example"
This reverts commit 7396970afe.
2020-11-06 09:52:00 -06:00
Michael Catanzaro
2229253e11 Revert "Updated config and added reference"
This reverts commit e9da959773.
2020-11-06 09:51:58 -06:00
James Dominic P. Guana
e9da959773 Updated config and added reference 2020-11-04 13:38:03 +00:00
James Dominic P. Guana
7396970afe Code clean up and add example 2020-11-04 13:38:03 +00:00
James Dominic P. Guana
9cbb3b91f1 Handle LVM and RAID 2020-11-04 13:38:03 +00:00
James Dominic P. Guana
9e62440b31 New API to retrieve disk stats in Linux 2020-11-04 13:38:03 +00:00
Neel Chauhan
9b4a03ed0a Support FreeBSD 13.0-CURRENT >= 1300062 vm_map_entry 2019-12-15 11:06:37 -05:00
Ting-Wei Lan
bb118fa9d6 freebsd: Support laundry memory and ZFS ARC
FreeBSD 11.1 removes cache memory and adds laundry memory. The MIB of
cache memory still exists, but its value is always set to zero.
According to the man page of top(1), the value of laundry memory means
number of dirty pages queued for laundering, suggesting that it should
be added to the 'user' in libgtop because it cannot be freed immediately
without writing out data. Laundry memory was part of inactive memory in
older FreeBSD releases.

FreeBSD systems running on ZFS usually have a large portion of memory
used as ZFS ARC, which has similar purpose to buffer cache of other
filesystems. ZFS ARC can usually be freed quickly when the system needs
more memory, so we don't want to put it in 'user' in libgtop. However,
both buffer cache and ZFS ARC are parts of wired memory, and wired
memory is counted in 'user'. Therefore, we subtract the size of ZFS ARC
from wired memory when calculating 'user' value, making it more useful
to FreeBSD users.

This patch is based on the patch submiited three years ago by
Benoît Dejean <bdejean@gmail.com>.

https://bugzilla.gnome.org/show_bug.cgi?id=748928
https://gitlab.gnome.org/GNOME/libgtop/issues/31
2018-10-25 00:30:12 +08:00
Benoît Dejean
7c811a7826 Fixed 3 old compile warnings. 2018-07-22 12:23:11 +02:00
Benoît Dejean
e4335d4db2 glibtop_get_proc_map on Linux doesn't need to be SUID.
Revert this proof of concept.
Add C file with comments to document how to make a call SUID.
2018-03-26 18:15:26 +02:00
Benoît Dejean
ec662d01da Make linux build with server.
Add suid infrastructure.
Demo proc_map.
2018-03-26 17:44:43 +02:00
Benoît Dejean
4f36c74b68 Fix build on freebsd and darwin. 2018-03-07 20:47:44 +01:00
Benoît Dejean
c65cb3e46b Rename GLIBTOP_SUID_PROC_FILE to GLIBTOP_SUID_PROC_OPEN_FILES.
The previous name is incorrect and inconsistent with the code generated
by lib.pl.
Also add missing hooks.

This symbol, although exposed in public headers is not part of the API
and is only used internally.
2018-03-07 19:44:41 +01:00
Benoît Dejean
42b049f338 Fix darwin build by adding dummy proc_io implementation.
https://gitlab.gnome.org/GNOME/libgtop/issues/36
2018-02-11 09:12:54 +01:00
Benoît Dejean
f38d9c6523 Regenerate with gperf-3.1. 2017-08-31 18:10:21 +02:00
Benoit Dejean
d3df61ddbf Fix build for FreeBSD 11.1.
The ufs struct inode has changed a requires a different code to get the
device number.
2017-07-29 14:18:45 +02:00
Robert Roth
43740ddab7 Merge branch 'wip/diskio' 2017-05-23 00:02:47 +03:00
Benoit Dejean
779386cb15 Implement disk_rbytes and disk_wbytes for FreeBSD. 2017-05-20 11:34:25 +02:00
Robert Roth
5880e04fcc Prepended disk io struct fields with disk_ prefix 2017-05-12 05:14:17 +03:00
Robert Roth
1bf16bfffd Renamed procdiskio to procio 2017-05-12 05:08:41 +03:00
Benoît Dejean
aae804c3dc Add NULL pointer checker (bug found with scan-build). 2017-05-01 06:32:41 +02:00
Benoit Dejean
c29d7de9a0 Add dummy proc_diskio implementation for FreeBSD. 2017-02-25 16:30:18 +01:00
Benoît Dejean
1defc74f07 Set glibtop_proc_diskio.flags.
Check linux version code before reading /proc/PID/io.
2017-02-21 12:50:37 +01:00
Robert Roth
dff7c5588e New API to retrieve process io stats, with Linux implementation 2017-02-12 17:59:08 +02:00
Benoît Dejean
1a103bf142 When parsing /proc/cpuinfo, ignore paragraphs that do not describe a CPU/core. 2017-01-28 09:39:43 +01:00
Benoît Dejean
01a56e2e30 Use g_ascii_isspace instead of isspace because the later is slower and we
only need to deal with ascii.
2017-01-22 10:45:26 +01:00
Benoît Dejean
7afc81f99d Do not cache getpagesize(), it is already. 2017-01-22 10:45:26 +01:00
Benoît Dejean
b0ab056e99 Use a dynamically allocated buffer to read /proc/cpuinfo to handle computers
with a lot of CPUs.

https://bugzilla.gnome.org/show_bug.cgi?id=323354
2017-01-22 10:45:26 +01:00
Robert Roth
70e00a0262 Fixed indentation problem 2016-11-27 20:10:00 +02:00
Florian Müllner
f99bb61446 procstate: Fill in last_processor member on linux
The field was added almost 20 years ago, but has only been set on
Solaris so far. It turns out we have a use for it now in the new
"Usage" application, so also fill it in on Linux.

https://bugzilla.gnome.org/show_bug.cgi?id=775182
2016-11-27 20:07:20 +02:00
Ting-Wei Lan
59d9780eae freebsd: Support GLIBTOP_IF_FLAGS_WIRELESS in netload
The ioctl call used in this patch doesn't seems to be documented. It is
what ifconfig(8) command uses to display the media type, and its usage
can be learned by reading the source code of ifconfig(8).

https://bugzilla.gnome.org/show_bug.cgi?id=770165
2016-08-20 16:46:15 +03:00
Gleb Smirnoff
305701c637 freebsd: Rewrite netload implementation with getifaddrs and ioctl
Instead of using a documented and official API to get information related
to a network interface, the old implementation uses kvm library to access
kernel memory directly, which is not easy to understand and can be easily
broken by changing kernel symbols or structs. Besides, FreeBSD 11 hides
severai required kernel struct definitions from userspace programs, which
causes compilation error because the definition of 'struct ifaddr' is not
available unless _KERNEL is defined.

This patch is primarily authored by Gleb Smirnoff <glebius@FreeBSD.org>,
with other simple modification made by Antoine Brodin <antoine@FreeBSD.org>,
Koop Mast <kwm@FreeBSD.org> and Ting-Wei Lan <lantw@src.gnome.org> applied.
It was first submitted to FreeBSD ports and has been used by FreeBSD users
for more than 18 months on all supported versions of FreeBSD.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194187
https://svnweb.freebsd.org/changeset/ports/371082
https://github.com/freebsd/freebsd-ports-gnome/commit/be884cd
https://github.com/freebsd/freebsd-ports-gnome/commit/422a418
https://github.com/freebsd/freebsd-ports-gnome/commit/a4b1913
https://bugzilla.gnome.org/show_bug.cgi?id=770165
2016-08-20 16:46:15 +03:00
Kylie McClain
94968b4406 Fix building on musl-libc
libgtop fails to build on musl libc, due to the header
resulting in the headers that would be loaded for libc 5 being
loaded on musl libc.
musl defines headers which are also defined in linux-headers'
in.h, causing redefinition errors.

https://bugzilla.gnome.org/show_bug.cgi?id=760655

Signed-off-by: Benoît Dejean <bdejean@gmail.com>
2016-02-16 18:12:00 +01:00
Antoine Jacoutot
de408a6bba openbsd: only PID 1 is special (init) 2016-01-12 17:14:20 +01:00
Jasper Lievisse Adriaanse
02070b7170 Add various headers to unbreak compilation 2015-12-11 15:03:49 +01:00