🔗 如何在 Linux 上使用 oprofile 分析 Squid
设置 oprofile
opcontrol --shutdown
opcontrol --reset
opcontrol --vmlinux=/path/to/vmlinux (or --no-vmlinux if you don't have the kernel vmlinux image)
opcontrol --separate=lib,thread
or maybe (if you want kernel time mixed with the application)
opcontrol --separate=lib,thread,kernel
opcontrol --image=/path/to/sbin/squid
opcontrol --start-daemon
注意:/path/to/sbin/squid 必须是实际的二进制文件。符号链接会导致后续出现“未找到符号”错误。
启动 Squid 并施加您想要分析的工作负载。然后指示 oprofile 收集所需数据
opcontrol --start
[let it run for a while]
opcontrol --stop
以各种方式使用 opreport 来挖掘细节
opreport --symbols
opreport -d
etc... man opreport for details
保存跟踪以供将来分析。保存的目录是自包含的,包含跟踪、二进制文件、库等……并且可以移动到另一台机器进行进一步分析。
oparchive -o /path/to/some/archive/dir
清除 oprofile 会话
opcontrol --reset
类别: 知识库
导航: 站点搜索、站点页面、类别、🔼 向上