最近 回顾一些 使用 profiling 相关的经历。找到一段多年前的案例(__也是最明显的一次),这里整理一下。
===============================================================================================================
在某一个 software release 之前,QA测试 某个嵌入式网络设备 的 网络转发 throughput,发现,比上一个 software release 下降非常严重:
莫名其妙 下降 30~40 % ?
------------------------------------------------------
自然而然的,使用 设备 上的 oprofile,进行一下 profiling,看能不能找出一些信息线索。 # 也是当时初次使用.....
该设备是使用 CAVIUM mips64 CPU。
先是使用 CPU clock event 进行 profiling。 # (__大致是,CPU 跑多少 cycles,触发一个 performance interrupt,进行 sample )
profiling result 如下:
Counted CLK events (Conditionally clocked cycles (as opposed to count/cvm_count which count even with no clocks)) with a unit mask of 0x00 (No unit mask) count 5000
samples % samples % symbol name
199001 31.1233 113382 15.4567 do_ade # <-- 这里有问题
130285 20.3763 50007 6.8172 AES_CBC_sha1_encrypt # <-- 这里没问题,因为 跑的是 IPsec throughput。
# 是 CPU 软件上进行的 加解密,所以很耗CPU。
35857 5.6080 18117 2.4698 do_dsemulret
16410 2.5665 10036 1.3681 resume_kernel