[patch on PR] make installworld DESTDIR= failure
Hi, Given 12-ALPHA added ntpd uid and gid, make installworld DESTDIR= fails as it checks ntpd user and group id under /etc instead of $DESTDIR/etc. I created a PR and then created a patch and tested; however, it doesn't look the PR got enough attension. Could some one take a look at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231334 ? Thanks, Hiro ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: uname -a output without svn revision number
I've seen such failures with NFS without lockd. Svn fails as it cannot lock its files, too. Hiro On Fri, 4 Jan 2019 10:41:56 -0500 Ed Maste wrote: > On Fri, 4 Jan 2019 at 10:36, Matthias Apitz wrote: > > > > To save space on the netbook > > I excluded /usr/src/.svn which is causing now the absence of the > > revision number. > > Yes, newvers.sh relies on the metadata in .svn to determine the > revision number so this is as expected. > ___ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
sysctl -zarc for ZFS users
Hi all. I've been watching ZFS activites on my machine and improved systat to monitor such. One of my first goals is to watch ZFS cache statistics. I posted my patch to the bugzilla @ https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195460 I've been using on 11-CURRENT and 10.1-RELEASE myself. Regards, Hiro % systat -zarc Total MFU MRUAnon Hdr L2Hdr Other ZFS ARC206M 63M136M826K 1102K 0K 5251K ratehits misses total hits total misses arcstats : 75%1183 38823721 4202 arcstats.demand_data : 0% 0 0 5280 arcstats.demand_metadata : 76%1007 30821441 2757 arcstats.prefetch_data: 0% 0 000 arcstats.prefetch_metadata: 68% 176 80 1752 1445 zfetchstats : 44% 95412042641025482 arcstats.l2 : 0% 0 000 vdev_cache_stats : 0% 0 000 ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: sysctl -zarc for ZFS users
Thank you for your report, Maurizio. I missed 'svn add zarc.c' and resuled an incompelte patch. I uploaded a new one with a complete set to the bugzilla. Please try against clean directory, i.e. svn revert -R usr.bin/systat. Thanks, Hiro On Sat, 6 Dec 2014 15:28:05 +0100 "Ranjan1018 ." <21474...@gmail.com> wrote: > 2014-12-06 11:35 GMT+01:00 Yoshihiro Ota : > > > Hi all. > > > > I've been watching ZFS activites on my machine and > > improved systat to monitor such. > > > > One of my first goals is to watch ZFS cache statistics. > > > > I posted my patch to the bugzilla @ > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=195460 > > I've been using on 11-CURRENT and 10.1-RELEASE myself. > > > > Regards, > > Hiro > > > > % systat -zarc > >Total MFU MRUAnon Hdr L2Hdr > > Other > > ZFS ARC206M 63M136M826K 1102K 0K > > 5251K > > > > ratehits misses total hits total > > misses > > arcstats : 75%1183 38823721 > > 4202 > > arcstats.demand_data : 0% 0 0 528 > > 0 > > arcstats.demand_metadata : 76%1007 30821441 > > 2757 > > arcstats.prefetch_data: 0% 0 00 > > 0 > > arcstats.prefetch_metadata: 68% 176 80 1752 > > 1445 > > zfetchstats : 44% 954120426410 > > 25482 > > arcstats.l2 : 0% 0 00 > > 0 > > vdev_cache_stats : 0% 0 00 > > 0 > > > > Hi Hiro, > > just applied the patch, but I receive the error: > > # make > make: don't know how to make zarc.c. Stop > make: stopped in /usr/src/usr.bin/systat > > The file zarc,c is missing. Where can I find it ? > > Thanks. > Maurizio > ___ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
wlan/ifconfig stopped working sometime between 5/25 and 6/3
Hi, I started getting the following error when I tried to bring up wireless connection since June 3rd. I had last updated kernel and world on May 25th before. "unable to get regulatory domain info: Device not configured" ifconfig starts working again after I reverted the user land backt May 25th one; kernel don't seem to be a fact here. I use "ifconfig wlan create wlandev ath0 ssid wepmode on wepkey weptxkey 1 up". Is something changed in ifconfig? Do I need to use different arguments? Thanks, Hiro ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: wlan/ifconfig stopped working sometime between 5/25 and 6/3
Thanks, Andriy. Indeed, this patch fixed my issue. Hiro On Tue, 07 Jun 2016 15:54:36 +0300 "Andriy Voskoboinyk" wrote: > Tue, 07 Jun 2016 07:42:48 +0300 було написано Adrian Chadd > : > > Hi, > > the attached patch should fix this issue > (no idea if it can be fixed in a better way...) > > > Hi, > > > > this is a recent change to the regulatory handling. I've emailed > > Andriy who wrote the code. :) > > > > Andriy, any ideas? > > > > > > > > -adrian > > > > > > On 6 June 2016 at 20:15, Yoshihiro Ota wrote: > >> Hi, > >> > >> I started getting the following error when I tried to bring up wireless > >> connection since June 3rd. I had last updated kernel and world on May > >> 25th before. > >> > >> "unable to get regulatory domain info: Device not configured" > >> > >> ifconfig starts working again after I reverted the user land backt May > >> 25th one; kernel don't seem to be a fact here. > >> > >> I use "ifconfig wlan create wlandev ath0 ssid wepmode on wepkey > >> weptxkey 1 up". > >> Is something changed in ifconfig? > >> Do I need to use different arguments? > >> > >> Thanks, > >> Hiro > >> ___ > >> freebsd-current@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/freebsd-current > >> To unsubscribe, send any mail to > >> "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: CFT: ndis(4) testers needed! - on 11.0-RELESE
Hi Gleb, Are you still accepting a bug report on this? I have a laptop that I need to use NDIS driver. This change impacted and causes kernel panic. I haven't used this laptop for a quite while and didn't realize it had stopped working. When I setup a wlan0 device with NDIS in wepmode, "ifconfig wlan0 up" causes kernel memory currupption and causes next ioctl/sysctl access programs such as "ps" and "sysctl -a" crash the kernel. Regards, Hiro On Fri, 31 Jul 2015 15:12:26 +0300 Gleb Smirnoff wrote: > Hi! > > I need to make couple of non-functional but rather large changes > to the if_ndis driver and will appreciate if anyone signs up to > test my changes. Please contact me if you can provide help. > > -- > Totus tuus, Glebius. > ___ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
ndis wireless on 11.0-RELESE has been broken and its patch
Hi, I've been chasing a NDIS wireless bug for a while as I realized network stopped working on some of hardware. I have its PR and also attached a patch. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213237 It will be nice if someone can follow up so that we can have 11.1-RELEASE NDIS wireless working. Regards, Hiro On Tue, 3 Jan 2017 23:40:48 -0500 Yoshihiro Ota wrote: > Hi Gleb, > > Are you still accepting a bug report on this? > I have a laptop that I need to use NDIS driver. > This change impacted and causes kernel panic. > I haven't used this laptop for a quite while and > didn't realize it had stopped working. > > When I setup a wlan0 device with NDIS in wepmode, > "ifconfig wlan0 up" causes kernel memory currupption > and causes next ioctl/sysctl access programs such > as "ps" and "sysctl -a" crash the kernel. > > Regards, > Hiro > > On Fri, 31 Jul 2015 15:12:26 +0300 > Gleb Smirnoff wrote: > > > Hi! > > > > I need to make couple of non-functional but rather large changes > > to the if_ndis driver and will appreciate if anyone signs up to > > test my changes. Please contact me if you can provide help. > > > > -- > > Totus tuus, Glebius. > > ___ > > freebsd-current@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-current > > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" > ___ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Which GPT partion type for eli?
Hi GEOM eli users, What GPT partition type do you use for geli? It doesn't look we have explicit ELI type. I've been using freebsd-ufs and freebsd-zfs instead. But they seem to have some side-effects and not best options. Hiro
Jail compile error on CURRENT?
Hi, Am I the only one seeing this error? I'm on 12.4-RELEASE amd64 and building CURRENT as of now. jaillex.c:2228:43: error: unused parameter 'yyscanner' [-Werror,-Wunused-parameter] void *yyalloc (yy_size_t size , yyscan_t yyscanner) ^ jaillex.c:2233:58: error: unused parameter 'yyscanner' [-Werror,-Wunused-parameter] void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) ^ jaillex.c:2245:36: error: unused parameter 'yyscanner' [-Werror,-Wunused-parameter] void yyfree (void * ptr , yyscan_t yyscanner) ^ 6 errors generated. *** [jaillex.o] Error code 1
Re: i386 4/4 change
What is the current status of this? Based on SVN history, it doesn't look https://reviews.freebsd.org/D14633 has been merged/commited yet. I can try after I recover from disk crahes. I expect I need few more days to restore. Will this retire PAE option? Thanks, Hiro On Sun, 1 Apr 2018 17:05:03 +1000 (EST) Bruce Evans wrote: > > On Sun, 1 Apr 2018, Dimitry Andric wrote: > > > On 31 Mar 2018, at 17:57, Bruce Evans wrote: > >> > >> On Sat, 31 Mar 2018, Konstantin Belousov wrote: > >> > >>> the change to provide full 4G of address space for both kernel and > >>> user on i386 is ready to land. The motivation for the work was to both > >>> mitigate Meltdown on i386, and to give more breazing space for still > >>> used 32bit architecture. The patch was tested by Peter Holm, and I am > >>> satisfied with the code. > >>> > >>> If you use i386 with HEAD, I recommend you to apply the patch from > >>> https://reviews.freebsd.org/D14633 > >>> and report any regressions before the commit, not after. Unless > >>> a significant issue is reported, I plan to commit the change somewhere > >>> at Wed/Thu next week. > >>> > >>> Also I welcome patch comments and reviews. > >> > >> It crashes at boot time in getmemsize() unless booted with loader which > >> I don't want to use. > > > For me, it at least compiles and boots OK, but I'm one of those crazy > > people who use the default boot loader. ;) > > I found a quick fix and sent it to kib. (2 crashes in vm86 code for memory > sizing. This is not called if loader is used && the system has smap. Old > systems don't have smap, so they crash even if loader is used.) > > > I haven't yet run any performance tests, I'll try building world and a > > few large ports tomorrow. General operation from the command line does > > not feel "sluggish" in any way, however. > > Further performance tests: > - reading /dev/zero using tinygrams is 6 times slower > - read/write of a pipe using tinygrams is 25 times slower. It also gives >unexpected values in wait statuses on exit, hopefully just because the >bug is in the test program is exposed by the changed timing (but later >it also gave SIGBUS errors). This does a context switch or 2 for every >read/write. It now runs 7 times slower using 2 4.GHz CPUs than in >FreeBSD-5 using 1 2.0 GHz CPU. The faster CPUs and 2 of them used to >make it run 4 times faster. It shows another slowdown since FreeBSD-5, >and much larger slowdowns since FreeBSD-1: > >1996 FreeBSD on P1 133MHz: 72k/s >1997 FreeBSD on P1 133MHz: 44k/s (after dyson's opts for large sizes) >1997 Linux on P1 133MHz: 93k/s (simpler is faster for small sizes) >1999 FreeBSD on K6 266MHz: 129k/s >2018 FBSD-~5 on AthXP 2GHz: 696k/s >2018 FreeBSD on i7 2x4GHz: 2900k/s >2018 FBSD4+4 on i7 2x4GHz: 113k/s (faster than Linux on a P1 133MHz!!) > > Netblast to localhost has much the same 6 times slowness as reading > /dev/zero using tinygrams. This is the slowdown for syscalls. > Tinygrams are hard to avoid for UDP. Even 1500 bytes is a tinygram > for /dev/zero. Without 4+4, localhost is very slow because it does > a context switch or 2 for every packet (even with 2 CPUs when there is > no need to switch). Without 4+4 this used to cost much the same as the > context switches for the pipe benchmark. Now it costs relatively much > less since (for netblast to localhost) all of the context switches are > between kernel threads. > > The pipe benchmark uses select() to avoid busy-waiting. That was good > for UP. But for SMP with just 2 CPUs, it is better to busy-wait and > poll in the reader and writer. > > netblast already uses busy-waiting. It used to be a bug that select() > doesn't work on sockets, at least for UDP, so blasting using busy-waiting > is the only possible method (timeouts are usually too coarse-grained to > go as fast as blasting, and if they are fine-grained enough to go fast > then they are not much better than busy-waiting with time wasted for > setting up timeouts). SMP makes this a feature. It forces use of busy- > waiting, which is best if you have a CPU free to run it and this method > doesn't take to much power. > > Context switches to task queues give similar slowness. This won't be > affected by 4+4 since task queues are in the kernel. I don't like > networking in userland since it has large syscall and context switch > costs. Increasing these by factors of 6 and 25 doesn't help. It > can only be better by combining i/o in a way that the kernel neglects > to do or which is imposed by per-packet APIs. Slowdown factors of 6 > or 25 require the combined i/o to be 6 or 25 larger to amortise the costs. > > Bruce > ___ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" __
Re: PAE on i386
Hi, I recall this result was committed a while ago to 13-CURRENT: https://svnweb.freebsd.org/base?view=revision&revision=343567 Is there a plan to MFC to 12-STABLE? Does this feature results changing ABI? Regards, Hiro On Sun, 20 Jan 2019 13:18:54 +0200 Konstantin Belousov wrote: > Hello, > at https://reviews.freebsd.org/D18894 I put a review which main goal is > to allow i386 kernels to use NX bits on capable hardware. In essence, > single kernel now can operate using either PAE or non-PAE pagetables, > the selection is done at the cold (very early boot, before paging is > turned on) time. > > This together with earlier 4/4 work gives much more life into i386 kernels > for whoever still needs them. Please review/test, see the differential > review text for more explanation. > ___ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org" ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Is pkg site forbidden by brower?
Hi, Is "403 Forbidden" an intended response for a brower access to http://pkg.freebsd.org/FreeBSD:12:i386/ nowdays? I used to see available packages with a brower and decided which one to use. How can I find distributions like "latest", "release_X", etc? Hiro ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: Is pkg site forbidden by brower?
On Sun, 6 Sep 2020 14:47:00 +0200 Michael Gmelin wrote: > > > > On 6. Sep 2020, at 12:00, Niclas Zeising > > wrote: > > > > 〓On 2020-09-06 09:00, grarpamp wrote: > >>> On 9/6/20, Kevin Oberman wrote: > >>> On Sat, Sep 5, 2020 at 8:04 PM Yoshihiro Ota wrote: > >>>> Is "403 Forbidden" an intended response for a brower access to > >>>> http://pkg.freebsd.org/FreeBSD:12:i386/ nowdays? > >>>> > >>>> I used to see available packages with a brower and decided which one to > >>>> use. > >> Some more people have noted this change > >> as breaking tool scripts, etc. > >> And useful meta files are unfortunately now invisible: > >> packagesite.txz, meta.txz, pkg.txz, pkg.txz.sig > >> If someone want to block the '/.../All/' dir full of pkgs, > >> maybe, but do not block any other part of the hier. > > > > The reason that folder listing was disabled on the package download sites > > is that it used too > > much resources. For every hit on those URLs, the web server had to > > dynamically generate the > > folder listing, and send it. This caused DDoS-like scenarios, where these > > were hit repeatedly, > > which caused problems for legitimate traffic. Since the relevant > > information is available in > > the txz files above, and also on freshports, and since pkg have no need for > > directory listing, > > it was disabled. > > > > Is this part of why pkg repos are performing so much better recently? I‘m > quite happy about > that :) > > If there’s a use case for having access to this information, we could simply > provide it through a > static index.html that’s recreated every time the directory changes. > > Cheers, > Michael Michael, Do you own pkg sites? I like the idea of creating static index.html file as there are modules with version numbers and also modules with multiple version numbers. Brower helps to find which versions are available, for example. Regards, Hiro ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
Re: FreeBSD 13.0-BETA3 Now Available
Hi, tmp/legacy/usr/bin/make fails to run when sharing /usr/obj built on 13-BETA* to 12.2-RELEASE machines. I entered https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253727 Hiro On Sat, 20 Feb 2021 20:39:50 + Glen Barber wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > The third BETA build of the 13.0-RELEASE release cycle is now available. > ___ freebsd-current@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
systat -swap to display large swap space users
Hi, We do not seem to have a nice way to see current swap space usage per process. I updated systat to use libprocstat to obtain such infomation and display along with swap devise/file stats. I think patch works for 14-CURRENT and 13-STABLE/13.0-*. 12-STABLE needs some changes from main. The new screen looks like below with 'systat -swap': /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /10 Load Average | Device/Path Size Used |0% /10 /20 /30 /40 / 60\ 70\ 80\ 90\ 100| ada0s1b 2048M 2034M X zvol/sys/tempora 1024M 1015M X zvol/sys/swap1024M 1014M X Total4096M 4063M X PidUsername Command Swap/Total Per-ProcessPer-System 24153 hiro seamonkey 98M / 1G 7% 2% 23677 hiro xfce4-pane 28M / 81M 34% XXX 0% 23629 hiro xfce4-sess 25M / 118M 21% XX 0% 23681 hiro xfdesktop 20M / 58M 34% XXX 0% 23678 hiro thunar 15M / 43M 36% XXX 0% 23658 hiro at-spi-bus 14M / 23M 63% XX 0% 23660 hiro gvfsd 12M / 21M 56% X0% Disks ada0 ada1 ada2 cd0 pass0 pass1 pass2 pass3 KB/t 8.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 tps 0 0 0 0 1 0 0 0 MB/s 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 %busy 0 0 0 0 0 0 0 0 Hiro diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile index ca3f7ed72ce..bfbe1336d29 100644 --- a/usr.bin/systat/Makefile +++ b/usr.bin/systat/Makefile @@ -5,7 +5,7 @@ PROG= systat SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ - netcmds.c netstat.c pigs.c swap.c icmp.c \ + netcmds.c netstat.c pigs.c proc.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c @@ -16,6 +16,6 @@ CFLAGS+= -DINET6 WARNS?= 1 -LIBADD= ncursesw m devstat kvm util +LIBADD= ncursesw m devstat kvm util procstat .include diff --git a/usr.bin/systat/devs.h b/usr.bin/systat/devs.h index cbedd844290..79a44a6c3f5 100644 --- a/usr.bin/systat/devs.h +++ b/usr.bin/systat/devs.h @@ -34,6 +34,8 @@ #include +#define DISKHIGHT 5 + int dsinit(int); void dsgetinfo(struct statinfo *); int dscmd(const char *, const char *, int, struct statinfo *); diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index b5a19d381ad..b84351379f4 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -135,6 +135,21 @@ parse_cmd_args (int argc, char **argv) } +static void +resize(int signo __unused) +{ + + endwin(); + refresh(); + clear(); + + CMDLINE = LINES - 1; + labels(); + display(); + status(); +} + + int main(int argc, char **argv) { @@ -191,6 +206,7 @@ main(int argc, char **argv) signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGTERM, die); + signal(SIGWINCH, resize); /* * Initialize display. Load average appears in a one line diff --git a/usr.bin/systat/proc.c b/usr.bin/systat/proc.c new file mode 100644 index 000..0def660d2dc --- /dev/null +++ b/usr.bin/systat/proc.c @@ -0,0 +1,192 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2021 Yoshihiro Ota + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include "subs.h" +#include "systat.h&quo
Re: systat -swap to display large swap space users
Hi, How about these now? These include extra improvements to other parts of systat. These patches create new files. If you already applies previosly, please check and clean up new files. Regards, Hiro On Sun, 4 Apr 2021 10:21:59 + tech-lists wrote: > Hi, > > On Fri, Apr 02, 2021 at 08:12:14PM -0400, Yoshihiro Ota wrote: > >Hi, > > > >We do not seem to have a nice way to see current swap space usage per > >process. > >I updated systat to use libprocstat to obtain such infomation and display > >along with swap devise/file stats. > > Unfotunately your patch gets rejected on recent stable/13 and main/14 > > -- > J. diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile index ca3f7ed72ce..bfbe1336d29 100644 --- a/usr.bin/systat/Makefile +++ b/usr.bin/systat/Makefile @@ -5,7 +5,7 @@ PROG= systat SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ - netcmds.c netstat.c pigs.c swap.c icmp.c \ + netcmds.c netstat.c pigs.c proc.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c @@ -16,6 +16,6 @@ CFLAGS+= -DINET6 WARNS?= 1 -LIBADD= ncursesw m devstat kvm util +LIBADD= ncursesw m devstat kvm util procstat .include diff --git a/usr.bin/systat/devs.c b/usr.bin/systat/devs.c index b293796c2c7..87d04f989ea 100644 --- a/usr.bin/systat/devs.c +++ b/usr.bin/systat/devs.c @@ -426,12 +426,6 @@ dsshow2(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct s putlongdouble(device_busy, diskrow + 4, lc, 5, 0, 0); } -static void -dsshow3(int diskcol, int diskrow, int dn, int lc, struct statinfo *now, struct statinfo *then) -{ - dsshow2(diskcol, diskrow, dn, lc, now, then); -} - void dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct statinfo *then) { @@ -439,5 +433,5 @@ dsshow(int maxdrives, int diskcol, int diskrow, struct statinfo *now, struct sta for (i = 0, lc = 0; i < num_devices && lc < maxdrives; i++) if (dev_select[i].selected) - dsshow3(diskcol, diskrow, i, ++lc, now, then); + dsshow2(diskcol, diskrow, i, ++lc, now, then); } diff --git a/usr.bin/systat/devs.h b/usr.bin/systat/devs.h index cbedd844290..79a44a6c3f5 100644 --- a/usr.bin/systat/devs.h +++ b/usr.bin/systat/devs.h @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1998 David E. O'Brien - * 2015 Yoshihiro Ota + * 2015, 2021 Yoshihiro Ota * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,6 +34,8 @@ #include +#define DISKHIGHT 5 + int dsinit(int); void dsgetinfo(struct statinfo *); int dscmd(const char *, const char *, int, struct statinfo *); diff --git a/usr.bin/systat/extern.h b/usr.bin/systat/extern.h index 6e3117bece4..322065f7931 100644 --- a/usr.bin/systat/extern.h +++ b/usr.bin/systat/extern.h @@ -168,6 +168,7 @@ char *sysctl_dynread(const char *, size_t *); void sysputpage(WINDOW* , int, int, int, uint64_t, int); void sysputspaces(WINDOW* , int, int, int); void sysputstrs(WINDOW* , int, int, int); +void sysputXs(WINDOW* , int, int, int); void sysputuint64(WINDOW* , int, int, int, uint64_t, int); void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index b5a19d381ad..b84351379f4 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -135,6 +135,21 @@ parse_cmd_args (int argc, char **argv) } +static void +resize(int signo __unused) +{ + + endwin(); + refresh(); + clear(); + + CMDLINE = LINES - 1; + labels(); + display(); + status(); +} + + int main(int argc, char **argv) { @@ -191,6 +206,7 @@ main(int argc, char **argv) signal(SIGINT, die); signal(SIGQUIT, die); signal(SIGTERM, die); + signal(SIGWINCH, resize); /* * Initialize display. Load average appears in a one line diff --git a/usr.bin/systat/pigs.c b/usr.bin/systat/pigs.c index d9f3f8d4ad1..879f6548d86 100644 --- a/usr.bin/systat/pigs.c +++ b/usr.bin/systat/pigs.c @@ -56,13 +56,13 @@ __FBSDID("$FreeBSD$"); #include "systat.h" #include "extern.h" -int compar(const void *, const void *); +static int compar(const void *, const void *); static int nproc; static struct p_times { float pt_pctcpu; struct kinfo_proc *pt_kp; -} *pt; +} *pt = NULL; static intfscale; static double lccpu; @@ -90,7 +90,7 @@ showpigs(void) const char *uname, *pname; char pidname[30]; - if (pt == NULL) + if (nproc == 0) return; qsort(pt, nproc, sizeof (struct p_times), compar); @@ -146,23 +146,20 @@ fetchpigs(void) float ftime; float *pctp; struct kinfo_proc *kpp; - static int lastnproc = 0; + static int maxnproc = 0; if ((kpp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nproc)) == NULL) { error("%s", kvm_geterr(kd)); - if (pt) - free(pt); + nproc = 0; return; }