Age | Commit message (Collapse) | Author |
|
|
|
ok mpi@ kn@
|
|
%ll)
|
|
Improve debugging of filters and print operator names in debug output.
|
|
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]);
}
|
|
|
|
Necessary to measure latency, example below to better understand the kqueue
select(2) regression:
syscall:select:entry { @start[pid] = nsecs; }
syscall:select:return { @usecs = hist((nsecs - @start[pid]) / 1000); }
|
|
probes can be parsed again.
ok anton@ kn@
|
|
causes btrace to reject such programs. An example is exit which is both
a syscall and a builtin btrace function. Pointed out by bluhm@
To resolve the conflict, make use of a lexer backdoor. A concept
described in the original yacc paper and also found in other yacc
parsers in our tree.
ok bluhm@ mpi@
|
|
function accepts an optional argument representing the number of map
entries to print.
ok bluhm@ mpi@
|
|
fails, buffer is unchanged; initialize it with empty string. snprintf
may return negative value or the length that would have been written;
check and calculate remaining size. snprintf writes size - 1
characters; pass buffer size as length.
OK mpi@
|
|
ok mpi@
|
|
|
|
|
|
ok mpi@
|
|
|
|
feedback from otto@
ok mpi@ kn@ semarie@
|
|
|
|
This allows us to use `stackcollapse-bpftrace.pl' from Brendan Gregg's
FrameGraph without pre-processing outputs.
|
|
|
|
|
|
|
|
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 |@ |
|
|
While here make it possible to store syscall return values in maps.
|
|
|
|
OK mpi
|
|
Fix a corner case where old events could be re-evaluated.
From Yuichiro NAITO.
|
|
Also clarify various constructs by using commonly understood names like
'expr' and 'vargs'.
|
|
|
|
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.
|
|
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
|
|
|
|
This is a step towards reducing the type casting crazyness.
|
|
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!
|
|
|
|
There's no need to redefine the INKERNEL() macro in userland because
stacktrace_save_at() only saves kernel stack traces.
If we decide to use the same interface to unwind & save userland stack
traces we can simply indicate that in the "struct stacktrace".
Discussed with deraadt@ and kettenis@
|
|
|
|
|
|
|
|
Fix build on at least sparc64
|
|
|
|
This allows to use oneliners like:
# btrace -e 'profile:hz:99 { @[tid] = count(); }'
ok kn@
|
|
While here, reword existing function descriptions a little.
Feedback OK mpi jmc
|
|
|
|
The following is now possible but won't print anything by default:
# btrace -e 'profile:hz:99 { @[kstack] = count() }'
ok patrick@, tobhe@
|
|
key of a map.
This makes map indexed by stack traces work. For example to know where
the sleeps are coming from:
tracepoint:sched:sleep {
@map[kstack] = count();
}
ok patrick@, tobhe@
|
|
OK mpi
|
|
|
|
From tom@
|
|
For the moment map values are currently limited to integers.
|