New features
The main change in this version is filter condition support which controls filter behaviors based on the value of an argument. You can specify the function and argument with C-style "if" condition.
For example, say you have a program that calculates the fibonacci number. It'll call the 'fib' function multiple times with different . You may want to trace it (and its children) only when the first argument is 2.
$ uftrace -a -F fib@if:arg1==2 fibonacci
# DURATION TID FUNCTION
[ 5446] | fib(2) {
0.169 us [ 5446] | fib(1) = 1;
0.056 us [ 5446] | fib(0) = 1;
1.524 us [ 5446] | } = 2; /* fib */
[ 5446] | fib(2) {
0.056 us [ 5446] | fib(1) = 1;
0.053 us [ 5446] | fib(0) = 1;
0.452 us [ 5446] | } = 2; /* fib */
[ 5446] | fib(2) {
0.079 us [ 5446] | fib(1) = 1;
0.053 us [ 5446] | fib(0) = 1;
0.447 us [ 5446] | } = 2; /* fib */
You can see -F
(function filter) was applied to 'fib' with condition that value of the first argument is equal to 2. Of course, other comparison operators can be used. But the condition only works for function name filters like -F
and -N
, and only handles integer arguments as of now. If the condition is not true, it'll ignore the filter as if it was not there.
The -a
option is used just for illustration and it works even if it doesn't save the arguments.
The next new feature is max/min/avg fields in the graph command. Like in the report command, users can use -f
/--output-fields
option to specify various fields for total and self times. This also works in TUI.
$ uftrace record fibonacci
$ uftrace graph -f total-avg,total-max
# Function Call Graph for 'fibonacci' (session: 9dba9c6c4a0c958f)
========== FUNCTION CALL GRAPH ==========
# TOTAL AVG TOTAL MAX FUNCTION
7.851 us 7.851 us : (1) fibonacci
1.404 us 1.404 us : +-(1) __monstartup
: |
0.889 us 0.889 us : +-(1) __cxa_atexit
: |
5.558 us 5.558 us : +-(1) main
5.134 us 5.134 us : (1) fib
2.301 us 3.396 us : (2) fib
0.953 us 2.197 us : (4) fib
0.346 us 1.457 us : (6) fib
0.162 us 0.199 us : (2) fib
Also it nows support LTO (Link-Time Optimization) build. You can override AR variable during configure
if needed.
$ ./configure CFLAGS=-flto AR=gcc-ar
And there are many bug fixes and improvements!
What's Changed
- symbol: Fix uninitialized 'sec_iter' in the 'arch_load_dynsymtab_noplt' by @kzall0c in #1989
- graph: -f total-avg,self-avg,total-max,total-min,self-max,self-min in tui,cmds by @junyeong0619 in #1999
- test: exclude system_initialize_function in t295 and t296 using filter option by @junyeong0619 in #2001
- record: Add shmem directory to exec permission by @honggyukim in #2000
- misc: Support Rocky Linux 9 in install-deps parts by @junyeong0619 in #2002
- tests: Fix s-thread.c and s-exp-mixed.c tests from clang by @honggyukim in #2005
- New Release v0.18 by @namhyung in #2007
New Contributors
- @junyeong0619 made their first contribution in #1999
Full Changelog: v0.17...v0.18