Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要测量到达以太网端口的单个 UDP 数据包(即生成的中断)与该数据包被传递到用户级别的时间(即 read() 系统调用畅通)之间的延迟。
这个时间可以通过SIOCGSTAMP ioctl(内核级)和clock_gettime(用户级)的时间戳来测量。但是,我有兴趣了解如何通过 ftrace 命令测量这种延迟。
如果您在此处看到 ftrace 输出:
跟踪通过内核的数据包 (linux)
和这个:
linux内核中UDP数据包的路径
仔细,您会注意到时间信息也打印在 ftrace 输出的左侧。通过这种方式,您可以在网络堆栈中的各种功能之间获得非常精细的时序分析。