OpenBSD CVS

CVS log for src/usr.bin/kstat/kstat.c


[BACK] Up to [local] / src / usr.bin / kstat

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.14 / (download) - annotate - [select for diffs], Tue Mar 26 00:54:24 2024 UTC (7 weeks, 5 days ago) by dlg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.13: +11 -1 lines
Diff to previous 1.13 (colored)

print amps and watts

Revision 1.13 / (download) - annotate - [select for diffs], Thu Nov 16 03:17:34 2023 UTC (6 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.12: +9 -23 lines
Diff to previous 1.12 (colored)

avoid reading data when enumerating kstats.

this means we can reliably read the provider/instance/name/unit
tuple, which should avoid "duplicate kstat entry" when multiple
kstat read handlers have issues.

found on a box with multiple rge interfaces, which have hardware
backed kstats that can only be read when the interface is up.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Nov 16 02:45:54 2023 UTC (6 months ago) by dlg
Branch: MAIN
Changes since 1.11: +48 -1 lines
Diff to previous 1.11 (colored)

handle printing cpu freq and volt kstat_kv types

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jul 10 19:51:37 2022 UTC (22 months, 1 week ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored)

s/0/instance/ in usage to match manual synopsis

OK jmc

Revision 1.10 / (download) - annotate - [select for diffs], Thu May 5 22:36:36 2022 UTC (2 years ago) by cheloha
Branch: MAIN
Changes since 1.9: +30 -8 lines
Diff to previous 1.9 (colored)

kstat(1): implement wait with setitimer(2) instead of nanosleep(2)

kstat(1)'s wait period drifts because nanosleep(2) uses a relative
timeout.  If we use setitimer(2)/sigsuspend(2) the period does not
drift.

While here, bump the upper bound for wait up to UINT_MAX and switch to
the normal strtonum(3) error message format.

With input from kn@.

Tweaked by bluhm@ to block SIGALRM with sigprocmask(2) while we're
outside of sigsuspend(2).

Thread: https://marc.info/?l=openbsd-tech&m=160038548111187&w=2

Earlier version ok millert@.

ok bluhm@

Revision 1.9 / (download) - annotate - [select for diffs], Fri Apr 22 00:29:20 2022 UTC (2 years ago) by dlg
Branch: MAIN
Changes since 1.8: +8 -1 lines
Diff to previous 1.8 (colored)

handle 16 bit kstat_kv types

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jan 25 06:55:59 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored)

fix filtering on kstat unit numbers

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 29 23:26:48 2020 UTC (3 years, 4 months ago) by dlg
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

fflush after outputting a set of stats.

this helps when you're trying to pipe stuff into other programs
(like awk and ttyplot).

Revision 1.6 / (download) - annotate - [select for diffs], Thu Aug 13 12:37:16 2020 UTC (3 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

new kstat(1) manual page, using info from dlg@, from his commit messages,
and from partial code inspection;
OK dlg@

Revision 1.5 / (download) - annotate - [select for diffs], Tue Aug 11 01:07:47 2020 UTC (3 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.4: +46 -3 lines
Diff to previous 1.4 (colored)

add -w so kstat can update and print stats at a specified wait interval.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Aug 10 06:51:40 2020 UTC (3 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.3: +38 -38 lines
Diff to previous 1.3 (colored)

sigh, i made the previous diff to small.

main needs to understand the kstat_tree type now, so move the
declaration up.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Aug 10 06:39:52 2020 UTC (3 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.2: +19 -7 lines
Diff to previous 1.2 (colored)

factor out the printing of kstats. no functional change otherwise.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Aug 10 01:13:28 2020 UTC (3 years, 9 months ago) by dlg
Branch: MAIN
Changes since 1.1: +162 -16 lines
Diff to previous 1.1 (colored)

add the ability to filter which kstats are displayed.

kstats are identified by a "provider:instance:name:unit" tuple,
where provider and name are strings, and instance and unit are
integers. you can pass tuples as arguments to kstat to select them
for display, eg, to see the rxq and txq stats for the first rings
on an em0 interface, you can run `kstat em0:0:rxq:0 em0:0:txq:0`.

this can be pretty tedious if you want to select a group of stats
quickly though, so there's some wildcard and pattern matching support.

firstly, empty fields in the tuple are wildcarded, eg, if you want
to see all the stats that an mcx0 interface provides then run
`kstat mcx0:::`.

secondly, strings in a tuple (ie, the provider and name fields) are
compared using fnmatch(3) so you can use shell like patterns to
match fields. to expand the last example to all mcx interfaces, you
can run `kstat mcx*:::`.

lastly, you can pass a bare name to match on all kstats with that
name. eg, to see the txq stats for all interfaces, just run
`kstat txq`.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jul 6 07:09:50 2020 UTC (3 years, 10 months ago) by dlg
Branch: MAIN

add kstat(8), the userland side of kstat(4).

this currently just dumps all the kstats it can find and prints out
their current values. in the future i want to be able to pass what
kstats im intersted in as arguments, and tell it to poll stats and
show rates instead of current values when appropriate.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.