aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/Makefile3
-rw-r--r--usr.bin/beep/Makefile2
-rw-r--r--usr.bin/beep/beep.c8
-rw-r--r--usr.bin/gcore/elfcore.c12
-rw-r--r--usr.bin/objcopy/Makefile14
-rw-r--r--usr.bin/procstat/procstat.110
-rw-r--r--usr.bin/procstat/procstat_files.c2
-rw-r--r--usr.bin/top/commands.c26
-rw-r--r--usr.bin/top/top.1187
-rw-r--r--usr.bin/top/top.c2
10 files changed, 142 insertions, 124 deletions
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 15fcdeb479f7..b9e4d6c1153a 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -247,7 +247,6 @@ SUBDIR.${MK_TFTP}+= tftp
SUBDIR.${MK_TOOLCHAIN}+= addr2line
SUBDIR.${MK_TOOLCHAIN}+= ar
SUBDIR.${MK_TOOLCHAIN}+= nm
-SUBDIR.${MK_TOOLCHAIN}+= objcopy
SUBDIR.${MK_TOOLCHAIN}+= readelf
SUBDIR.${MK_TOOLCHAIN}+= size
.endif
@@ -270,6 +269,8 @@ SUBDIR.${MK_TOOLCHAIN}+= indent
SUBDIR.${MK_TOOLCHAIN}+= lex
SUBDIR.${MK_TOOLCHAIN}+= lorder
SUBDIR.${MK_TOOLCHAIN}+= mkstr
+# ELF Tool Chain elfcopy required for EFI objects (PR280771)
+SUBDIR.${MK_TOOLCHAIN}+= objcopy
SUBDIR.${MK_TOOLCHAIN}+= rpcgen
SUBDIR.${MK_TOOLCHAIN}+= unifdef
SUBDIR.${MK_TOOLCHAIN}+= xstr
diff --git a/usr.bin/beep/Makefile b/usr.bin/beep/Makefile
index 8388ff7ff986..1f2548c24819 100644
--- a/usr.bin/beep/Makefile
+++ b/usr.bin/beep/Makefile
@@ -1,5 +1,3 @@
-.include <src.opts.mk>
-
PROG= beep
MAN= beep.1
LIBADD= m
diff --git a/usr.bin/beep/beep.c b/usr.bin/beep/beep.c
index 2696bacfacf4..0bdfe2cf97a7 100644
--- a/usr.bin/beep/beep.c
+++ b/usr.bin/beep/beep.c
@@ -152,7 +152,7 @@ usage(void)
int
main(int argc, char **argv)
{
- int32_t *buffer;
+ float *buffer;
size_t slope;
size_t size;
size_t off;
@@ -208,9 +208,9 @@ main(int argc, char **argv)
if (ioctl(f, SOUND_PCM_WRITE_CHANNELS, &c) != 0)
errx(1, "ioctl SOUND_PCM_WRITE_CHANNELS(1) failed");
- c = AFMT_S32_NE;
+ c = AFMT_FLOAT;
if (ioctl(f, SNDCTL_DSP_SETFMT, &c) != 0)
- errx(1, "ioctl SNDCTL_DSP_SETFMT(AFMT_S32_NE) failed");
+ errx(1, "ioctl SNDCTL_DSP_SETFMT(AFMT_FLOAT) failed");
if (ioctl(f, SNDCTL_DSP_SPEED, &sample_rate) != 0)
errx(1, "ioctl SNDCTL_DSP_SPEED(%d) failed", sample_rate);
@@ -251,7 +251,7 @@ main(int argc, char **argv)
else if (off > (size - slope))
sample = sample * (size - off - 1) / (float)slope;
- buffer[off] = sample * 0x7fffff00;
+ buffer[off] = sample;
}
if (write(f, buffer, size * sizeof(buffer[0])) !=
diff --git a/usr.bin/gcore/elfcore.c b/usr.bin/gcore/elfcore.c
index 2bffd409bb11..86613a91ca73 100644
--- a/usr.bin/gcore/elfcore.c
+++ b/usr.bin/gcore/elfcore.c
@@ -105,6 +105,7 @@ static void *elf_note_powerpc_vsx(void *, size_t *);
static void *elf_note_procstat_auxv(void *, size_t *);
static void *elf_note_procstat_files(void *, size_t *);
static void *elf_note_procstat_groups(void *, size_t *);
+static void *elf_note_procstat_kqueues(void *, size_t *);
static void *elf_note_procstat_osrel(void *, size_t *);
static void *elf_note_procstat_proc(void *, size_t *);
static void *elf_note_procstat_psstrings(void *, size_t *);
@@ -388,6 +389,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, size_t *sizep)
elf_putnote(NT_PROCSTAT_PSSTRINGS, elf_note_procstat_psstrings, &pid,
sb);
elf_putnote(NT_PROCSTAT_AUXV, elf_note_procstat_auxv, &pid, sb);
+ elf_putnote(NT_PROCSTAT_KQUEUES, elf_note_procstat_kqueues, &pid, sb);
#endif
size = sbuf_end_section(sb, old_len, 1, 0);
@@ -756,7 +758,7 @@ procstat_sysctl(void *arg, int what, size_t structsz, size_t *sizep)
{
size_t len;
pid_t pid;
- int name[4], structsize;
+ int name[5], structsize;
void *buf, *p;
pid = *(pid_t *)arg;
@@ -842,6 +844,14 @@ elf_note_procstat_auxv(void *arg, size_t *sizep)
}
static void *
+elf_note_procstat_kqueues(void *arg, size_t *sizep)
+{
+
+ return (procstat_sysctl(arg, KERN_PROC_KQUEUE,
+ sizeof(struct kinfo_knote), sizep));
+}
+
+static void *
elf_note_procstat_rlimit(void *arg, size_t *sizep)
{
pid_t pid;
diff --git a/usr.bin/objcopy/Makefile b/usr.bin/objcopy/Makefile
index 101c84cc5206..2f3386d95ebe 100644
--- a/usr.bin/objcopy/Makefile
+++ b/usr.bin/objcopy/Makefile
@@ -7,12 +7,22 @@ ELFCOPYDIR= ${ELFTCDIR}/elfcopy
.PATH: ${ELFCOPYDIR}
-PROG= objcopy
+PROG= elfcopy
+MAN= elfcopy.1
+
+.if ${MK_LLVM_BINUTILS} == "no"
+
+LINKS+= ${BINDIR}/${PROG} ${BINDIR}/objcopy
+LINKS+= ${BINDIR}/${PROG} ${BINDIR}/strip
+MAN+= objcopy.1 strip.1
+
objcopy.1: elfcopy.1
sed -e 's/\.Dt ELFCOPY 1/.Dt OBJCOPY 1/' \
-e '/\.Nm elfcopy ,/d' < ${.ALLSRC} > ${.TARGET}
CLEANFILES+= objcopy.1
+.endif
+
SRCS= archive.c ascii.c binary.c main.c pe.c sections.c segments.c symbols.c
WARNS?= 5
@@ -22,9 +32,7 @@ LIBADD= archive elftc elf pe
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/libpe -I${ELFTCDIR}/common
CFLAGS+=-DWITH_PE=1
-MAN= ${PROG}.1 strip.1
-LINKS= ${BINDIR}/${PROG} ${BINDIR}/strip
# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One
diff --git a/usr.bin/procstat/procstat.1 b/usr.bin/procstat/procstat.1
index 3466291ba43c..cc775ffe133b 100644
--- a/usr.bin/procstat/procstat.1
+++ b/usr.bin/procstat/procstat.1
@@ -479,13 +479,11 @@ see
.Pp
.Bl -tag -width indent -compact
.It UDD
-.Dv IPPROTO_UDP ;
-see
-.Xr udp 4 .
+Datagram socket.
.It UDS
-.Dv IPPROTO_TCP ;
-see
-.Xr tcp 4 .
+Stream socket.
+.It UDQ
+Sequential Packet Stream socket.
.It UD?
unknown protocol.
.El
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c
index bd9bbfc358c9..d61cf1693053 100644
--- a/usr.bin/procstat/procstat_files.c
+++ b/usr.bin/procstat/procstat_files.c
@@ -75,6 +75,8 @@ protocol_to_string(int domain, int type, int protocol)
return ("UDS");
case SOCK_DGRAM:
return ("UDD");
+ case SOCK_SEQPACKET:
+ return ("UDQ");
default:
return ("UD?");
}
diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c
index e65f4ee6c4c4..3fa63459f2e1 100644
--- a/usr.bin/top/commands.c
+++ b/usr.bin/top/commands.c
@@ -51,35 +51,35 @@ static int str_addarg(char *str, int len, char *arg, bool first);
const struct command all_commands[] =
{
- {'C', "toggle the displaying of weighted CPU percentage", false, CMD_wcputog},
+ {' ', "update the display", false, CMD_update},
+ {'/', "filter on command name (+ selects all commands)", false, CMD_grep},
+ {'a', "toggle the display of process titles", false, CMD_showargs},
+ {'C', "toggle the display of raw or weighted CPU percentage", false, CMD_wcputog},
{'d', "change number of displays to show", false, CMD_displays},
{'e', "list errors generated by last \"kill\" or \"renice\" command", false, CMD_errors},
- {'H', "toggle the displaying of threads", false, CMD_thrtog},
+ {'H', "toggle the display of threads", false, CMD_thrtog},
{'h', "show this help text", true, CMD_help},
{'?', NULL, true, CMD_help},
- {'/', "filter on command name (+ selects all commands)", false, CMD_grep},
- {'i', "toggle the displaying of idle processes", false, CMD_idletog},
+ {'i', "toggle the display of idle processes", false, CMD_idletog},
{'I', NULL, false, CMD_idletog},
- {'j', "toggle the displaying of jail ID", false, CMD_jidtog},
{'J', "display processes for only one jail (+ selects all jails)", false, CMD_jail},
+ {'j', "toggle the display of jail ID", false, CMD_jidtog},
{'k', "kill processes; send a signal to a list of processes", false, CMD_kill},
- {'q', "quit" , true, CMD_quit},
{'m', "toggle the display between 'cpu' and 'io' modes", false, CMD_viewtog},
{'n', "change number of processes to display", false, CMD_number},
{'#', NULL, false, CMD_number},
{'o', "specify the sort order", false, CMD_order},
+ {'P', "toggle the display of per-CPU statistics", false, CMD_pcputog},
{'p', "display one process (+ selects all processes)", false, CMD_pid},
- {'P', "toggle the displaying of per-CPU statistics", false, CMD_pcputog},
+ {'q', "quit" , true, CMD_quit},
{'r', "renice a process", false, CMD_renice},
+ {'S', "toggle the display of system processes", false, CMD_viewsys},
{'s', "change number of seconds to delay between updates", false, CMD_delay},
- {'S', "toggle the displaying of system processes", false, CMD_viewsys},
- {'a', "toggle the displaying of process titles", false, CMD_showargs},
- {'T', "toggle the displaying of thread IDs", false, CMD_toggletid},
+ {'T', "toggle the display of thread IDs", false, CMD_toggletid},
{'t', "toggle the display of this process", false, CMD_selftog},
{'u', "display processes for only one user (+ selects all users)", false, CMD_user},
{'w', "toggle the display of swap use for each process", false, CMD_swaptog},
- {'z', "toggle the displaying of the system idle process", false, CMD_kidletog},
- {' ', "update the display", false, CMD_update},
+ {'z', "toggle the display of the system idle process", false, CMD_kidletog},
{0, NULL, true, CMD_NONE}
};
@@ -108,7 +108,7 @@ show_help(void)
} else if (curcmd->c == ' '){
/* special case space rather than introducing a "display string" to
* the struct */
- sprintf(keys, "SPC");
+ sprintf(keys, "space");
} else {
sprintf(keys, "%c", curcmd->c);
}
diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1
index ca74860aaa35..03f042acc744 100644
--- a/usr.bin/top/top.1
+++ b/usr.bin/top/top.1
@@ -1,4 +1,4 @@
-.Dd November 18, 2021
+.Dd March 25, 2025
.Dt TOP 1
.Os
.Sh NAME
@@ -6,10 +6,10 @@
.Nd display and update information about the top cpu processes
.Sh SYNOPSIS
.Nm
-.Op Fl abCHIijnPpqSTtuvxz
+.Op Fl abCHIijnPqSTtuvwz
.Op Fl d Ar count
.Op Fl J Ar jail
-.Op Fl m Ar mode
+.Op Fl m Ar cpu | io
.Op Fl o Ar field
.Op Fl p Ar pid
.Op Fl s Ar time
@@ -235,7 +235,7 @@ or
.Dq all .
Boolean flags are toggles.
A second specification of any of these options will negate the first.
-.Sh "INTERACTIVE MODE"
+.Sh INTERACTIVE MODE
When
.Nm
is running in
@@ -255,9 +255,8 @@ is between displays; that is, while it is waiting for
seconds to elapse.
If this is the case, the command will be
processed and the display will be updated immediately thereafter
-(reflecting any changes that the command may have specified).
-This
-happens even if the command was incorrect.
+.Pq reflecting any changes that the command may have specified .
+This happens even if the command was incorrect.
If a key is pressed while
.Nm
is in the middle of updating the display, it will finish the update and
@@ -269,65 +268,54 @@ in, the user's erase and kill keys (as set up by the command
.Xr stty 1 )
are recognized, and a newline terminates the input.
.Pp
-These commands are currently recognized (^L refers to control-L):
+The bindings are as follows:
.Bl -tag -width indent
-.It ^L
-Redraw the screen.
-.It h
-Display a summary of the commands (help screen).
-Version information
-is included in this display.
-.It q
-Quit
-.Nm
-.It d
-Change the number of displays to show (prompt for new number).
-Remember that the next display counts as one, so typing 'd1' will make
-.Nm
-show one final display and then immediately exit.
-.It /
-Display only processes that contain the specified string in their
-command name.
-If displaying arguments is enabled, the arguments are searched
-too. '+' shows all processes.
-.It m
-Toggle the display between 'cpu' and 'io' modes.
-.It n or #
-Change the number of processes to display (prompt for new number).
-.It s
-Change the number of seconds to delay between displays
-(prompt for new number).
-.It S
-Toggle the display of system processes.
-.It a
-Toggle the display of process titles.
-.It k
+.It Ic space
+Update the display.
+.It Ic /
+Filter by command name.
+Prompt for
+.Ar string
+or
+.Ql Ic +
+to show all processes.
+.It Ic a
+Toggle display of process titles.
+.It Ic C
+Toggle display of raw or weighted CPU percentage.
+.It Ic d
+Change the number of remaining displays to show before exit.
+Prompt for new number.
+.It Ic e
+Display a list of system errors (if any) generated by the last command.
+.It Ic H
+Toggle display of threads.
+.It Ic h No or Ic \&?
+Display a summary of the commands (help screen) and version information.
+.It Ic i No or Ic I
+Toggle display of idle processes.
+.It Ic J
+Filter processes owned by a specific jail.
+Prompt for jail name or
+.Ql Ic +
+for all processes belonging to all jails and the host.
+This will also enable the display of JID.
+.It Ic j
+Toggle display of
+.Xr jail 8
+ID.
+.It Ic k
Send a signal
.Pq SIGKILL by default
to a list of processes.
This acts similarly to the command
.Xr kill 1 .
-.It r
-Change the priority
-.Pq the Dq nice
-of a list of processes.
-This acts similarly to
-.Xr renice 8 .
-.It u
-Display only processes owned by a specific set of usernames (prompt for
-username).
-If the username specified is simply
-.Dq +
-or
-.Dq - ,
-then processes belonging to all users will be displayed.
-Usernames can be added
-to and removed from the set by prepending them with
-.Dq +
-and
-.Dq - ,
-respectively.
-.It o
+.It Ic m
+Toggle the display between 'cpu' and 'io' modes.
+.It Ic n No or Ic #
+Change the number of processes to display.
+Prompt for new number.
+.It Ic o
Change the order in which the display is sorted.
The sort key names include
.Dq cpu ,
@@ -336,41 +324,54 @@ The sort key names include
and
.Dq time.
The default is cpu.
-.It p
-Display a specific process (prompt for pid).
-If the pid specified is simply
-.Dq + ,
-then show all processes.
-.It e
-Display a list of system errors (if any) generated by the last
-command.
-.It H
-Toggle the display of threads.
-.It i or I
-Toggle the display of idle processes.
-.It j
-Toggle the display of
-.Xr jail 8
-ID.
-.It J
-Display only processes owned by a specific jail (prompt for jail).
-If the jail specified is simply
-.Dq + ,
-then processes belonging
-to all jails and the host will be displayed.
-This will also enable the display of JID.
-.It P
-Toggle the display of per-CPU statistics.
-.It T
-Toggle display of TID and PID
-.It t
-Toggle the display of the
+.It Ic P
+Toggle display of per-CPU statistics.
+.It Ic p
+Filter by exact process ID.
+Prompt for
+.Ar PID
+or
+.Ql Ic +
+to show all processes.
+.It Ic q
+Quit
+.Nm .
+.It Ic r
+Change the priority
+.Pq the Dq nice
+of a list of processes.
+This acts similarly to
+.Xr renice 8 .
+.It Ic S
+Toggle the display of system processes.
+.It Ic s
+Change the number of seconds to delay between displays.
+Prompt for new number.
+.It Ic T
+Toggle display between thread ID and process ID.
+.It Ic t
+Toggle display of the
.Nm
process.
-.It w
-Toggle the display of swap usage.
-.It z
-Toggle the display of the system idle process.
+.It Ic u
+Filter by exact process owner username.
+Prompt for
+.Ar username
+or
+.Ql Ic - Ns
+.No / Ns
+.Ql Ic +
+for all users.
+Usernames can be added
+to and removed from the set by prepending them with
+.Ql +
+and
+.Ql - ,
+respectively.
+.It Ic w
+Toggle display of swap usage.
+.It Ic z
+Toggle display of the system idle process.
.El
.Sh "THE DISPLAY"
The top few lines of the display show general information
diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c
index 8712e56d43ba..856ad838dc1c 100644
--- a/usr.bin/top/top.c
+++ b/usr.bin/top/top.c
@@ -463,7 +463,7 @@ main(int argc, const char *argv[])
default:
errx(1,
-"[-abCHIijnPqStuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n"
+"[-abCHIijnPqSTtuvwz] [-d count] [-J jail] [-m cpu | io] [-o field]\n"
" [-p pid] [-s time] [-U username] [number]");
}
}