Question about LTTng Kernel Probe Tracking

Amir Najafi Zadeh via lttng-dev <[email protected]> Sat, 4 Apr 2026 21:02:11 -0400
Newsgroups org.lttng.lists.lttng-dev
Message-ID <CAOQX81c_1OGMybWoc3axCVZGk58q9aefxpNS2XTny2K8cy_65w@mail.gmail.com>
--0000000000003dca8e064eac1a48
Content-Type: text/plain; charset="UTF-8"

Hello all,

I hope you are doing well.

I have a quick question about LTTng tracking when using kernel probes. I
mainly use LTTng to trace file system functions in the Linux kernel, and
for that I use the LTTng kernel probe feature, which works very well.
However, when I tried filtering logs for a specific group ID, I noticed
that filters are not supported for kernel probes.

Then I attempted to use the tracking feature to trace only a specific GID,
but this also did not work. From what I see in my logs, it appears that for
kernel probes all events are captured and recorded, regardless of the
tracking options.

I wanted to know if this is a known limitation, and whether there is any
in-progress work or reason why this is not currently supported.

For reference, here is my code. I am using LTTng 2.13.11 with kernel
6.8.0-101-generic:

```
#!/bin/sh
SESSION_NAME="lttng-gid-test"
OUTPUT_DIR="/tmp/lttng/${SESSION_NAME}"
GROUP_ID=1002

# create the lttng session
lttng create "$SESSION_NAME" -o "$OUTPUT_DIR"

# create the lttng ring buffer channel
lttng enable-channel --session="$SESSION_NAME" --kernel channel0 \
  --subbuf-size=16M \
  --num-subbuf=2

# add pid, tid, proc, and gid for tracing collection
lttng add-context --session="$SESSION_NAME" --channel=channel0
--kernel --type pid
lttng add-context --session="$SESSION_NAME" --channel=channel0
--kernel --type gid

# enable the target probe
lttng enable-event --session="$SESSION_NAME" --channel=channel0
--kernel --probe=ext4_get_inode_loc ext4_get_inode_loc

# disable all tracks
# NOTE: untracking doesn't make a difference
# lttng untrack --session="$SESSION_NAME" --kernel --all --gid
# lttng untrack --session="$SESSION_NAME" --kernel --all --pid
# lttng untrack --session="$SESSION_NAME" --kernel --all --vpid
# lttng untrack --session="$SESSION_NAME" --kernel --all --uid
# lttng untrack --session="$SESSION_NAME" --kernel --all --vuid
# lttng untrack --session="$SESSION_NAME" --kernel --all --vgid

# only enable gid 1002 track
lttng track --kernel --gid=1002

# start lttng
lttng start $SESSION_NAME

```

Thank you for your time and guidance.

Best regards,
Amir
-- 
*Amirhossein Najafizadeh*



*PhD Student, Computer Science Department, Stony Brook University, N.Y.File
systems and Storage Lab (FSL)*
[email protected]
https://amirhnajafiz.github.io/

--0000000000003dca8e064eac1a48
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><p>Hello all,</p>
<p>I hope you are doing well.</p>
<p>I have a quick question about LTTng tracking when using kernel probes. I=
 mainly use LTTng to trace file system functions in the Linux kernel, and f=
or that I use the LTTng kernel probe feature, which works very well. Howeve=
r, when I tried filtering logs for a specific group ID, I noticed that filt=
ers are not supported for kernel probes.</p>
<p>Then I attempted to use the tracking feature to trace only a specific GI=
D, but this also did not work. From what I see in my logs, it appears that =
for kernel probes all events are captured and recorded, regardless of the t=
racking options.</p>
<p>I wanted to know if this is a known limitation, and whether there is any=
 in-progress work or reason why this is not currently supported.</p>
