OpenBSD CVS

CVS log for src/usr.sbin/btrace/btrace.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.15 / (download) - annotate - [select for diffs], Tue May 21 05:00:48 2024 UTC (11 days, 17 hours ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

remove prototypes with no matching function and externs with no var
partly checked by millert@

Revision 1.14 / (download) - annotate - [select for diffs], Tue Feb 27 12:50:33 2024 UTC (3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Printing large tuples require more than 64 chars, bump the string limit.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Sep 11 19:01:26 2023 UTC (8 months, 2 weeks ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.12: +5 -4 lines
Diff to previous 1.12 (colored)

Implement tuples, needed to export per-CPU scheduling data.

It is now possible to save and print immutable arrays as below:

..$t = (1, 42, "something");
..printf("%d %s\n", $t.1, $t.2);

Also add support for evaluating builtin in order to save them in variables
(required by tuples)

Revision 1.12 / (download) - annotate - [select for diffs], Fri May 12 14:14:16 2023 UTC (12 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.11: +9 -5 lines
Diff to previous 1.11 (colored)

btrace(8) support to symbolize utrace addresses.

This only works for a single static binary where everything was compiled
with -fno-omit-frame-pointer since the stack unwinder requires the
frame-pointer.

A possible btrace script to capture performace of a single process is:
profile:hz:100 / pid == $1 / {
        @[ustack] = count();
}
Then using btrace -p program uprofile.bt `pgrep program` will collect
the information for program.

This is far from perfect but should allow other people to play with this
and hopefully improve work.
OK mpi@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Dec 7 22:17:03 2021 UTC (2 years, 5 months ago) by guenther
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.10: +2 -2 lines
Diff to previous 1.10 (colored)

Delete the last emulation callbacks: we're Just ELF, so declare
exec_elf_fixup() and coredump_elf() in <sys/exec_elf.h> and call
them and the MD setregs() directly in kern_exec.c and kern_sig.c

Also delete e_name[] (only used by sysctl), e_errno (unused), and
e_syscallnames[] (only used by SYSCALL_DEBUG) and constipate
syscallnames to 'const char *const[]'

ok kettenis@

Revision 1.10 / (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.9: +2 -1 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Mon Feb 8 09:46:45 2021 UTC (3 years, 3 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored)

Extend binary operators support, required for more filter features.

Improve debugging of filters and print operator names in debug output.

Revision 1.8 / (download) - annotate - [select for diffs], Thu Aug 13 11:29:39 2020 UTC (3 years, 9 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Improve documentation.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Aug 7 14:04:59 2020 UTC (3 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.6: +3 -1 lines
Diff to previous 1.6 (colored)

Do not hardcode the key length.

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: +5 -2 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], Sat Jul 4 10:16:15 2020 UTC (3 years, 10 months ago) by mpi
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

Print the correct register for syscall return value.

While here make it possible to store syscall return values in maps.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Apr 15 16:59:04 2020 UTC (4 years, 1 month ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.3: +8 -7 lines
Diff to previous 1.3 (colored)

Make map functions accept a "struct map *" instead of a "struct bt_var *".

This is a step towards reducing the type casting crazyness.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Jan 28 16:39:51 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored)

Implement map functions min(), max() and sum().

For the moment map values are currently limited to integers.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jan 28 12:13:49 2020 UTC (4 years, 4 months ago) by mpi
Branch: MAIN
Changes since 1.1: +2 -1 lines
Diff to previous 1.1 (colored)

Implement delete() and @map[key] access.

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.