1 Star 0 Fork 17

gaoch_100/userspace-rcu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test_rwlock-Add-per-thread-count-to-verbose-output.patch 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 11:19 . Package init
From 6c249cd8c0a48370bac8511216c166e98104d699 Mon Sep 17 00:00:00 2001
From: Michael Jeanson <mjeanson@efficios.com>
Date: Fri, 23 Nov 2018 15:27:07 -0500
Subject: [PATCH 04/15] test_rwlock: Add per-thread count to verbose output
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
---
tests/benchmark/test_rwlock.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c
index f95e4e1..827c117 100644
--- a/tests/benchmark/test_rwlock.c
+++ b/tests/benchmark/test_rwlock.c
@@ -202,8 +202,9 @@ void *thr_reader(void *_count)
}
*count = URCU_TLS(nr_reads);
- printf_verbose("thread_end %s, tid %lu\n",
- "reader", urcu_get_thread_id());
+
+ printf_verbose("thread_end %s, tid %lu, count %llu\n",
+ "reader", urcu_get_thread_id(), *count);
return ((void*)1);
}
@@ -248,10 +249,10 @@ void *thr_writer(void *_count)
if (caa_unlikely(wdelay))
loop_sleep(wdelay);
}
-
- printf_verbose("thread_end %s, tid %lu\n",
- "writer", urcu_get_thread_id());
*count = URCU_TLS(nr_writes);
+
+ printf_verbose("thread_end %s, tid %lu, count %llu\n",
+ "writer", urcu_get_thread_id(), *count);
return ((void*)2);
}
@@ -345,6 +346,7 @@ int main(int argc, char **argv)
printf_verbose("running test for %lu seconds, %u readers, %u writers.\n",
duration, nr_readers, nr_writers);
printf_verbose("Writer delay : %lu loops.\n", wdelay);
+ printf_verbose("Writer duration : %lu loops.\n", wduration);
printf_verbose("Reader duration : %lu loops.\n", rduration);
printf_verbose("thread %-6s, tid %lu\n",
"main", urcu_get_thread_id());
--
2.19.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaoch_100/userspace-rcu.git
git@gitee.com:gaoch_100/userspace-rcu.git
gaoch_100
userspace-rcu
userspace-rcu
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385