* Question about LTTng Context
@ 2025-12-11 2:40 Amir Najafi Zadeh via lttng-dev
2025-12-11 14:30 ` Kienan Stewart via lttng-dev
0 siblings, 1 reply; 6+ messages in thread
From: Amir Najafi Zadeh via lttng-dev @ 2025-12-11 2:40 UTC (permalink / raw)
To: lttng-dev
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
Hello everyone,
I hope you’re doing well. My name is Amir, and I’m a PhD student in the
Computer Science department at Stony Brook University, New York.
I have a question about the LTTng context that I haven’t been able to find
an answer for in the docs or man pages. Does LTTng support adding the
cgroup ID or cgroup path as a context field? I want to filter my trace
results based on cgroups.
If this isn’t supported, are there any plans to add it in future versions,
such as 2.14?
For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04 with kernel
6.8.0-87-generic.
Cheers,
Amir
--
*Amirhossein Najafizadeh*
*PhD Student, Computer Science Department, Stony Brook University, N.Y.File
systems and Storage Lab (FSL)*
najafizadeh21@gmail.com
https://amirhnajafiz.github.io/
[-- Attachment #2: Type: text/html, Size: 1409 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about LTTng Context
2025-12-11 2:40 Question about LTTng Context Amir Najafi Zadeh via lttng-dev
@ 2025-12-11 14:30 ` Kienan Stewart via lttng-dev
2025-12-11 14:57 ` Michael Jeanson via lttng-dev
0 siblings, 1 reply; 6+ messages in thread
From: Kienan Stewart via lttng-dev @ 2025-12-11 14:30 UTC (permalink / raw)
To: Amir Najafi Zadeh, lttng-dev
Hi Amir,
On 12/10/25 9:40 PM, Amir Najafi Zadeh via lttng-dev wrote:
> Hello everyone,
>
> I hope you’re doing well. My name is Amir, and I’m a PhD student in the
> Computer Science department at Stony Brook University, New York.
>
> I have a question about the LTTng context that I haven’t been able to
> find an answer for in the docs or man pages. Does LTTng support adding
> the cgroup ID or cgroup path as a context field? I want to filter my
> trace results based on cgroups.
>
I think you're looking for the `cgroup_ns` context which adds the inum
of the cgroup namespace as a context field.
thanks,
kienan
> If this isn’t supported, are there any plans to add it in future
> versions, such as 2.14?
>
> For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04 with
> kernel 6.8.0-87-generic.
>
> Cheers,
> Amir
> --
> *Amirhossein Najafizadeh*
> *PhD Student, Computer Science Department, Stony Brook University, N.Y.
> File systems and Storage Lab (FSL)
>
> *
> najafizadeh21@gmail.com <mailto:najafizadeh21@gmail.com>
> https://amirhnajafiz.github.io/ <https://amirhnajafiz.github.io/>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about LTTng Context
2025-12-11 14:30 ` Kienan Stewart via lttng-dev
@ 2025-12-11 14:57 ` Michael Jeanson via lttng-dev
2025-12-11 15:51 ` Amir Najafi Zadeh via lttng-dev
0 siblings, 1 reply; 6+ messages in thread
From: Michael Jeanson via lttng-dev @ 2025-12-11 14:57 UTC (permalink / raw)
To: Kienan Stewart, Amir Najafi Zadeh, lttng-dev
On 12/11/25 09:30, Kienan Stewart via lttng-dev wrote:
> Hi Amir,
>
> On 12/10/25 9:40 PM, Amir Najafi Zadeh via lttng-dev wrote:
>> Hello everyone,
>>
>> I hope you’re doing well. My name is Amir, and I’m a PhD student in
>> the Computer Science department at Stony Brook University, New York.
>>
>> I have a question about the LTTng context that I haven’t been able to
>> find an answer for in the docs or man pages. Does LTTng support adding
>> the cgroup ID or cgroup path as a context field? I want to filter my
>> trace results based on cgroups.
>>
>
> I think you're looking for the `cgroup_ns` context which adds the inum
> of the cgroup namespace as a context field.
This will give you the ID of the cgroup namespace but we don't have
contexts for cgroups themselves. It's probably something we would like
to have but there is no concrete plans on implementing this at the moment.
>
>> If this isn’t supported, are there any plans to add it in future
>> versions, such as 2.14?
>>
>> For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04 with
>> kernel 6.8.0-87-generic.
>>
>> Cheers,
>> Amir
>> --
>> *Amirhossein Najafizadeh*
>> *PhD Student, Computer Science Department, Stony Brook University, N.Y.
>> File systems and Storage Lab (FSL)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about LTTng Context
2025-12-11 14:57 ` Michael Jeanson via lttng-dev
@ 2025-12-11 15:51 ` Amir Najafi Zadeh via lttng-dev
2025-12-11 16:14 ` Michael Jeanson via lttng-dev
0 siblings, 1 reply; 6+ messages in thread
From: Amir Najafi Zadeh via lttng-dev @ 2025-12-11 15:51 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev
[-- Attachment #1: Type: text/plain, Size: 2683 bytes --]
Michael, Kienan, Thank you both for your replies. As you mentioned the
cgroup namespace, it isn’t very helpful in some cases. Containers may share
the same cgroup namespace, and the container runtime often avoids giving
each container a private cgroup namespace for performance and security
reasons. Because of this, the cgroup namespace can’t be used as a reliable
or unique label for filtering trace logs.
In my case, with container-d you can inspect a container, find its PID, and
then check /proc/<pid>/ns/cgroup, but you’ll see that different containers
often have the same cgroup namespace ID (e.g., in the following logs you
can see the calico-node and kube-proxy containers sharing a cgroup ns).
```
Name: calico-node CID:
b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace PID: 2243
cgroup_ns_inode: 4026531835
Name: kube-proxy CID:
52f3c12def7a680f61a925ac92dd5ebd5eba6cad17d671efbfd1d40db7dff624 PID: 1851
cgroup_ns_inode: 4026531835
>> MATCH FOUND: shares ns with container:
b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace
(calico-node)
```
Thanks again for your answers. I hope this feature appears in a future
patch.
Best,
Amir
On Thu, Dec 11, 2025 at 9:57 AM Michael Jeanson <mjeanson@efficios.com>
wrote:
> On 12/11/25 09:30, Kienan Stewart via lttng-dev wrote:
> > Hi Amir,
> >
> > On 12/10/25 9:40 PM, Amir Najafi Zadeh via lttng-dev wrote:
> >> Hello everyone,
> >>
> >> I hope you’re doing well. My name is Amir, and I’m a PhD student in
> >> the Computer Science department at Stony Brook University, New York.
> >>
> >> I have a question about the LTTng context that I haven’t been able to
> >> find an answer for in the docs or man pages. Does LTTng support adding
> >> the cgroup ID or cgroup path as a context field? I want to filter my
> >> trace results based on cgroups.
> >>
> >
> > I think you're looking for the `cgroup_ns` context which adds the inum
> > of the cgroup namespace as a context field.
>
> This will give you the ID of the cgroup namespace but we don't have
> contexts for cgroups themselves. It's probably something we would like
> to have but there is no concrete plans on implementing this at the moment.
>
> >
> >> If this isn’t supported, are there any plans to add it in future
> >> versions, such as 2.14?
> >>
> >> For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04 with
> >> kernel 6.8.0-87-generic.
> >>
> >> Cheers,
> >> Amir
> >> --
> >> *Amirhossein Najafizadeh*
> >> *PhD Student, Computer Science Department, Stony Brook University, N.Y.
> >> File systems and Storage Lab (FSL)
>
[-- Attachment #2: Type: text/html, Size: 3258 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about LTTng Context
2025-12-11 15:51 ` Amir Najafi Zadeh via lttng-dev
@ 2025-12-11 16:14 ` Michael Jeanson via lttng-dev
2025-12-11 16:21 ` Amir Najafi Zadeh via lttng-dev
0 siblings, 1 reply; 6+ messages in thread
From: Michael Jeanson via lttng-dev @ 2025-12-11 16:14 UTC (permalink / raw)
To: Amir Najafi Zadeh; +Cc: lttng-dev
On 12/11/25 10:51, Amir Najafi Zadeh wrote:
> Michael, Kienan, Thank you both for your replies. As you mentioned the
> cgroup namespace, it isn’t very helpful in some cases. Containers may
> share the same cgroup namespace, and the container runtime often avoids
> giving each container a private cgroup namespace for performance and
> security reasons. Because of this, the cgroup namespace can’t be used as
> a reliable or unique label for filtering trace logs.
>
> In my case, with container-d you can inspect a container, find its PID,
> and then check /proc/<pid>/ns/cgroup, but you’ll see that different
> containers often have the same cgroup namespace ID (e.g., in the
> following logs you can see the calico-node and kube-proxy containers
> sharing a cgroup ns).
If you want to track containers, the pid namespace is the one used by
most container runtimes but I don't know specifically for container-d.
>
> ```
> Name: calico-node CID:
> b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace PID:
> 2243 cgroup_ns_inode: 4026531835
> Name: kube-proxy CID:
> 52f3c12def7a680f61a925ac92dd5ebd5eba6cad17d671efbfd1d40db7dff624 PID:
> 1851 cgroup_ns_inode: 4026531835
> >> MATCH FOUND: shares ns with container:
> b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace
> (calico-node)
> ```
>
> Thanks again for your answers. I hope this feature appears in a future
> patch.
>
> Best,
> Amir
>
> On Thu, Dec 11, 2025 at 9:57 AM Michael Jeanson <mjeanson@efficios.com
> <mailto:mjeanson@efficios.com>> wrote:
>
> On 12/11/25 09:30, Kienan Stewart via lttng-dev wrote:
> > Hi Amir,
> >
> > On 12/10/25 9:40 PM, Amir Najafi Zadeh via lttng-dev wrote:
> >> Hello everyone,
> >>
> >> I hope you’re doing well. My name is Amir, and I’m a PhD student in
> >> the Computer Science department at Stony Brook University, New York.
> >>
> >> I have a question about the LTTng context that I haven’t been
> able to
> >> find an answer for in the docs or man pages. Does LTTng support
> adding
> >> the cgroup ID or cgroup path as a context field? I want to
> filter my
> >> trace results based on cgroups.
> >>
> >
> > I think you're looking for the `cgroup_ns` context which adds the
> inum
> > of the cgroup namespace as a context field.
>
> This will give you the ID of the cgroup namespace but we don't have
> contexts for cgroups themselves. It's probably something we would like
> to have but there is no concrete plans on implementing this at the
> moment.
>
> >
> >> If this isn’t supported, are there any plans to add it in future
> >> versions, such as 2.14?
> >>
> >> For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04 with
> >> kernel 6.8.0-87-generic.
> >>
> >> Cheers,
> >> Amir
> >> --
> >> *Amirhossein Najafizadeh*
> >> *PhD Student, Computer Science Department, Stony Brook
> University, N.Y.
> >> File systems and Storage Lab (FSL)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Question about LTTng Context
2025-12-11 16:14 ` Michael Jeanson via lttng-dev
@ 2025-12-11 16:21 ` Amir Najafi Zadeh via lttng-dev
0 siblings, 0 replies; 6+ messages in thread
From: Amir Najafi Zadeh via lttng-dev @ 2025-12-11 16:21 UTC (permalink / raw)
To: Michael Jeanson; +Cc: lttng-dev
[-- Attachment #1: Type: text/plain, Size: 3494 bytes --]
I'll try that too. Thanks for mentioning it.
Cheers,
Amir
On Thu, 11 Dec 2025, 11:14 Michael Jeanson, <mjeanson@efficios.com> wrote:
> On 12/11/25 10:51, Amir Najafi Zadeh wrote:
> > Michael, Kienan, Thank you both for your replies. As you mentioned the
> > cgroup namespace, it isn’t very helpful in some cases. Containers may
> > share the same cgroup namespace, and the container runtime often avoids
> > giving each container a private cgroup namespace for performance and
> > security reasons. Because of this, the cgroup namespace can’t be used as
> > a reliable or unique label for filtering trace logs.
> >
> > In my case, with container-d you can inspect a container, find its PID,
> > and then check /proc/<pid>/ns/cgroup, but you’ll see that different
> > containers often have the same cgroup namespace ID (e.g., in the
> > following logs you can see the calico-node and kube-proxy containers
> > sharing a cgroup ns).
>
> If you want to track containers, the pid namespace is the one used by
> most container runtimes but I don't know specifically for container-d.
>
> >
> > ```
> > Name: calico-node CID:
> > b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace PID:
> > 2243 cgroup_ns_inode: 4026531835
> > Name: kube-proxy CID:
> > 52f3c12def7a680f61a925ac92dd5ebd5eba6cad17d671efbfd1d40db7dff624 PID:
> > 1851 cgroup_ns_inode: 4026531835
> > >> MATCH FOUND: shares ns with container:
> > b5624afe31b005725f4ba53c7b6fe758f3c09fabf013085231ff8b97588f6ace
> > (calico-node)
> > ```
> >
> > Thanks again for your answers. I hope this feature appears in a future
> > patch.
> >
> > Best,
> > Amir
> >
> > On Thu, Dec 11, 2025 at 9:57 AM Michael Jeanson <mjeanson@efficios.com
> > <mailto:mjeanson@efficios.com>> wrote:
> >
> > On 12/11/25 09:30, Kienan Stewart via lttng-dev wrote:
> > > Hi Amir,
> > >
> > > On 12/10/25 9:40 PM, Amir Najafi Zadeh via lttng-dev wrote:
> > >> Hello everyone,
> > >>
> > >> I hope you’re doing well. My name is Amir, and I’m a PhD student
> in
> > >> the Computer Science department at Stony Brook University, New
> York.
> > >>
> > >> I have a question about the LTTng context that I haven’t been
> > able to
> > >> find an answer for in the docs or man pages. Does LTTng support
> > adding
> > >> the cgroup ID or cgroup path as a context field? I want to
> > filter my
> > >> trace results based on cgroups.
> > >>
> > >
> > > I think you're looking for the `cgroup_ns` context which adds the
> > inum
> > > of the cgroup namespace as a context field.
> >
> > This will give you the ID of the cgroup namespace but we don't have
> > contexts for cgroups themselves. It's probably something we would
> like
> > to have but there is no concrete plans on implementing this at the
> > moment.
> >
> > >
> > >> If this isn’t supported, are there any plans to add it in future
> > >> versions, such as 2.14?
> > >>
> > >> For reference, I’m currently using LTTng 2.13 on Ubuntu 24.04
> with
> > >> kernel 6.8.0-87-generic.
> > >>
> > >> Cheers,
> > >> Amir
> > >> --
> > >> *Amirhossein Najafizadeh*
> > >> *PhD Student, Computer Science Department, Stony Brook
> > University, N.Y.
> > >> File systems and Storage Lab (FSL)
> >
>
>
[-- Attachment #2: Type: text/html, Size: 4720 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-12-11 16:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-11 2:40 Question about LTTng Context Amir Najafi Zadeh via lttng-dev
2025-12-11 14:30 ` Kienan Stewart via lttng-dev
2025-12-11 14:57 ` Michael Jeanson via lttng-dev
2025-12-11 15:51 ` Amir Najafi Zadeh via lttng-dev
2025-12-11 16:14 ` Michael Jeanson via lttng-dev
2025-12-11 16:21 ` Amir Najafi Zadeh via lttng-dev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox