trace: Add user-space event tracing/injection
2015-09-13 09:50
489 查看
Subject: trace: Add user-space event tracing/injection From: Ingo Molnar <mingo@elte.hu> Date: Wed Nov 17 10:11:53 CET 2010 This feature (suggested by Darren Hart and Pekka Engberg) allows user-space programs to print trace events in a very simple and self-contained way: #include <sys/prctl.h> #include <string.h> #define PR_TASK_PERF_USER_TRACE 35 int main(void) { char *msg = "Hello World!\n"; prctl(PR_TASK_PERF_USER_TRACE, msg, strlen(msg)); return 0; } These show up in 'trace' output as: $ trace report # # trace events of 'sleep 1': # testit/ 6006 ( 0.002 ms): <"Hello World!"> testit/ 6006 ( 0.002 ms): <"Hello World!"> Suggested-by: Darren Hart <dvhart@linux.intel.com> Suggested-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> --- include/linux/prctl.h | 2 ++ include/trace/events/user.h | 32 ++++++++++++++++++++++++++++++++ kernel/sys.c | 23 +++++++++++++++++++++++ kernel/trace/trace_events.c | 34 +++++++++++----------------------- tools/perf/builtin-trace.c | 41 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 109 insertions(+), 23 deletions(-)
lwn.net/Articles/415839/
相关文章推荐
- nginx 与 lua 开发环境搭建
- MySQL安装失败的解决
- 设定溢出属性和可见性属性
- 02关于正则表达式(第二则)常用正则表达式
- k个最大的m段子数组和
- 数据在内存中的存储方式( Big Endian和Little Endian的区别 )(x86系列则采用little endian方式存储数据)
- 01关于正则表达式(第一则)
- nyoj 20 【吝啬的国度】 【DFS】
- 第三十六天 网络连接、单线程、多线程下载
- SVM实践
- list的独有sort
- cookie 和session 的区别详解
- 百度机试:突出重围
- IO流的学习笔记(一)
- window.onload使用指南
- 自己经常使用的一些函数
- 拷贝构造函数的参数为什么必须使用引用类型
- AVL树旋转的一点理解
- 欢迎使用CSDN-markdown编辑器
- 线程之间的通信