Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Tony Lu
On Wed, Mar 10, 2021 at 11:31:12AM -0500, Steven Rostedt wrote: > On Wed, 10 Mar 2021 17:03:40 +0800 > Tony Lu wrote: > > > I use pahole to read vmlinux.o directly with defconfig and > > CONFIG_DEBUG_INFO enabled, the result shows 22 structs prefixed with > > trace_event_raw_ that have at least o

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Steven Rostedt
On Wed, 10 Mar 2021 17:03:40 +0800 Tony Lu wrote: > On Tue, Mar 09, 2021 at 12:40:11PM -0500, Steven Rostedt wrote: > > The above shows 10 bytes wasted for this event. > > > > I use pahole to read vmlinux.o directly with defconfig and > CONFIG_DEBUG_INFO enabled, the result shows 22 structs

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Steven Rostedt
On Wed, 10 Mar 2021 17:03:40 +0800 Tony Lu wrote: > I use pahole to read vmlinux.o directly with defconfig and > CONFIG_DEBUG_INFO enabled, the result shows 22 structs prefixed with > trace_event_raw_ that have at least one hole. I was thinking of pahole too ;-) But the information can also be

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Tony Lu
On Wed, Mar 10, 2021 at 09:22:34AM +, Lorenz Bauer wrote: > On Tue, 9 Mar 2021 at 20:12, Eric Dumazet wrote: > > > > On 3/9/21 5:43 AM, Tony Lu wrote: > > > There are lots of net namespaces on the host runs containers like k8s. > > > It is very common to see the same interface names among diff

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Tony Lu
On Tue, Mar 09, 2021 at 09:12:45PM +0100, Eric Dumazet wrote: > > > On 3/9/21 5:43 AM, Tony Lu wrote: > > There are lots of net namespaces on the host runs containers like k8s. > > It is very common to see the same interface names among different net > > namespaces, such as eth0. It is not possib

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Lorenz Bauer
On Tue, 9 Mar 2021 at 20:12, Eric Dumazet wrote: > > On 3/9/21 5:43 AM, Tony Lu wrote: > > There are lots of net namespaces on the host runs containers like k8s. > > It is very common to see the same interface names among different net > > namespaces, such as eth0. It is not possible to distinguis

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-10 Thread Tony Lu
On Tue, Mar 09, 2021 at 12:40:11PM -0500, Steven Rostedt wrote: > On Tue, 9 Mar 2021 12:43:50 +0800 > Tony Lu wrote: > > > There are lots of net namespaces on the host runs containers like k8s. > > It is very common to see the same interface names among different net > > namespaces, such as eth0

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Alexei Starovoitov
On Tue, Mar 9, 2021 at 12:37 PM Steven Rostedt wrote: > > The size of the fields and order changes all the time in various events. I > recommend doing so *all the time*. If you upgrade a kernel, then all the bpf > programs you have for that kernel should also be updated. You can't rely on > fields

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Steven Rostedt
On Tue, 9 Mar 2021 13:17:23 -0700 David Ahern wrote: > On 3/9/21 1:02 PM, Steven Rostedt wrote: > > On Tue, 9 Mar 2021 12:53:37 -0700 > > David Ahern wrote: > > > >> Changing the order of the fields will impact any bpf programs expecting > >> the existing format > > > > I thought bpf progr

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Alexei Starovoitov
On Tue, Mar 9, 2021 at 12:18 PM David Ahern wrote: > > On 3/9/21 1:02 PM, Steven Rostedt wrote: > > On Tue, 9 Mar 2021 12:53:37 -0700 > > David Ahern wrote: > > > >> Changing the order of the fields will impact any bpf programs expecting > >> the existing format > > > > I thought bpf programs wer

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Alexei Starovoitov
On Tue, Mar 9, 2021 at 12:03 PM Steven Rostedt wrote: > > On Tue, 9 Mar 2021 12:53:37 -0700 > David Ahern wrote: > > > Changing the order of the fields will impact any bpf programs expecting > > the existing format > > I thought bpf programs were not API. That is correct.

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread David Ahern
On 3/9/21 1:02 PM, Steven Rostedt wrote: > On Tue, 9 Mar 2021 12:53:37 -0700 > David Ahern wrote: > >> Changing the order of the fields will impact any bpf programs expecting >> the existing format > > I thought bpf programs were not API. And why are they not parsing this > information? They hav

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Eric Dumazet
On 3/9/21 5:43 AM, Tony Lu wrote: > There are lots of net namespaces on the host runs containers like k8s. > It is very common to see the same interface names among different net > namespaces, such as eth0. It is not possible to distinguish them without > net namespace inode. > > This adds net

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Steven Rostedt
On Tue, 9 Mar 2021 12:53:37 -0700 David Ahern wrote: > Changing the order of the fields will impact any bpf programs expecting > the existing format I thought bpf programs were not API. And why are they not parsing this information? They have these offsets hard coded Why would they do that!

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread David Ahern
On 3/9/21 10:40 AM, Steven Rostedt wrote: > The order of the fields is important. Don't worry about breaking API by > fixing it. The parsing code uses this output to find where the binary data > is. Changing the order of the fields will impact any bpf programs expecting the existing format.

Re: [PATCH] net: add net namespace inode for all net_dev events

2021-03-09 Thread Steven Rostedt
On Tue, 9 Mar 2021 12:43:50 +0800 Tony Lu wrote: > There are lots of net namespaces on the host runs containers like k8s. > It is very common to see the same interface names among different net > namespaces, such as eth0. It is not possible to distinguish them without > net namespace inode. > >

[PATCH] net: add net namespace inode for all net_dev events

2021-03-08 Thread Tony Lu
There are lots of net namespaces on the host runs containers like k8s. It is very common to see the same interface names among different net namespaces, such as eth0. It is not possible to distinguish them without net namespace inode. This adds net namespace inode for all net_dev events, help us d