FreeBSD Bugzilla – Attachment 241391 Details for
Bug 270733
sysutils/xosview: fix for bug 269493
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix for memory report broken
0001-Fix-issue-https-bugs.freebsd.org-bugzilla-show_bug.c.patch (text/plain), 3.11 KB, created by
Otacílio de Araújo Ramos Neto
on 2023-04-09 23:45:22 UTC
(
hide
)
Description:
Fix for memory report broken
Filename:
MIME Type:
Creator:
Otacílio de Araújo Ramos Neto
Created:
2023-04-09 23:45:22 UTC
Size:
3.11 KB
patch
obsolete
>From 5907bb2cb8ff12c630f51d3868eeefa6f3505ab5 Mon Sep 17 00:00:00 2001 >From: Charlie Root <otaciliodearaujo@gmail.com> >Date: Sun, 9 Apr 2023 20:37:52 -0300 >Subject: [PATCH] Fix issue > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269493 > >--- > sysutils/xosview/files/patch-bsd_kernel.cc | 38 +++++++++++++++++++--- > 1 file changed, 33 insertions(+), 5 deletions(-) > >diff --git a/sysutils/xosview/files/patch-bsd_kernel.cc b/sysutils/xosview/files/patch-bsd_kernel.cc >index 4fb5fe787e4f..a008568f689e 100644 >--- a/sysutils/xosview/files/patch-bsd_kernel.cc >+++ b/sysutils/xosview/files/patch-bsd_kernel.cc >@@ -1,4 +1,4 @@ >---- bsd/kernel.cc.orig 2021-05-16 03:48:22 UTC >+--- bsd/kernel.cc.orig 2020-07-11 12:10:34 UTC > +++ bsd/kernel.cc > @@ -48,8 +48,10 @@ static int maxcpus = 1; > #include <sys/ioctl.h> >@@ -11,7 +11,35 @@ > > #if defined(XOSVIEW_NETBSD) > #include <sys/sched.h> >-@@ -1558,6 +1560,7 @@ BSDHasBattery() { >+@@ -338,15 +340,14 @@ BSDGetPageStats(uint64_t *meminfo, uint64_t *pageinfo) >+ u_int v_swappgsout; >+ } vm; >+ #if defined(XOSVIEW_FREEBSD) >+- size_t size = sizeof(unsigned int); >++ size_t size = sizeof(u_int); >++ bzero(&vm, sizeof(vm)); >+ #define GET_VM_STATS(name) \ >+ sysctlbyname("vm.stats.vm." #name, &vm.name, &size, NULL, 0) >+ GET_VM_STATS(v_active_count); >+ GET_VM_STATS(v_inactive_count); >+ GET_VM_STATS(v_wire_count); >+-#if __FreeBSD_version < 1200017 >+ GET_VM_STATS(v_cache_count); >+-#endif >+ GET_VM_STATS(v_free_count); >+ GET_VM_STATS(v_page_size); >+ GET_VM_STATS(v_vnodepgsin); >+@@ -368,9 +369,7 @@ BSDGetPageStats(uint64_t *meminfo, uint64_t *pageinfo) >+ meminfo[0] = (uint64_t)vm.v_active_count * vm.v_page_size; >+ meminfo[1] = (uint64_t)vm.v_inactive_count * vm.v_page_size; >+ meminfo[2] = (uint64_t)vm.v_wire_count * vm.v_page_size; >+-#if __FreeBSD_version < 1200017 >+ meminfo[3] = (uint64_t)vm.v_cache_count * vm.v_page_size; >+-#endif >+ meminfo[4] = (uint64_t)vm.v_free_count * vm.v_page_size; >+ #else /* XOSVIEW_DFBSD */ >+ meminfo[0] = (uint64_t)vms.v_active_count * vms.v_page_size; >+@@ -1558,6 +1557,7 @@ BSDHasBattery() { > #else // XOSVIEW_FREEBSD || XOSVIEW_DFBSD > int fd; > if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { >@@ -19,7 +47,7 @@ > // No ACPI -> try APM > if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) > return false; >-@@ -1569,6 +1572,9 @@ BSDHasBattery() { >+@@ -1569,6 +1569,9 @@ BSDHasBattery() { > if (aip.ai_batt_stat == 0xff || aip.ai_batt_life == 0xff) > return false; > return true; >@@ -29,7 +57,7 @@ > } > > union acpi_battery_ioctl_arg battio; >-@@ -1717,6 +1723,7 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) >+@@ -1717,6 +1720,7 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) > /* Adapted from acpiconf and apm. */ > int fd; > if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { >@@ -37,7 +65,7 @@ > // No ACPI -> try APM > if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) > err(EX_OSFILE, "could not open %s or %s", ACPIDEV, APMDEV); >-@@ -1740,6 +1747,10 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) >+@@ -1740,6 +1744,10 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) > else > *state = XOSVIEW_BATT_NONE; > return; >-- >2.40.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 270733
: 241391 |
241392