lttng

c 语言使用lttng

浪尽此生 提交于 2020-08-13 15:46:35
以下内容来自lttng 官方文档,主要是学习记录 创建tracepoint hello-tp.h #undef TRACEPOINT_PROVIDER #define TRACEPOINT_PROVIDER hello_world ​ #undef TRACEPOINT_INCLUDE #define TRACEPOINT_INCLUDE "./hello-tp.h" ​ #if !defined(_HELLO_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ) #define _HELLO_TP_H ​ #include <lttng/tracepoint.h> ​ TRACEPOINT_EVENT( hello_world, my_first_tracepoint, TP_ARGS( int, my_integer_arg, char *, my_string_arg ), TP_FIELDS( ctf_string( my_string_field, my_string_arg) ctf_integer( int, my_integer_field, my_integer_arg) ) ) ​ #endif /* _HELLO_TP_H */ ​ #include <lttng/tracepoint-event.h> hello-tp

lttng简单试用

核能气质少年 提交于 2020-08-11 20:44:30
lttng 是一个很不错内核空间以及用户空间系统分析工具,以下是一些简单的使用以及一些问题 lttng 参考组件 以下这张图来自官方文档: 安装 wget - P / etc / yum. repos. d / https: //packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo rpmkeys -- import https: //packages.efficios.com/rhel/repo.key yum install kmod - lttng - modules lttng - tools babeltrace 试用 创建session lttng create my - kernel - session -- output = /tmp/my - kernel - trace 配置event 规则 lttng enable - event -- kernel -- all 启动 lttng start 执行一些操作 停止处理 lttng destroy 查看 可选的工具很多,我们使用babeltrace babeltrace / tmp / my - kernel - trace | grep _switch 效果 说明 我们是需要安装kmod-lttng-modules 的,不然会提示没有内核模块

Segmentation fault in read Lttng events with Python

不打扰是莪最后的温柔 提交于 2019-12-25 07:59:00
问题 I used Ubunto 16.04, Lttng 2.8.1 and python3.5.2. I also installed python3-babeltrace package. The first step was I recorded some logs exactly based on Lttng documents with lttng create, evenet-enable, start, stop, destroy. In the second step I write a very simple python program to read lttng events, some thing like this: from collections import Counter import babeltrace import sys print("Start") trace_path = sys.argv[1] print("1-Get Path") col = babeltrace.TraceCollection() print("2