Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libbpf-tools: Fix llx printf modifiers in futexctn #4836

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Commits on Oct 12, 2023

  1. libbpf-tools: Fix misaligned pointer accesses in exitsnoop

    The perf buffer in exit snoop doesn't maintain 8 byte alignment for
    start_time and exit_time in struct event. When building with
    "-fsanitize=alignment -fsanitize-undefined-trap-on-error" failures
    happen in handle_event. Fix these by copying the event from the perf
    buffer before accessing.
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    19305b3 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2023

  1. Configuration menu
    Copy the full SHA
    f4d4975 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2023

  1. libbpf-tools: Fix misaligned pointer accesses in biosnoop

    The perf buffer in biosnoop doesn't maintain 8 byte alignment for
    delta, qdelta, ts and sector in struct event. When building with
    "-fsanitize=alignment -fsanitize-trap=undefined" failures happen in
    handle_event. Fix these by copying the event from the perf buffer
    before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    5cf8f55 View commit details
    Browse the repository at this point in the history
  2. libbpf-tools: Fix misaligned pointer accesses in filelife

    The perf buffer in filelife doesn't maintain 8 byte alignment for
    delta_ns in struct event. When building with "-fsanitize=alignment
    -fsanitize-trap=undefined" failures happen in handle_event. Fix these
    by copying the event from the perf buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    8a686cf View commit details
    Browse the repository at this point in the history
  3. libbpf-tools: Fix misaligned pointer accesses in fsslower

    The perf buffer in fsslower doesn't maintain 8 byte alignment for
    delta_us, end_ns, offset and size in struct event. When building with
    "-fsanitize=alignment -fsanitize-trap=undefined" failures happen in
    handle_event. Fix these by copying the event from the perf buffer
    before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    0139b0a View commit details
    Browse the repository at this point in the history
  4. libbpf-tools: Fix misaligned pointer accesses in gethostlatency

    The perf buffer in gethostlatency doesn't maintain 8 byte alignment for
    time in struct event. When building with "-fsanitize=alignment
     -fsanitize-trap=undefined" failures happen in
    handle_event. Fix these by copying the event from the perf buffer
    before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    0a6b8bc View commit details
    Browse the repository at this point in the history
  5. libbpf-tools: Fix misaligned pointer accesses in opensnoop

    The perf buffer in opensnoop doesn't maintain 8 byte alignment
    for ts and callers in struct event. When building with "
    -fsanitize=alignment -fsanitize-trap=undefined" failures happen
    in handle_event. Fix these by copying the event from the perf
    buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    93fb8fd View commit details
    Browse the repository at this point in the history
  6. libbpf-tools: Fix misaligned pointer accesses in runqslower

    The perf buffer in runqslower doesn't maintain 8 byte alignment
    for delta_us in struct event. When building with "-fsanitize=alignment
     -fsanitize-trap=undefined" failures happen
    in handle_event. Fix these by copying the event from the perf
    buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    fa2cdb1 View commit details
    Browse the repository at this point in the history
  7. libbpf-tools: Fix misaligned pointer accesses in statsnoop

    The perf buffer in statsnoop doesn't maintain 8 byte alignment
    for ts_ns in struct event. When building with "-fsanitize=alignment
     -fsanitize-trap=undefined" failures happen
    in handle_event. Fix these by copying the event from the perf
    buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    8084eed View commit details
    Browse the repository at this point in the history
  8. libbpf-tools: Fix misaligned pointer accesses in tcpconnect

    The perf buffer in tcpconnect doesn't maintain 8 byte alignment
    for ts_us in struct event. When building with "-fsanitize=alignment
     -fsanitize-trap=undefined" failures happen
    in handle_event. Fix these by copying the event from the perf
    buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    1b01a7c View commit details
    Browse the repository at this point in the history
  9. libbpf-tools: Fix misaligned pointer accesses in tcplife

    The perf buffer in tcplife doesn't maintain 8 byte alignment
    for saddr, daddr, ts_us, span_us, rx_b and tx_b in struct event.
     When building with "-fsanitize=alignment
     -fsanitize-trap=undefined" failures happen in handle_event.
    Fix these by copying the event from the perf buffer before
    accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    6024904 View commit details
    Browse the repository at this point in the history
  10. libbpf-tools: Fix misaligned pointer accesses in tcpstates

    The perf buffer in tcpstates doesn't maintain 8 byte alignment
    for saddr, daddr, skaddr, ts_us and delta_us in struct event.
    When building with "-fsanitize=alignment -fsanitize-trap=undefined"
    failures happen in handle_event. Fix these by copying the event
    from the perf buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    3c4ddc2 View commit details
    Browse the repository at this point in the history
  11. libbpf-tools: Fix misaligned pointer accesses in tcptracer

    The perf buffer in tcptracer doesn't maintain 8 byte alignment
    for saddr_v4, daddr_v4 and ts_us in struct event.
    When building with "-fsanitize=alignment -fsanitize-trap=undefined"
    failures happen in handle_event. Fix these by copying the event
    from the perf buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    f50a604 View commit details
    Browse the repository at this point in the history
  12. libbpf-tools: Fix misaligned pointer accesses in drsnoop

    The perf buffer in drsnoop doesn't maintain 8 byte alignment
    for delta_ns, nr_reclaimed and nr_free_pages in struct event.
    When building with "-fsanitize=alignment -fsanitize-trap=undefined"
    failures happen in handle_event. Fix these by copying the event
    from the perf buffer before accessing.
    
    This is similar to a fix in exitsnoop where different ways to handle
    misaligned pointers were discussed:
    iovisor#4760
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 5, 2023
    Configuration menu
    Copy the full SHA
    53f0193 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2023

  1. Configuration menu
    Copy the full SHA
    1435c04 View commit details
    Browse the repository at this point in the history
  2. libbpf-tools: Fix printf modifier

    Fix the following warning:
    ```
    $ make futexctn
    ...
    futexctn.c: In function ‘print_stack’:
    futexctn.c:236:59: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
      236 |                                 printf("    #%-2d 0x%016llx [unknown]\n", idx++, ip[i]);
          |                                                     ~~~~~~^                      ~~~~~
          |                                                           |                        |
          |                                                           long long unsigned int   uint64_t {aka long unsigned int}
          |                                                     %016lx
    futexctn.c:249:51: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
      249 |                         printf("    #%-2d 0x%016llx", idx++, ip[i]);
          |                                             ~~~~~~^          ~~~~~
          |                                                   |            |
          |                                                   |            uint64_t {aka long unsigned int}
          |                                                   long long unsigned int
          |                                             %016lx
    ...
    ```
    by using inttypes.h.
    
    Signed-off-by: Ian Rogers <[email protected]>
    captain5050 committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    1daa2c1 View commit details
    Browse the repository at this point in the history