History log of /openbsd-current/usr.sbin/btrace/bt_parser.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.26 30-Mar-2024 mpi

Implement else branching logic including 'else if'.

Statement lists for if & else conditions are now wrapped in a new
'struct bt_cond'. Handling B_AC_TEST statements moved to stmt_eval()
to handle nested conditional statements.

From Christian Ludwig christian_ludwig at genua.de


Revision tags: OPENBSD_7_5_BASE
# 1.25 12-Oct-2023 cheloha

bt(5), btrace(8): add support for binary modulo operator ('%')

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

ok mpi@


Revision tags: OPENBSD_7_4_BASE
# 1.24 11-Sep-2023 mpi

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 tags: OPENBSD_7_3_BASE
# 1.23 28-Dec-2022 jmc

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.22 12-Nov-2021 claudio

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.25 12-Oct-2023 cheloha

bt(5), btrace(8): add support for binary modulo operator ('%')

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

ok mpi@


Revision tags: OPENBSD_7_4_BASE
# 1.24 11-Sep-2023 mpi

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 tags: OPENBSD_7_3_BASE
# 1.23 28-Dec-2022 jmc

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.22 12-Nov-2021 claudio

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.24 11-Sep-2023 mpi

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 tags: OPENBSD_7_3_BASE
# 1.23 28-Dec-2022 jmc

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.22 12-Nov-2021 claudio

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.23 28-Dec-2022 jmc

spelling fixes; from paul tagliamonte
any parts of his diff not taken are noted on tech


Revision tags: OPENBSD_7_1_BASE OPENBSD_7_2_BASE
# 1.22 12-Nov-2021 claudio

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.22 12-Nov-2021 claudio

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.21 03-Oct-2021 dv

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 tags: OPENBSD_7_0_BASE
# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.20 09-Sep-2021 mpi

Make it possible to associate multiple probes to a single rule.

The following syntax, reducing duplication, is now allowed:

END,
interval:hz:2
{
...
}

Rule descriptors are now linked to a list of probe descriptors instead of
a single one. Enabled kernel probes are now linked to btrace(8) probe
descriptors.

While here stop parsing filter and probe if debug is not enabled.


# 1.19 08-Sep-2021 dv

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@


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.18 31-Aug-2021 mpi

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.


# 1.17 30-Aug-2021 mpi

Implement '<' and '>' operators in filters.

Based on a diff from and ok dv@


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.16 22-Apr-2021 mpi

Remove support for in-kernel filters.

This might be added back in a future if copying events to userland becomes
a performance issue. However note that it is not always possible to filter
in-kernel if, for example. a variable has to be evaluated when a rule fires.


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.15 21-Apr-2021 mpi

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

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


# 1.14 21-Apr-2021 mpi

Extend print() to support any kind of variable.


Revision tags: OPENBSD_6_9_BASE
# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.13 08-Feb-2021 mpi

Extend binary operators support, required for more filter features.

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.12 01-Feb-2021 mpi

Start implementing conditionals for filters.

Allows to check the existence of a variable in predicates, making it
possible to trace syscall latency, as follow:

syscall:select:entry
{
@start[pid] = nsecs;
}

syscall:select:return
/@start[pid]/
{
@usecs = hist((nsecs - @start[pid]) / 1000);
delete(@start[pid]);
}


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.11 27-Jan-2021 deraadt

commons used rather than externs, fix for -fno-common


Revision tags: OPENBSD_6_8_BASE
# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.10 14-Sep-2020 jasper

add support for '&' and '|' operators in btrace scripts

feedback from otto@
ok mpi@ kn@ semarie@


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.9 13-Aug-2020 mpi

Improve documentation.


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.8 11-Jul-2020 mpi

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 tags: OPENBSD_6_7_BASE
# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.7 23-Apr-2020 mpi

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.


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.6 15-Apr-2020 mpi

Document filters: one type of predicates checked in kernel.

By default a PID filter is set by dt(4) to not record events for the tracing
program.

The other type of predicates, which are checked in userland, is coming soon!


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.5 19-Mar-2020 mpi

Add support for unnamed map.

The following is now possible but won't print anything by default:

# btrace -e 'profile:hz:99 { @[kstack] = count() }'

ok patrick@, tobhe@


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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


# 1.4 28-Jan-2020 mpi

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

For the moment map values are currently limited to integers.


# 1.3 28-Jan-2020 mpi

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


# 1.2 27-Jan-2020 mpi

Implement builtin time() function.


# 1.1 21-Jan-2020 mpi

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

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