History log of /freebsd/usr.bin/top/utils.c (Results 1 – 25 of 40)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/14.0.0
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0, release/13.0.0, release/12.2.0, release/11.4.0
# 738b2d5c 18-Nov-2019 Mark Johnston <markj@FreeBSD.org>

Add a "B" suffix to memory quantities in top(1) output.

Otherwise small quantities look nonsensical. For instance, when
swapping in a single page we would print "4096 In".

Fix code indentation whi

Add a "B" suffix to memory quantities in top(1) output.

Otherwise small quantities look nonsensical. For instance, when
swapping in a single page we would print "4096 In".

Fix code indentation while here.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

show more ...


Revision tags: release/12.1.0, release/11.3.0
# c981cbbd 15-Feb-2019 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r343956 through r344177.


# 2f301637 10-Feb-2019 Dimitry Andric <dim@FreeBSD.org>

Fix multiple warnings in usr.bin/top about variables shadowing global
declarations from base gcc, by renaming those variables.

MFC after: 1 week


# d0f687d3 10-Feb-2019 Dimitry Andric <dim@FreeBSD.org>

Fix multiple warnings in usr.bin/top about discarded qualifiers from
both clang and gcc, by either constifying variables, or when that is not
possible, using __DECONST.

MFC after: 1 week


Revision tags: release/12.0.0
# 14b841d4 11-Aug-2018 Kyle Evans <kevans@FreeBSD.org>

MFH @ r337607, in preparation for boarding


# 10550f0b 25-Jul-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): increase number of columns for memory

The original intention was 4 columns but with a usable a result. In
practice this was not the case. Increase the number of columns to 5
until humanize_n

top(1): increase number of columns for memory

The original intention was 4 columns but with a usable a result. In
practice this was not the case. Increase the number of columns to 5
until humanize_number learns alternative ways of presenting the number.

Requested by: many
Ref D15801

show more ...


# 74521224 10-Jul-2018 Daichi GOTO <daichi@FreeBSD.org>

top(1): rollback r335836

Encoding-specific processing introduced in r335836 is not recommended.
And doing getenv("LANG") and assuming an encoding based on it is a
very bad practice to internationali

top(1): rollback r335836

Encoding-specific processing introduced in r335836 is not recommended.
And doing getenv("LANG") and assuming an encoding based on it is a
very bad practice to internationalize software.

Submitted by: hrs
Differential Revision: https://reviews.freebsd.org/D16203

show more ...


# c6dc704e 03-Jul-2018 Ruslan Bukin <br@FreeBSD.org>

Fix build: utf8strvisx() does signed data comparisons, but 'char' type
is unsigned in riscv GCC, so use guaranted signed char type.

Sponsored by: DARPA, AFRL


# 4417ed2d 01-Jul-2018 Daichi GOTO <daichi@FreeBSD.org>

top(1) - support UTF-8 display

Reviewed by: eadler
Approved by: gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D16006


# 51c834c4 22-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): reimplement header formatting as sbuf

The current header formatting is a giant format string that changes
global state during the format process.

Make the following changes:
- use sbuf to b

top(1): reimplement header formatting as sbuf

The current header formatting is a giant format string that changes
global state during the format process.

Make the following changes:
- use sbuf to build up the header rather than use the above
pseudo-dynamic one
- Change name length to 10
- Reduce size of RES and SIZE by making humanize more aggressive
- Restore a version number line to the copyright. This may be required
by the copyright (and may not be; its unclear)

This is also a pre-req to implementing TOPCOLOR from newer versions of
top(1)

Discussed with: allanjude, rpolka, danfe, rgrimes
Differential Revision: https://reviews.freebsd.org/D15801

show more ...


Revision tags: release/11.2.0
# f7642433 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): remove unneeded logic

- remove __pure annotations I added earlier for some functions. One
writes to the the arguments as "out" pointers. The
other reads from an array, which while const with

top(1): remove unneeded logic

- remove __pure annotations I added earlier for some functions. One
writes to the the arguments as "out" pointers. The
other reads from an array, which while const within the function might
be mutated externally.
- total_change is modified to be at 1, if previously 0, so no if check
is needed.

show more ...


# 1de63842 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): style(9)

- split return type from function name
- Sprinkle a __pure where possible.


# d1862666 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): add myself to authors

At this point I've mucked enough with top(1) that all bugs should be
blamed on me rather than William LeFebvre.


# c655e639 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): shift from atoi to non-deprecated function


# 704daa9b 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): replace homegrown itoa with sprintf

Much of this should be inlined to the callsite, but leave it here for
now to make it easier to make it easier bisect later.


# 8e4b205e 13-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): format_time, format_k, etc.

- Use humanize_number for format_k and format_k2
- Fix some style nits in format_time


# 0ff79d81 12-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): remove trailing whitespace


# ccf22059 12-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): style and related

- style(9)
- remove now-defunct comments
- remove getuid check for low delay
- expand range of format_k


# fb7b896c 11-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): handle 0 in "digits" functions


# 6e0632db 10-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): correctly reset per-cpu counters

I had changed this from a for loop to a memset during an earlier
cleanup. This change was incorrect so revert it.

While here, clean up

Reported by: flo


# d408c8f7 08-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): fix several style & const related issues

- use parens for return
- put function names on newline
- sprinkle const where possible


# a9a99372 04-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): Use strsep instead of homegrown alternative

This replaces some complex, and not quite correct logic, with a more
common strsep pattern.

Reviewed by: mmacy (older version)


# eae589f1 04-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): another pass of cleanup

- avoid the need to call a function to get size of known array. I'll
likely re-arrange some of the indirect in a later to avoid the magic
constants.
- use correct typ

top(1): another pass of cleanup

- avoid the need to call a function to get size of known array. I'll
likely re-arrange some of the indirect in a later to avoid the magic
constants.
- use correct type
- add const
- replace caddr_t with void*. This corrects an alignment warning.
- remove duplicated include from immediately prior commit

Under base clang we're now down to:
- 3 warning in top.c, 1 warning in mahcine.c, 4 warning in display.c,
- 1 warning in utils.c

Tested with base clang, gcc7, gcc9, base gcc (mips)

show more ...


# 9f8096e3 04-Jun-2018 Eitan Adler <eadler@FreeBSD.org>

top(1): top warnings and cleanup

- Add const where helpful
- add missing 'static' for file-local functions
- use nitems where possible
- convert manual abort() to assert
- use strndup instead of hom

top(1): top warnings and cleanup

- Add const where helpful
- add missing 'static' for file-local functions
- use nitems where possible
- convert manual abort() to assert
- use strndup instead of homegrown version

Tested with clang, gcc7, and gcc9

show more ...


12