OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.12 / (download) - annotate - [select for diffs], Wed Sep 8 13:29:51 2021 UTC (2 years, 9 months ago) by dv
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, HEAD
Changes since 1.11: +0 -2 lines
Diff to previous 1.11 (colored)

btrace(8): add initial support for cli arguments

This adds initial support for passing cli args to btrace(8) for use
in bt(5) scripts. Similar to bpftrace, they are referenced via $1,
$2, etc. with $# being the number of command line arguments provided.

Adds an initial regress test and a Makefile change to allow providing
arguments to regress tests in a .args file.

Currently no limit is imposed on the number of arguments, keeping
a similar approach as observed in bpftrace. References to undefined
arguments result in a new "nil" type that contextually acts as a
zero or empty string. More work can be done here to improve bpftrace
compatibility.

ok mpi@, jasper@

Revision 1.11 / (download) - annotate - [select for diffs], Tue Aug 31 08:39:26 2021 UTC (2 years, 9 months ago) by mpi
Branch: MAIN
Changes since 1.10: +0 -1 lines
Diff to previous 1.10 (colored)

Rewrite grammar to implement operator precedence without using %right or %prec.

Arithmetic operator should now behave as expeted and tests can now be written
without superfluous parenthesis, for example:

syscall:select:entry
/($1 == 0) || (pid == $1)/
{
}

Can now be written:

syscall:select:entry
/$1 == 0 || pid == $1/
{
}

While here improve filter debugging support.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Apr 21 10:28:54 2021 UTC (3 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.9: +0 -1 lines
Diff to previous 1.9 (colored)

Support for local (scratch) variables: "$var_name".

Every rule gets its own list of (local) variables.

Revision 1.9 / (download) - annotate - [select for diffs], Wed Apr 21 10:22:36 2021 UTC (3 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.8: +1 -1 lines
Diff to previous 1.8 (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.8 / (download) - annotate - [select for diffs], Sat Jul 11 14:52:14 2020 UTC (3 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.7: +0 -2 lines
Diff to previous 1.7 (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.7 / (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.6: +0 -1 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Thu Apr 23 14:54:12 2020 UTC (4 years, 1 month ago) by mpi
Branch: MAIN
Changes since 1.5: +4 -1 lines
Diff to previous 1.5 (colored)

Extend map to support keys composed of multiple arguments.

Keys are still strings representing the output value.

The following example is now possible to count the number of "on CPU"
events ordered by thread ID and executable name:

# btrace -e 'tracepoint:sched:on__cpu { @[tid, comm] = count() }'
^C
@[138836, idle0]: 830941
@[161307, sshd]: 716476
@[482901, softnet]: 582008
@[104443, systqmp]: 405749
@[269230, update]: 396133
@[326533, softclock]: 316926
@[61040, sshd]: 177201
@[453567, reaper]: 119676
@[446052, ksh]: 85675
@[26270, syslogd]: 66625
@[504699, sshd]: 52958
@[446052, sshd]: 32207
@[44046, tset]: 13333
@[162960, zerothread]: 101
@[313046, ntpd]: 1

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 23 15:42:48 2020 UTC (4 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.4: +5 -2 lines
Diff to previous 1.4 (colored)

Map are printed by default now, document that option "-c" is needed :)

Revision 1.4 / (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.3: +0 -3 lines
Diff to previous 1.3 (colored)

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

For the moment map values are currently limited to integers.

Revision 1.3 / (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.2: +0 -1 lines
Diff to previous 1.2 (colored)

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

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: +0 -1 lines
Diff to previous 1.1 (colored)

Implement builtin time() function.

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

Some remaining items for the curious.

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.