我是靠谱客的博主 复杂冬日,这篇文章主要介绍ubuntu cargo flamegraph运行指定binnary指定采样频率传参传入perf参数例子常见错误的处理参考文献,现在分享给大家,希望可以做个参考。

cargo flamegraph

有如下选项:

运行指定binnary

-b your-binnary

指定采样频率

-F xxx

单位好像是Hz

传参

-- your-arg your-value

传入perf参数

-c "要给perf的参数

比如

cargo flamegraph -c "record -e branch-misses -c 100 --call-graph lbr -g"

例子

cargo flamegraph -F 1 --bin transaction-replayer -- --perf-log data/perf-log.txt
cargo flamegraph -c "recor
d -a -F 1 --call-graph=dwarf" --bin transaction-replayer -- --start-epoch 18000000 --epoch-to-execute 1000000 --commit-interval 10000

注意用了-c时,-F 1要放到-c后面的perf参数里。

常见错误的处理

could not spawn perf
sudo apt install linux-tools-common
WARNING: perf not found for kernel 4.15.0-144

  You may need to install the following packages for this specific kernel:
    linux-tools-4.15.0-144-generic
    linux-cloud-tools-4.15.0-144-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic
failed to sample program

按照提示安装即可:

sudo apt install linux-tools-4.15.0-144-generic linux-cloud-tools-4.15.0-144-generic linux-tools-generic linux-cloud-tools-generic

参考文献

ubuntu18.04安装perf
https://github.com/brendangregg/FlameGraph/issues/209
https://github.com/flamegraph-rs/flamegraph

最后

以上就是复杂冬日最近收集整理的关于ubuntu cargo flamegraph运行指定binnary指定采样频率传参传入perf参数例子常见错误的处理参考文献的全部内容,更多相关ubuntu内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(42)

评论列表共有 0 条评论

立即
投稿
返回
顶部