ladybird/Userland/Utilities
Tom 7e77a2ec40 Everywhere: Improve CPU usage calculation
As threads come and go, we can't simply account for how many time
slices the threads at any given point may have been using. We need to
also account for threads that have since disappeared. This means we
also need to track how many time slices we have expired globally.

However, because this doesn't account for context switches outside of
the system timer tick values may still be under-reported. To solve this
we will need to track more accurate time information on each context
switch.

This also fixes top's cpu usage calculation which was still based on
the number of context switches.

Fixes #6473
2021-07-18 22:08:26 +02:00
..
adjtime.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
allocate.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
aplay.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
arp.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
avol.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
base64.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
basename.cpp AK+Everywhere: Use mostly StringView in LexicalPath 2021-06-30 11:13:54 +02:00
beep.cpp
bt.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
cal.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
cat.cpp
checksum.cpp
chgrp.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
chmod.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
chown.cpp Userland: Return 1 when help text is shown for insufficient args 2021-06-01 21:30:16 +01:00
chres.cpp chres: Make screen an optional parameter 2021-07-10 18:51:14 +01:00
chroot.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
cksum.cpp
clear.cpp
CMakeLists.txt Utilities: Add an implementation of 'comm' 2021-07-14 14:13:25 +04:30
comm.cpp Utilities: Add an implementation of 'comm' 2021-07-14 14:13:25 +04:30
copy.cpp
cp.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
cpp-parser.cpp
crash.cpp Userland: Prefer using ARCH() over __LP64__ 2021-07-13 23:19:33 +02:00
cut.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
date.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
dd.cpp Utilities: Allow filenames containing '=' in dd (#8766) 2021-07-15 18:36:46 +04:30
ddate.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
df.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
dirname.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
disasm.cpp
disk_benchmark.cpp
dmesg.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
du.cpp du: Don't fail immediately when directory can't be read (#8719) 2021-07-13 17:30:38 +02:00
echo.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
env.cpp Userland: Let env parse options up to first non-option 2021-06-08 11:30:58 +02:00
errno.cpp
expr.cpp LibRegex+Everywhere: Make LibRegex more unicode-aware 2021-07-18 21:10:55 +04:30
false.cpp
fgrep.cpp Userland: Return 1 when help text is shown for insufficient args 2021-06-01 21:30:16 +01:00
file.cpp Userland: Teach the file utility that empty files also exist 2021-06-15 21:30:55 +02:00
find.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
flock.cpp Userland: Return 1 when help text is shown for insufficient args 2021-06-01 21:30:16 +01:00
fortune.cpp AK+Everywhere: Change int to size_t in JsonObject and JsonArray 2021-06-29 13:18:03 +02:00
functrace.cpp Utilities: Fix Build on x86_64 2021-06-30 19:05:51 +02:00
gml-format.cpp
grep.cpp grep: Use Basic POSIX regexps by default and make -E not the default 2021-07-10 13:33:08 +02:00
gron.cpp AK+Everywhere: Change int to size_t in JsonObject and JsonArray 2021-06-29 13:18:03 +02:00
groupadd.cpp Utilities: Add groupadd 2021-07-15 11:16:58 +02:00
groupdel.cpp Utilities: Add groupdel 2021-07-15 11:16:58 +02:00
groups.cpp
gunzip.cpp
gzip.cpp
head.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
hexdump.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
host.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
hostname.cpp hostname: Handle 'sethostname' errors 2021-06-04 19:11:27 +02:00
id.cpp Utilities: Add ability to query specific user with id 2021-07-09 20:15:40 +02:00
ifconfig.cpp ifconfig: Use shorter argument names 2021-06-05 23:51:08 +04:30
ini.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
jp.cpp Userland: Avoid a bunch of JsonObject copies 2021-05-31 17:59:02 +01:00
js.cpp js: Implement pretty-printing of Temporal.Duration objects 2021-07-16 01:07:01 +01:00
keymap.cpp
kill.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
killall.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
less.cpp Utilities: Make less accept 'page up' and 'page down' keys 2021-07-12 16:10:01 +02:00
ln.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
ls.cpp ls: Add option to list subdirectories recursively 2021-07-12 19:15:19 +04:30
lsirq.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
lsof.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
lspci.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
lsusb.cpp Kernel/USB: Move USB bus information from /proc to /sys 2021-07-18 00:55:16 +02:00
man.cpp Userland: Add pager option to man and use less by default 2021-07-07 20:01:15 +04:30
matroska.cpp LibVideo: Migrate to east-const style & apply other minor fixes 2021-06-30 11:03:51 +02:00
md.cpp md: Improve document parsing error message 2021-06-01 21:30:16 +01:00
misbehaving-application.cpp
mkdir.cpp AK+Everywhere: Use mostly StringView in LexicalPath 2021-06-30 11:13:54 +02:00
mkfifo.cpp
mknod.cpp Userland: Return 1 when help text is shown for insufficient args 2021-06-01 21:30:16 +01:00
mktemp.cpp AK: Remove the LexicalPath::is_valid() API 2021-06-30 11:13:54 +02:00
modload.cpp
modunload.cpp
mount.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
mv.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
nc.cpp
netstat.cpp Userland: Avoid a bunch of JsonObject copies 2021-05-31 17:59:02 +01:00
nl.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
notify.cpp
nproc.cpp
ntpquery.cpp ntpquery: Replace printf()/fprintf(stderr) with out{,ln}()/warnln() 2021-05-30 14:07:58 +01:00
open.cpp Utilities: Add support for relative paths in open command 2021-06-02 17:34:27 +04:30
pape.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
passwd.cpp passwd: Do not allow empty passwords 2021-06-17 19:54:38 +02:00
paste.cpp
pathchk.cpp
pgrep.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
pidof.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
ping.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
pls.cpp pls: Fix typo in TERM environment variable propagation 2021-05-30 23:13:52 +02:00
pmap.cpp pmap: Add support for 64-bit addresses 2021-07-18 17:31:13 +02:00
PreprocessorTest.cpp
printf.cpp
pro.cpp AK+Everywhere: Remove StringView::find_{first,last}_of(char) methods 2021-07-02 21:54:21 +02:00
profile.cpp LibCore: Support fine-grained failure behavior for ArgsParser 2021-06-08 11:30:58 +02:00
ps.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
purge.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
pwd.cpp Utilities: Implement pwd 2021-07-09 20:15:40 +02:00
readelf.cpp readelf: Add names for x86_64 relocations and machine type 2021-07-18 17:31:13 +02:00
readlink.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
realpath.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
reboot.cpp
rev.cpp
rm.cpp rm: Allow empty paths if -f is specified 2021-06-05 10:56:58 +02:00
rmdir.cpp
run-tests.cpp Tests: Change test-filtering mechanism 2021-07-14 11:26:34 +04:30
seq.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
shot.cpp Utilities: Use alpha channel instead of opacity in shot 2021-07-10 21:22:25 +04:30
shuf.cpp
shutdown.cpp
sleep.cpp
sort.cpp
sql.cpp Utilities: Teach sql utility to use the SQLClient class 2021-07-08 17:55:59 +04:30
stat.cpp
strace.cpp Kernel: Rename Thread::tss to Thread::regs and add x86_64 support 2021-06-27 15:46:42 +02:00
stty.cpp Userland: Fix incorrect iflag/oflag printing in stty 2021-06-10 23:44:14 +02:00
su.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
sync.cpp
syscall.cpp
sysctl.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
tac.cpp
tail.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
tar.cpp
tee.cpp
telws.cpp
test-bindtodevice.cpp
test-crypto.cpp LibCrypto: Replace from_base{2,8,10,16}() & to_base10 with from_base(N) 2021-06-29 16:55:54 +01:00
test-fuzz.cpp
test-imap.cpp Utilities: Add a simple utility to test the IMAP library 2021-06-11 23:58:28 +04:30
test-pthread.cpp test-pthread: Add a mutex test 2021-07-07 17:08:40 +02:00
test-unveil.cpp
test.cpp LibC+Utilities: Add gnu::format attributes 2021-07-08 10:11:00 +02:00
test_env.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
top.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
touch.cpp
tr.cpp Utilities: Add support for -d flag to tr 2021-07-09 20:15:40 +02:00
traceroute.cpp
tree.cpp AK+Everywhere: Add and use static APIs for LexicalPath 2021-06-30 11:13:54 +02:00
true.cpp
truncate.cpp
tt.cpp LibPthread+Kernel: Add pthread_kill() and the thread_kill syscall 2021-07-09 15:36:50 +02:00
tty.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
umount.cpp
uname.cpp
uniq.cpp
unzip.cpp Utilites: Implement unzip -q 2021-06-13 17:05:48 +01:00
uptime.cpp Userland: Replace most printf-style APIs with AK::Format APIs :^) 2021-06-01 21:30:16 +01:00
useradd.cpp Utilities: Do not allow creating users with existing usernames 2021-06-09 09:00:31 +02:00
userdel.cpp Utilities: Validate user with Core::Account in userdel 2021-06-24 17:33:14 +04:30
usermod.cpp Utilities: Implement usermod command 2021-07-14 08:06:30 +02:00
utmpupdate.cpp
w.cpp Everywhere: Improve CPU usage calculation 2021-07-18 22:08:26 +02:00
wasm.cpp wasm: Don't try to print the function results if it traps 2021-07-17 01:13:39 +04:30
watch.cpp Utilities: Make watch stop parsing options on first non-option 2021-06-08 11:30:58 +02:00
wc.cpp
which.cpp which: Replace printf() with outln()/warnln() 2021-05-30 14:07:58 +01:00
whoami.cpp
wsctl.cpp WindowServer+wsctl: Add a simple utility for toggling "flash flush" 2021-07-07 22:56:46 +02:00
xargs.cpp Everywhere: Prefer using "..."sv over StringView { "..." } 2021-07-04 14:24:03 +02:00
yes.cpp
zip.cpp