代码拉取完成,页面将自动刷新
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。