Age | Commit message (Collapse) | Author |
|
It's in the Linux 5 kernel headers. If, like me, you'd never heard of
it:
https://www.phoronix.com/scan.php?page=news_item&px=C-SKY-Approved-Last-Arch
|
|
|
|
|
|
Dear gcc: if (i || node=blah) x = i ? blah : node; Don't complain "node may
be used uninitialied", it can't be. That warning is a gcc bug. (I should add
a node = node to the initialiation to shut up the warning, but gcc has failed
to emit "may be used uninitialized" reliably for 15 years and it still does.)
|
|
|
|
|
|
|
|
|
|
(resulting in 400% CPU with 4 threads), and add a couple comments.
|
|
|
|
More consistent tense, capitalization, and punctuation. A few commands were
missing an introductory line, so I copied those from the first comment
line.
|
|
|
|
Intended to replace Android's toolbox `r`, but behaving more like a
drop-in replacement for busybox's `devmem`.
|
|
Do the FLAG() and short argument variable cleanups while we're there.
|
|
|
|
|
|
We hadn't updated the output in -b mode ever since I broke this in 2016.
Bug: http://b/126347053 "top doesn't seem to update the output when run in batch mode (-b)"
|
|
|
|
|
|
This one actually introduced by my last cleanup. (But helpfully pointed
out by the machines when I tried to upload my last cleanup to the AOSP
gerrit...)
|
|
|
|
|
|
|
|
|
|
mcookie simply prints out 16 bytes of entropy in hexadecimal; it is typically
used as the source for the "MIT magic cookies" that X11 uses for "secure"
connections.
The only implementation I know of is in util-linux; the problems with its
documented behavior motivated me to write an alternate implementation.
Specifically, getting 128 bytes from the kernel and finding the MD5 sum is
not a sane PRNG, especially when only 16 bytes are needed.
|
|
Inspired by some of the small patches that have gone by recently.
Limited to only things found in `generated/help.h`, plus a wider cleanup
for the more common "milisecond" typo.
|
|
|
|
|
|
|
|
Needed to improve cp(1) testing.
|
|
|
|
|
|
|
|
--quiet is used 3x more than --silent in my corpus, but they're both
used surprisingly often. (Surprising to someone who thinks -q is part of
the core set of grep options that "everybody knows".)
|
|
|
|
Linux has more states than we were giving it credit for, which led to
our numbers not adding up. Since the exact details seem to change
between versions, and since having code specific to each kernel version
is unattractive, go with the heuristic that there are relatively fewer
"stopped" states (and they change less frequently), so all unknowns are
"sleeping".
|
|
|
|
|
|
This also makes everything more readable by separating out the -b no
formatting case.
The whitespace trimming for -b isn't strictly necessary, but it looks
weird if we output unnecessary spaces at the end of the line in -b mode,
and we've fixed it before, so let's not regress here. It also seems more
logical to do this in the one place where it actually happens.
|
|
|
|
|
|
|
|
Both refresh the display in the traditional implementation.
|
|
Even phones have enough RAM these days that KiB is not a reasonable
unit. Traditional top always uses MiB instead of always using KiB, but
we may as well just let human_readable pick a unit (that way if KiB is
reasonable on your box, that's what you'll get).
Before:
Tasks: 967 total, 1 running, 581 sleeping, 0 stopped, 0 zombie
Mem: 196734820k total,183891564k used, 12843256k free, 5805008k buffers
Swap:199888892k total, 719104k used,199169788k free,130367280k cached
After:
Tasks: 965 total, 2 running, 577 sleeping, 0 stopped, 0 zombie
Mem: 188G total, 175G used, 13G free, 5.5G buffers
Swap: 191G total, 702M used, 190G free, 124G cached
|
|
Matches traditional top.
|
|
|
|
|
|
|
|
Plus new tests.
|
|
Very few places actually check for errors from emit, and I actually see
the same endless loop from "sed (GNU sed) 4.4" on current Debian, so I'm
not sure this isn't Broken As Designed, but an endless loop spewing
"short write" (or saying nothing, in the case of GNU sed) really doesn't
feel like useful behavior in face of EPIPE, which really isn't going to
fix itself. Certainly not being able to run the sed tests to completion
is pretty annoying --- which is why, unless we remove this test as
invalid, we should probably also add a SKIP_HOST=1 to the "b loop" test.
Note that even with this fix you'll see the error twice:
sed: short write: Broken pipe
sed: short write: Broken pipe
Once from the first = command to fail, and then another from the !FLAG(n)
flush of the pattern space.
|