2 Star 0 Fork 32

我们17走/gazelle

forked from src-openEuler/gazelle 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0157-perftool-add-lhist-statstic-tool.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
From 34c2f6cc1e1059ffe3e5edd7cebeb758e4ba9f36 Mon Sep 17 00:00:00 2001
From: wuchangye <wuchangye@huawei.com>
Date: Sun, 24 Mar 2024 00:10:08 +0800
Subject: [PATCH] perftool: add lhist statstic tool
---
tools/perf/glhist.bt | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 tools/perf/glhist.bt
diff --git a/tools/perf/glhist.bt b/tools/perf/glhist.bt
new file mode 100644
index 0000000..757f6e9
--- /dev/null
+++ b/tools/perf/glhist.bt
@@ -0,0 +1,21 @@
+#!/usr/bin/env bpftrace
+/*
+reference: https://github.com/bpftrace/bpftrace/blob/master/man/adoc/bpftrace.adoc
+prepare: yum install bpftrace
+example: ./glhist.bt rpc_poll_msg
+*/
+
+uprobe:/usr/lib64/liblstack.so:$1
+{
+ @t_start[tid] = nsecs;
+}
+
+uretprobe:/usr/lib64/liblstack.so:$1
+{
+ @t_dur[tid] = nsecs - @t_start[tid];
+ @t_count[tid] = count();
+ if (@t_dur[tid] < 1000000000) {
+ // lhist(int64 n, int64 min, int64 max, int64 step)
+ @t_hist[tid] = lhist(@t_dur[tid], 0, 4000, 100);
+ }
+}
\ No newline at end of file
--
2.33.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/together17/gazelle.git
git@gitee.com:together17/gazelle.git
together17
gazelle
gazelle
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385