<p>For reference, here is my code. I am using LTTng 2.13.11 with kernel 6.8=
.0-101-generic:</p>
<pre class=3D"gmail-overflow-visible! gmail-px-0!"><div class=3D"gmail-rela=
tive gmail-w-full gmail-mt-4 gmail-mb-1"><div class=3D"gmail-"><div class=
=3D"gmail-relative"><div class=3D"gmail-h-full gmail-min-h-0 gmail-min-w-0"=
><div class=3D"gmail-h-full gmail-min-h-0 gmail-min-w-0"><div class=3D"gmai=
l-border gmail-border-token-border-light gmail-border-radius-3xl gmail-corn=
er-superellipse/1.1 gmail-rounded-3xl"><div class=3D"gmail-h-full gmail-w-f=
ull gmail-border-radius-3xl gmail-bg-token-bg-elevated-secondary gmail-corn=
er-superellipse/1.1 gmail-overflow-clip gmail-rounded-3xl gmail-lxnfua_clip=
PathFallback"><div class=3D"gmail-pointer-events-none gmail-absolute end-1.=
5 gmail-top-1 gmail-z-2 gmail-md:end-2 gmail-md:top-1"></div><div class=3D"=
gmail-w-full gmail-overflow-x-hidden gmail-overflow-y-auto gmail-pe-11 gmai=
l-pt-3"><div class=3D"gmail-relative gmail-z-0 gmail-flex gmail-max-w-full"=
><div id=3D"gmail-code-block-viewer" dir=3D"ltr" class=3D"gmail-q9tKkq_view=
er gmail-cm-editor gmail-z-10 gmail-light:cm-light gmail-dark:cm-light gmai=
l-flex gmail-h-full gmail-w-full gmail-flex-col gmail-items-stretch gmail-=
=CD=BCk gmail-=CD=BCy"><div class=3D"gmail-cm-scroller"><div class=3D"gmail=
-cm-content gmail-q9tKkq_readonly">```
#!/bin/sh<br>SESSION_NAME=3D&quot;lttng-gid-test&quot;<br>OUTPUT_DIR=3D&quo=
t;/tmp/lttng/${SESSION_NAME}&quot;<br>GROUP_ID=3D1002<br><br># create the l=
ttng session<br>lttng create &quot;$SESSION_NAME&quot; -o &quot;$OUTPUT_DIR=
&quot;<br><br># create the lttng ring buffer channel<br>lttng enable-channe=
l --session=3D&quot;$SESSION_NAME&quot; --kernel channel0 \<br>  --subbuf-s=
ize=3D16M \<br>  --num-subbuf=3D2<br><br># add pid, tid, proc, and gid for =
tracing collection<br>lttng add-context --session=3D&quot;$SESSION_NAME&quo=
t; --channel=3Dchannel0 --kernel --type pid<br>lttng add-context --session=
=3D&quot;$SESSION_NAME&quot; --channel=3Dchannel0 --kernel --type gid<br><b=
r># enable the target probe<br>lttng enable-event --session=3D&quot;$SESSIO=
N_NAME&quot; --channel=3Dchannel0 --kernel --probe=3Dext4_get_inode_loc ext=
4_get_inode_loc<br><br># disable all tracks
# NOTE: untracking doesn&#39;t make a difference<br># lttng untrack --sessi=
on=3D&quot;$SESSION_NAME&quot; --kernel --all --gid<br># lttng untrack --se=
ssion=3D&quot;$SESSION_NAME&quot; --kernel --all --pid<br># lttng untrack -=
-session=3D&quot;$SESSION_NAME&quot; --kernel --all --vpid<br># lttng untra=
ck --session=3D&quot;$SESSION_NAME&quot; --kernel --all --uid<br># lttng un=
track --session=3D&quot;$SESSION_NAME&quot; --kernel --all --vuid<br># lttn=
g untrack --session=3D&quot;$SESSION_NAME&quot; --kernel --all --vgid<br><b=
r># only enable gid 1002 track<br>lttng track --kernel --gid=3D1002<br><br>=
# start lttng
lttng start $SESSION_NAME<br></div></div></div></div></div></div></div></di=
v></div><div class=3D"gmail-"><div class=3D"gmail-"></div></div></div></div=
></div></pre>
<p>```<br><br>Thank you for your time and guidance.</p>
<p>Best regards,<br>Amir</p></div><span class=3D"gmail_signature_prefix">--=
 </span><br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gm=
ail_signature"><div dir=3D"ltr"><b><font face=3D"garamond, times new roman,=
 serif">Amirhossein Najafizadeh</font></b><div><font face=3D"garamond, time=
s new roman, serif"><b>PhD Student, Computer Science Department, Stony Broo=
k University, N.Y.<br>File systems and Storage Lab (FSL)<br><br></b></font>=
<div><font face=3D"garamond, times new roman, serif"><a href=3D"mailto:naja=
[email protected]" target=3D"_blank">[email protected]</a></font></=
div><div><a href=3D"https://amirhnajafiz.github.io/" target=3D"_blank"><fon=
t face=3D"garamond, times new roman, serif">https://amirhnajafiz.github.io/=
</font></a></div></div></div></div></div>

--0000000000003dca8e064eac1a48--