OpenBSD CVS

CVS log for src/usr.sbin/btrace/bt.5


[BACK] Up to [local] / src / usr.sbin / btrace

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.17 / (download) - annotate - [select for diffs], Sun Oct 22 19:30:35 2023 UTC (7 months, 1 week ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.16: +7 -2 lines
Diff to previous 1.16 (colored)

bt(5), btrace(8): execute END probe and print non-empty maps upon exit()

BPFTrace's exit() statement executes the END probe (if any) and prints
the contents of all non-empty maps before terminating the interpreter.

Implement this in btrace(8) with a halting check after each statement.
If a statement causes the program to halt, the condition bubbles up to
the top-level evaluation loop and causes rules_teardown() to run
immediately.

btrace(8) still performs a full rules_setup() if exit() is called
during the BEGIN probe, though the top-level evaluation loop is never
run.

One edge-like case: an exit() from the END probe is treated as an
early return; END is not executed multiple times.

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

ok mpi@

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jun 30 13:31:37 2023 UTC (11 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

sepcific -> specific
ok claudio@

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jun 27 14:13:33 2023 UTC (11 months ago) by claudio
Branch: MAIN
Changes since 1.14: +21 -10 lines
Diff to previous 1.14 (colored)

Document the map specific functions (count, max, min, sum) in their own
part of the bt.5 man page.
Input and OK kn@

Revision 1.14 / (download) - annotate - [select for diffs], Thu Mar 31 17:27:29 2022 UTC (2 years, 2 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

man pages: add missing commas between subordinate and main clauses

jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@

Revision 1.13 / (download) - annotate - [select for diffs], Fri Nov 12 16:57:24 2021 UTC (2 years, 6 months ago) by claudio
Branch: MAIN
Changes since 1.12: +4 -2 lines
Diff to previous 1.12 (colored)

Implement the probe variable. Can be used for example with
	@map[probe] = count();
OK mpi@

Revision 1.12 / (download) - annotate - [select for diffs], Sun Oct 3 22:01:48 2021 UTC (2 years, 7 months ago) by dv
Branch: MAIN
Changes since 1.11: +9 -3 lines
Diff to previous 1.11 (colored)

bt(5)/btrace(8): add support for str()

Implement initial support for the str() function, which is used
primarily to truncate or NUL-terminate strings from either cli args
or args to tracepoints and syscalls.

Current implementation only supports cli args and is primarily for
compatability with bpftrace. Future work is needed once dt(4)
supports builtin args other than long values.

Adds a regress test and wires in argument-based tests again.

ok mpi@

Revision 1.11 / (download) - annotate - [select for diffs], Wed Apr 21 10:22:36 2021 UTC (3 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.10: +6 -2 lines
Diff to previous 1.10 (colored)

Support first shell argument as $1 in order to use it in filters.

Remove '-p' option now that scripts can filter by pid/tid.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Dec 7 20:14:35 2020 UTC (3 years, 5 months ago) by anton
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.9: +7 -2 lines
Diff to previous 1.9 (colored)

In revision 1.18 of bt_parse.y, I missed the fact that the print()
function accepts an optional argument representing the number of map
entries to print.

ok bluhm@ mpi@

Revision 1.9 / (download) - annotate - [select for diffs], Fri Sep 18 18:05:20 2020 UTC (3 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.8: +17 -18 lines
Diff to previous 1.8 (colored)

various fixes; ok mpi

Revision 1.8 / (download) - annotate - [select for diffs], Thu Sep 17 19:18:18 2020 UTC (3 years, 8 months ago) by jasper
Branch: MAIN
Changes since 1.7: +8 -2 lines
Diff to previous 1.7 (colored)

document min/max/sum function

ok mpi@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Sep 15 10:59:05 2020 UTC (3 years, 8 months ago) by jasper
Branch: MAIN
Changes since 1.6: +13 -13 lines
Diff to previous 1.6 (colored)

consistently format/word the function documentation

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jul 11 14:52:14 2020 UTC (3 years, 10 months ago) by mpi
Branch: MAIN
Changes since 1.5: +17 -3 lines
Diff to previous 1.5 (colored)

Implement linear and power-of-two histograms: hist() and lhist() keywords.

This is built on top of maps which are currently built on top of RB-trees.
Improvements are welcome!  For example the use of a hashing table as pointed
by espie@.

The following one-liner produce an histogram of power-of-two values returned
by the read(2) syscall:

btrace 'syscall:read:return { @bytes = hist(retval); }'
^C
@bytes:
[0]               19 |@@@@@@@@@@@@@@@@@@@@@@@@@@                          |
[1]               26 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                |
[1, 2)             1 |@                                                   |
[2, 4)            13 |@@@@@@@@@@@@@@@@@@                                  |
[4, 8)             4 |@@@@@                                               |
[8, 16)            3 |@@@@                                                |
[16, 32)           1 |@                                                   |
[32, 64)           8 |@@@@@@@@@@@                                         |
[64, 128)         14 |@@@@@@@@@@@@@@@@@@@                                 |
[128, 256)         7 |@@@@@@@@@                                           |
[256, 512)        37 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[512, 1K)          1 |@                                                   |
[1K, 2K)          10 |@@@@@@@@@@@@@@                                      |
[2K, 4K)          11 |@@@@@@@@@@@@@@@                                     |
[8K, 16K)          1 |@                                                   |

Revision 1.5 / (download) - annotate - [select for diffs], Thu Apr 23 18:36:51 2020 UTC (4 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.4: +18 -14 lines
Diff to previous 1.4 (colored)

Implement builtin 'cpu' keyword.

This is useful to know which CPU recorded a given event.

While here document 'retval' and comment out 'ustack' until we have a
way to capture userland stacks.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Mar 20 12:07:48 2020 UTC (4 years, 2 months ago) by kn
Branch: MAIN
Changes since 1.3: +16 -5 lines
Diff to previous 1.3 (colored)

Document exit, zero and delete functions

While here, reword existing function descriptions a little.
Feedback OK mpi jmc

Revision 1.3 / (download) - annotate - [select for diffs], Wed Mar 18 20:19:42 2020 UTC (4 years, 2 months ago) by kn
Branch: MAIN
Changes since 1.2: +5 -4 lines
Diff to previous 1.2 (colored)

time() takes a strftime(3) format string

OK mpi

Revision 1.2 / (download) - annotate - [select for diffs], Mon Jan 27 14:15:25 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.1: +19 -3 lines
Diff to previous 1.1 (colored)

Implement builtin time() function.

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jan 21 16:24:55 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN

Import a bug tracer, companion of dt(4), that speaks the bt(5) language.

ok kettenis@, visa@, jasper@, deraadt@

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.