代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/gazelle 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a037f2d9d92ea4a5e659297c5c9839557040f1ce Mon Sep 17 00:00:00 2001
From: zhengjiebing <zhengjiebing_yewu@cmss.chinamobile.com>
Date: Fri, 21 Jun 2024 16:48:20 +0800
Subject: [PATCH] perftool: add latency tool
---
tools/perf/latency.bt | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100755 tools/perf/latency.bt
diff --git a/tools/perf/latency.bt b/tools/perf/latency.bt
new file mode 100755
index 0000000..bfe18ae
--- /dev/null
+++ b/tools/perf/latency.bt
@@ -0,0 +1,38 @@
+#!/usr/bin/env bpftrace
+/*
+reference: https://github.com/bpftrace/bpftrace/blob/master/man/adoc/bpftrace.adoc
+prepare: yum install bpftrace
+example: ./latency.bt xxx.so func1 func2
+supported functions: bpftrace -l 'uprobe:xxx.so'
+*/
+
+BEGIN
+{
+}
+
+uprobe:$1:$2
+{
+ @t_start[tid] = nsecs;
+}
+
+uretprobe:$1:$3
+/@t_start[tid]/
+{
+ $t_dur = nsecs - @t_start[tid];
+ @t_avg = avg($t_dur);
+
+ //@t_hist = lhist($t_dur, 0, 4000, 100);
+ @t_hist = hist($t_dur);
+
+ delete(@t_start[tid]);
+}
+
+END
+{
+ printf("\n\n%s -> %s \n", str($2), str($3));
+ printf("average time(nsec):");
+ print(@t_avg);
+
+ clear(@t_avg);
+ clear(@t_start);
+}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。