• Sasha Goldshtein's avatar
    trace, argdist: -I switch for trace and miscellaneous fixes (#761) · 4725a726
    Sasha Goldshtein authored
    * trace: Additional include files support
    
    Similarly to `argdist`, `trace` now has a `-I` option for adding
    include files that can be used in filter and print expressions.
    This also required a slight modification to `argdist`'s syntax
    for consistency: where previously we would allow `-I header1 header2`,
    we now require `-I header1 -I header2` to avoid any mixups with
    which argument is a header file and which is a probe for `trace`.
    
    This is very unlikely to break anyone, because I haven't seen the
    `-I` option used at all, not to mention extensively with multiple
    headers.
    
    Also made sure the man and example pages are up to date.
    
    * argdist: Update -C and -H switches for consistency
    
    This commit updates `argdist`'s `-H` and `-C` switches for consistency
    with the `-I` switch and `trace`'s switches. Specifically, each probe
    needs an explicit `-C` or `-H` specifier in front of it. This also
    allows safe and understandable mixing of histogram and counting probes,
    for example:
    
    ```
    argdist -C 'p:c:write()' -H 'p::vfs__write(int fd, const void *buf, size_t size):size_t:size#write sizes'
    ```
    
    * trace: Fix stack trace support for tracepoints
    
    Tracepoint probes don't have a `ctx` argument, it's called `args`
    instead. The recently-added stack trace support code didn't take
    this into account, and consequently didn't work for tracepoints.
    This commit fixes the issue, so we can now do things like
    `trace -K t:block:block_rq_complete`.
    4725a726
argdist.8 7.62 KB