The bug of Lttng

在使用lttng进行跟踪点管理和禁用时遇到bug,即无法通过过滤器禁用特定跟踪点,无论是否在会话中启用。详细描述了重现步骤和现象,并提供了在Ubuntu环境下的本地测试结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The description below is the bug of Lttng from customer, and now I try to fix it, continue update this artical daily until fix it and send email to upstream of lttng.org,ok,god praise me,goodluck,let's begin.微笑


Hello,

While testing enabling and disabling tracepoints on XMU03 using lttng we found what seems to be a bug with lttng disable command. If one enables tracepoint using filtering per process, then enables tracepoint without a filter and then tries to disable that tracepoint, the ones enabled with filtering always stay enabled and we haven't found a way to disable them.

If I'm correct lttng currently doesn't support specifically disabling tracepoints using filters but I presume that if I try disabling a tracepoint (for all processes) even those enabled with filter should be disabled. Lttng also lists all tracepoints as disabled although tracing continues. This happens whether the traces are enabled through user application or with lttng shell command.

To reproduce:
first enable tracepoint with filter for process:
lttng enable-event my_provider:my_tracepoint --filter '$ctx.procname == "my-process*"' --session session -u -c channel

then enable tracing for all processes:
lttng enable-event my_provider:my_tracepoint --session session -u -c channel

then try disabling tracepoint:
lttng disable-event --session session --channel channel --userspace my_provider:my_tracepoint

lttng list session gives:
my_provider:my_tracepoint (type: tracepoint) [disabled]
my_provider:my_tracepoint (type: tracepoint) [disabled] [with filter]

and traces for a filtered process will still be logging.

-------------------------------------------------------------------------------------line--------------------------------------------------------------------------------------------------

now I have reproduce it in my local computer,which is ubuntu,the steps below:

PS: the userspace program I used example of lttng.org of document,which you could refer to it


root@pek-cdong-d2:~# lttng create mysession Session mysession created.Traces will be written in /root/lttng-traces/mysession-20150806-111341root@pek-cdong-d2:~# root@pek-cdong-d2:~#

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng enable-event hello_world:my_first_tracepoint --session mysession -u -c channellttng enable-event hello_world:my_first_tracepoint --session mysession -u -c channel UST event hello_world:my_first_tracepoint created in channel channel

root@pek-cdong-d2:~# lttng enable-event hello_world:my_first_tracepoint --filter '$ctx.procname == "./hello*"' --session mysession -u -c channel Event hello_world:my_first_tracepoint: Filter '$ctx.procname == "./hello*"' successfully set

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng disable-event --session mysession --channel channel --userspace hello_world:my_first_tracepoint UST event hello_world:my_first_tracepoint disabled in channel channel for session mysession

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng startTracing started for session mysession

root@pek-cdong-d2:~# lttng stopWaiting for data availability.Tracing stopped for session mysession

root@pek-cdong-d2:~#

root@pek-cdong-d2:~#

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng view

Trace directory: /root/lttng-traces/mysession-20150806-111341

[11:14:06.815998656] (+?.?????????) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 3 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:14:06.816007919] (+0.000009263) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 3 }, { my_string_field = "./hello", my_integer_field = 0 }[11:14:08.816271732] (+2.000263813) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 3 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:14:08.816275148] (+0.000003416) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 3 }, { my_string_field = "./hello", my_integer_field = 0 }

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng disable-event --session mysession --channel channel --userspace hello_world:my_first_tracepoint UST event hello_world:my_first_tracepoint disabled in channel channel for session mysession

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng start

Tracing started for session mysession

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng stop

Waiting for data availability.

Tracing stopped for session mysession

root@pek-cdong-d2:~#

root@pek-cdong-d2:~# lttng view

Trace directory: /root/lttng-traces/mysession-20150806-111431

[11:15:24.400240926] (+?.?????????) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:24.400251675] (+0.000010749) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:26.400352329] (+2.000100654) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:26.400355683] (+0.000003354) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:28.400528270] (+2.000172587) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:28.400531503] (+0.000003233) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:30.400702565] (+2.000171062) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:30.400705720] (+0.000003155) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:32.400819265] (+2.000113545) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:32.400822570] (+0.000003305) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:34.400993852] (+2.000171282) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:34.400997070] (+0.000003218) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }[11:15:36.401169380] (+2.000172310) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "hi there!", my_integer_field = 23 }[11:15:36.401172758] (+0.000003378) pek-cdong-d2 hello_world:my_first_tracepoint: { cpu_id = 2 }, { my_string_field = "./hello", my_integer_field = 0 }root@pek-cdong-d2:~#



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值