namhyung
Repos
32
Followers
266
Following
32

Function graph tracer for C/C++/Rust

C
2350
348

Linux kernel source tree

C
148784
39849

DWARF debug info viewer using GTK+

C
47
8

ELF library dependency viewer

41
11

TUI Disassembler inspired by perf annotate

25
2

Dynamic Tracing in Linux

C
856
78

Events

issue comment
Define client/agent protocol

Using and extending the existing uftrace_msg format looks good. I'm ok with having a new enum for agent options. I also thought about the short options but I think it'd be better to split since we don't support all options for agent and the value might be changed later.

Created at 19 hours ago
issue comment
python tracing result with source location info

Note that functions implemented in C don't have srcline info.

Created at 19 hours ago
issue comment
aarch64/runtest.py: Fix tests where gcc/clang emits memcpy()

Please send a new PR.

Created at 20 hours ago
issue comment
invalid dynsym idx error in t251_exception4 with clang

@ggstone0523 thanks a lot for the detailed analysis!

Created at 20 hours ago
issue comment
enhance the logic to check whether an instrument is available in a function.

Do you mean disasm_check_insns()?

Created at 20 hours ago
issue comment
attaching to a running process.

@ParkHanbum are you talking about #1643? I'm not sure but I don't think it would help avoiding any existing bugs. Doing the work at runtime would make thing more complicated rather than making life easier. :)

Created at 20 hours ago
issue comment
Workaround the AArch64 mcount-gcc first argument passing problem

The original concern of the full dynamic tracing is the coverage of instructions that it can patch (or modify). So it might miss some functions in the outpu that failed to patch. With compiler support like -pg or -fpatchable-function-entry we don't worry about the loss.

So I think we have options on AArch64 like below:

  1. rebuild the binary with -pg: no missing functions, incorrect arg1
  2. rebuild the binary with -finstrument-functions: no missing functions, cannot record any args,return values
  3. rebuild the binary with -fpatchable-function-entry=2: no missing functions, no problems with arg1
  4. no rebuild, full dynamic tracing with -P .: can miss some functions, no problems with arg1
Created at 20 hours ago
issue comment
args: Fix segfaults when reading string arguments

@honggyukim maybe we can close this for now if you don't work on it anymore.

Created at 21 hours ago

aarch64/runtest.py: Fix tests where gcc/clang emits memcpy()

On aarch64 (depending on a number of factors including size and optimisation level) gcc and clang use memcpy() to pass and return big structs to and from function calls.

For large 4k returns, gcc may emit memcpy() for all optimization levels. For smaller structs, gcc and clang may emit memcpy() only for lower optimisation levels. In additon, it may change from one compiler version to the next.

It affects all tests tracing s-arg.c:pass() / return.c:return_large()

Two test cases did already filter memcpy(), but about a dozen other test failures were caused by unexpected memcpy() in the output.

Because emitting memcpy varies by different factors and can change from compiler to compiler, pass -N memcpy to exclude it from all traces.

memcpy() is not not expected in any test output yet, so the change to suppress memcpy is limited to tests/runtest.py.

Created at 1 day ago
pull request closed
aarch64/runtest.py: Fix tests where gcc/clang emits memcpy()

This fixes about a dozen test case failures using the s-arg.c and s-return.c files on aarch64:

On aarch64 (depending on a number of factors including size and optimisation level) gcc and clang use memcpy() to pass and return big structs to and from function calls.

For large 4k returns, gcc may emit memcpy() for all optimization level, while for other smaller structs, gcc and clang may emit memcpy() this only for lower optimisation levels. For smaller structs, gcc and clang may emit memcpy() only for lower optimisation levels. In additon, it may change from one compiler version to the next.

It affects all tests tracing s-arg.c:pass() / return.c:return_large()

Two test cases did already filter memcpy(), but about a dozen other test failures were caused by unexpected memcpy() in the output.

Because emitting memcpy varies by different factors and can change from compiler to compiler, pass -N memcpy to exclude it from all traces.

memcpy() is not not expected in any test output yet, so the change to suppress memcpy is limited to tests/runtest.py.

Created at 1 day ago

README.md: Add links to command-specific documentation

Created at 1 day ago
pull request closed
README.md: Add links to command-specific documentation

A simple way to to make the command-specific markdown files easily accessible is to link them from README.md

Created at 1 day ago

misc: Add more prototypes enums for socket

The following socket() shows some incorrect enum values for now.

int socket(int domain, int type, int protocol);

The incorrect output looks like this.

socket(AF_NETLINK, SOCK_PACKET|SOCK_DCCP|SOCK_SEQPACKET|SOCK_RDM|SOCK_RAW|SOCK_DGRAM|SOCK_STREAM+0x807e4, 15) = 7;

It's because the 'type' field can accept SOCK_CLOEXEC and SOCK_NONBLOCK, but current prototypes.h doesn't have them.

So this patch adds them then the output looks correct as follows.

socket(AF_NETLINK, SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_RAW, 15) = 7;

This can be seen as follows.

$ uftrace -la -C socket lsusb ...

DURATION TID FUNCTION

          [ 18635] | libusb_init() {
          [ 18635] |   udev_monitor_new_from_netlink() {
 5.682 us [ 18635] |     socket(AF_NETLINK, SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_RAW, 15) = 7;
13.064 us [ 18635] |   } /* udev_monitor_new_from_netlink */
 6.142 ms [ 18635] | } /* libusb_init */

Signed-off-by: Honggyu Kim honggyu.kp@gmail.com

Created at 1 day ago
pull request closed
misc: Add more prototypes enums for socket

The following socket() shows some incorrect enum values for now.

  int socket(int domain, int type, int protocol);

The incorrect output looks like this.

  socket(AF_NETLINK, SOCK_PACKET|SOCK_DCCP|SOCK_SEQPACKET|SOCK_RDM|SOCK_RAW|SOCK_DGRAM|SOCK_STREAM+0x807e4, 15) = 7;

It's because the 'type' field can accept SOCK_CLOEXEC and SOCK_NONBLOCK, but current prototypes.h doesn't have them.

So this patch adds them then the output looks correct as follows.

  socket(AF_NETLINK, SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_RAW, 15) = 7;

This can be seen as follows.

  $ uftrace -la -C socket lsusb
      ...
  # DURATION     TID     FUNCTION
              [ 18635] | libusb_init() {
              [ 18635] |   udev_monitor_new_from_netlink() {
     5.682 us [ 18635] |     socket(AF_NETLINK, SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_RAW, 15) = 7;
    13.064 us [ 18635] |   } /* udev_monitor_new_from_netlink */
     6.142 ms [ 18635] | } /* libusb_init */
Created at 1 day ago