概述

A library call tracer。
是一个仅运行指定命令直到退出的程序。它截获并记录由执行的过程调用的动态库调用以及该过程接收的信号。它还可以拦截并打印程序执行的系统调用。
可用于程序调试或者性能分析。
相似命令见 strace。

参数

  • -o 输出到文件
  • -r 在跟踪的每一行上打印一个相对时间戳。这将记录连续行之间的时间差
  • -t 跟踪的每一行都以一天中的时间为前缀
  • -c 计算时间和每个库调用的调用,并在程序退出时报告摘要
  • -T 显示每一次调用耗时
  • -p 跟踪指定的进程pid
  • -e 指定追踪的库中的函数
  • -x 指定追踪的普通函数。指动态库以为
    1. -e malloc+free-@libc.so*
    ```bash % time seconds usecs/call calls function

43.83 0.002187 2187 1 foo_create 28.46 0.001420 710 2 printf 27.72 0.001383 1383 1 foo_destroy


100.00 0.004990 4 total

  1. 每行=xxxx,"="之后的值为该行的返回值
  2. ```c
  3. readproc(0x18a2480, 0, 0x18d3298, 895) = 0x18d4e10
  4. readproc(0x18a2480, 0, 0x18d32a0, 898) = 0x18d51d0
  5. readproc(0x18a2480, 0, 0x18d32a8, 134) = 0x18d5590
  6. readproc(0x18a2480, 0, 0x18d32b0, 137) = 0x18d5950
  7. readproc(0x18a2480, 0, 0x18d32b8, 790) = 0x18d5d10
  8. readproc(0x18a2480, 0, 0x18d32c0, 1013) = 0x18d60d0

https://blog.csdn.net/uisoul/article/details/83143290

逆向相关
https://www.xuebuyuan.com/3193928.html