<div dir="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 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.</p>
<p>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.</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="gmail-overflow-visible! gmail-px-0!"><div class="gmail-relative gmail-w-full gmail-mt-4 gmail-mb-1"><div class="gmail-"><div class="gmail-relative"><div class="gmail-h-full gmail-min-h-0 gmail-min-w-0"><div class="gmail-h-full gmail-min-h-0 gmail-min-w-0"><div class="gmail-border gmail-border-token-border-light gmail-border-radius-3xl gmail-corner-superellipse/1.1 gmail-rounded-3xl"><div class="gmail-h-full gmail-w-full gmail-border-radius-3xl gmail-bg-token-bg-elevated-secondary gmail-corner-superellipse/1.1 gmail-overflow-clip gmail-rounded-3xl gmail-lxnfua_clipPathFallback"><div class="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="gmail-w-full gmail-overflow-x-hidden gmail-overflow-y-auto gmail-pe-11 gmail-pt-3"><div class="gmail-relative gmail-z-0 gmail-flex gmail-max-w-full"><div id="gmail-code-block-viewer" dir="ltr" class="gmail-q9tKkq_viewer gmail-cm-editor gmail-z-10 gmail-light:cm-light gmail-dark:cm-light gmail-flex gmail-h-full gmail-w-full gmail-flex-col gmail-items-stretch gmail-ͼk gmail-ͼy"><div class="gmail-cm-scroller"><div class="gmail-cm-content gmail-q9tKkq_readonly">```
#!/bin/sh<br>SESSION_NAME="lttng-gid-test"<br>OUTPUT_DIR="/tmp/lttng/${SESSION_NAME}"<br>GROUP_ID=1002<br><br># create the lttng session<br>lttng create "$SESSION_NAME" -o "$OUTPUT_DIR"<br><br># create the lttng ring buffer channel<br>lttng enable-channel --session="$SESSION_NAME" --kernel channel0 \<br>  --subbuf-size=16M \<br>  --num-subbuf=2<br><br># add pid, tid, proc, and gid for tracing collection<br>lttng add-context --session="$SESSION_NAME" --channel=channel0 --kernel --type pid<br>lttng add-context --session="$SESSION_NAME" --channel=channel0 --kernel --type gid<br><br># enable the target probe<br>lttng enable-event --session="$SESSION_NAME" --channel=channel0 --kernel --probe=ext4_get_inode_loc ext4_get_inode_loc<br><br># disable all tracks
# NOTE: untracking doesn't make a difference<br># lttng untrack --session="$SESSION_NAME" --kernel --all --gid<br># lttng untrack --session="$SESSION_NAME" --kernel --all --pid<br># lttng untrack --session="$SESSION_NAME" --kernel --all --vpid<br># lttng untrack --session="$SESSION_NAME" --kernel --all --uid<br># lttng untrack --session="$SESSION_NAME" --kernel --all --vuid<br># lttng untrack --session="$SESSION_NAME" --kernel --all --vgid<br><br># only enable gid 1002 track<br>lttng track --kernel --gid=1002<br><br># start lttng
lttng start $SESSION_NAME<br></div></div></div></div></div></div></div></div></div><div class="gmail-"><div class="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="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b><font face="garamond, times new roman, serif">Amirhossein Najafizadeh</font></b><div><font face="garamond, times new roman, serif"><b>PhD Student, Computer Science Department, Stony Brook University, N.Y.<br>File systems and Storage Lab (FSL)<br><br></b></font><div><font face="garamond, times new roman, serif"><a href="mailto:najafizadeh21@gmail.com" target="_blank">najafizadeh21@gmail.com</a></font></div><div><a href="https://amirhnajafiz.github.io/" target="_blank"><font face="garamond, times new roman, serif">https://amirhnajafiz.github.io/</font></a></div></div></div></div></div>