2020-08-24 09:31:39

by Al Grant

[permalink] [raw]
Subject: [PATCH] perf: correct SNOOPX field offset

perf_event.h has macros that define the field offsets in the
data_src bitmask in perf records. The SNOOPX and REMOTE offsets
were both 37. These are distinct fields, and the bitfield layout
in perf_mem_data_src confirms that SNOOPX should be at offset 38.

From: Al Grant <[email protected]>

include/uapi/linux/perf_event.h | 2 +-
tools/include/uapi/linux/perf_event.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/perf_event.h
b/include/uapi/linux/perf_event.h
index 077e7ee69e3d..3e5dcdd48a49 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -1196,7 +1196,7 @@ union perf_mem_data_src {

#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
/* 1 free */
-#define PERF_MEM_SNOOPX_SHIFT 37
+#define PERF_MEM_SNOOPX_SHIFT 38

/* locked instruction */
#define PERF_MEM_LOCK_NA 0x01 /* not available */
diff --git a/tools/include/uapi/linux/perf_event.h
b/tools/include/uapi/linux/perf_event.h
index 077e7ee69e3d..3e5dcdd48a49 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -1196,7 +1196,7 @@ union perf_mem_data_src {

#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
/* 1 free */
-#define PERF_MEM_SNOOPX_SHIFT 37
+#define PERF_MEM_SNOOPX_SHIFT 38

/* locked instruction */
#define PERF_MEM_LOCK_NA 0x01 /* not available */


2020-08-25 18:56:37

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
> perf_event.h has macros that define the field offsets in the
> data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> were both 37. These are distinct fields, and the bitfield layout
> in perf_mem_data_src confirms that SNOOPX should be at offset 38.

Looks good.

Reviewed-by: Andi Kleen <[email protected]>

Probably should have a Fixes: header

-Andi

2020-08-26 14:27:56

by Mark Rutland

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

Hi,

[ adding the kernel-side perf maintainers ]

Please note that scripts/get_maintainer.pl can help to find relevant
maintainers.

On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
> perf_event.h has macros that define the field offsets in the
> data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> were both 37. These are distinct fields, and the bitfield layout
> in perf_mem_data_src confirms that SNOOPX should be at offset 38.
>
> From: Al Grant <[email protected]>

This needs a Signed-off-by line from you. See:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin

The patch itself looks right to me, so provided you add an S-o-B line:

Acked-by: Mark Rutland <[email protected]>

Mark

>
> include/uapi/linux/perf_event.h | 2 +-
> tools/include/uapi/linux/perf_event.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/linux/perf_event.h
> b/include/uapi/linux/perf_event.h
> index 077e7ee69e3d..3e5dcdd48a49 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
>
> #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> /* 1 free */
> -#define PERF_MEM_SNOOPX_SHIFT 37
> +#define PERF_MEM_SNOOPX_SHIFT 38
>
> /* locked instruction */
> #define PERF_MEM_LOCK_NA 0x01 /* not available */
> diff --git a/tools/include/uapi/linux/perf_event.h
> b/tools/include/uapi/linux/perf_event.h
> index 077e7ee69e3d..3e5dcdd48a49 100644
> --- a/tools/include/uapi/linux/perf_event.h
> +++ b/tools/include/uapi/linux/perf_event.h
> @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
>
> #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> /* 1 free */
> -#define PERF_MEM_SNOOPX_SHIFT 37
> +#define PERF_MEM_SNOOPX_SHIFT 38
>
> /* locked instruction */
> #define PERF_MEM_LOCK_NA 0x01 /* not available */

2020-08-26 14:36:59

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

Em Tue, Aug 25, 2020 at 10:40:43AM -0700, Andi Kleen escreveu:
> On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
> > perf_event.h has macros that define the field offsets in the
> > data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> > were both 37. These are distinct fields, and the bitfield layout
> > in perf_mem_data_src confirms that SNOOPX should be at offset 38.
>
> Looks good.
>
> Reviewed-by: Andi Kleen <[email protected]>
>
> Probably should have a Fixes: header

Please do so, find the patch that introduced the error, add the Fixes
tag, will help me not having to do it myself :-)

- Arnaldo

2020-08-26 14:39:41

by Al Grant

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

On 26/08/2020 15:26, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 25, 2020 at 10:40:43AM -0700, Andi Kleen escreveu:
>> On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
>>> perf_event.h has macros that define the field offsets in the
>>> data_src bitmask in perf records. The SNOOPX and REMOTE offsets
>>> were both 37. These are distinct fields, and the bitfield layout
>>> in perf_mem_data_src confirms that SNOOPX should be at offset 38.
>>
>> Looks good.
>>
>> Reviewed-by: Andi Kleen <[email protected]>
>>
>> Probably should have a Fixes: header
>
> Please do so, find the patch that introduced the error, add the Fixes
> tag, will help me not having to do it myself :-)

Fixes: 52839e653b562 ("perf tools: Add support for printing new mem_info
encodings")

2020-09-01 15:03:46

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

Em Wed, Aug 26, 2020 at 03:33:35PM +0100, Al Grant escreveu:
> On 26/08/2020 15:26, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Aug 25, 2020 at 10:40:43AM -0700, Andi Kleen escreveu:
> > > On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
> > > > perf_event.h has macros that define the field offsets in the
> > > > data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> > > > were both 37. These are distinct fields, and the bitfield layout
> > > > in perf_mem_data_src confirms that SNOOPX should be at offset 38.
> > >
> > > Looks good.
> > >
> > > Reviewed-by: Andi Kleen <[email protected]>
> > >
> > > Probably should have a Fixes: header
> >
> > Please do so, find the patch that introduced the error, add the Fixes
> > tag, will help me not having to do it myself :-)
>
> Fixes: 52839e653b562 ("perf tools: Add support for printing new mem_info
> encodings")

Ok, I'll add that, thanks.

But you forgot to add your Signed-off-by:, can you please provide it?

There was also a minor problem in the patch, there was no separation of
--- from the patch comment section to the patch itself, I'll fix that as
well.

- Arnaldo

2020-09-01 15:08:35

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

Em Tue, Sep 01, 2020 at 12:02:25PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Aug 26, 2020 at 03:33:35PM +0100, Al Grant escreveu:
> > On 26/08/2020 15:26, Arnaldo Carvalho de Melo wrote:
> > > Em Tue, Aug 25, 2020 at 10:40:43AM -0700, Andi Kleen escreveu:
> > > > On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
> > > > > perf_event.h has macros that define the field offsets in the
> > > > > data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> > > > > were both 37. These are distinct fields, and the bitfield layout
> > > > > in perf_mem_data_src confirms that SNOOPX should be at offset 38.
> > > >
> > > > Looks good.
> > > >
> > > > Reviewed-by: Andi Kleen <[email protected]>
> > > >
> > > > Probably should have a Fixes: header
> > >
> > > Please do so, find the patch that introduced the error, add the Fixes
> > > tag, will help me not having to do it myself :-)
> >
> > Fixes: 52839e653b562 ("perf tools: Add support for printing new mem_info
> > encodings")
>
> Ok, I'll add that, thanks.
>
> But you forgot to add your Signed-off-by:, can you please provide it?
>
> There was also a minor problem in the patch, there was no separation of
> --- from the patch comment section to the patch itself, I'll fix that as
> well.

Also you mixed up tools/ with include/ things, the perf part of the
kernel is maintained by Ingo, PeterZ.

Peter, the patch is the one below, I'll collect the
tools/include/uapi/linux/perf_event.h bit as it fixes the tooling,
please consider taking the kernel part.

Thanks,

- Arnaldo

---

From: Al Grant <[email protected]>
Subject: [PATCH] perf: correct SNOOPX field offset
Message-ID: <[email protected]>
Date: Mon, 24 Aug 2020 10:28:34 +0100

perf_event.h has macros that define the field offsets in the
data_src bitmask in perf records. The SNOOPX and REMOTE offsets
were both 37. These are distinct fields, and the bitfield layout
in perf_mem_data_src confirms that SNOOPX should be at offset 38.

Signed-off-by: Al Grant <[email protected]>

---

include/uapi/linux/perf_event.h | 2 +-
tools/include/uapi/linux/perf_event.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

---

diff --git a/include/uapi/linux/perf_event.h
b/include/uapi/linux/perf_event.h
index 077e7ee69e3d..3e5dcdd48a49 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -1196,7 +1196,7 @@ union perf_mem_data_src {

#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
/* 1 free */
-#define PERF_MEM_SNOOPX_SHIFT 37
+#define PERF_MEM_SNOOPX_SHIFT 38

/* locked instruction */
#define PERF_MEM_LOCK_NA 0x01 /* not available */
diff --git a/tools/include/uapi/linux/perf_event.h
b/tools/include/uapi/linux/perf_event.h
index 077e7ee69e3d..3e5dcdd48a49 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -1196,7 +1196,7 @@ union perf_mem_data_src {

#define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
/* 1 free */
-#define PERF_MEM_SNOOPX_SHIFT 37
+#define PERF_MEM_SNOOPX_SHIFT 38

/* locked instruction */
#define PERF_MEM_LOCK_NA 0x01 /* not available */

2020-09-01 15:09:38

by Al Grant

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset



On 01/09/2020 16:02, Arnaldo Carvalho de Melo wrote:
> Em Wed, Aug 26, 2020 at 03:33:35PM +0100, Al Grant escreveu:
>> On 26/08/2020 15:26, Arnaldo Carvalho de Melo wrote:
>>> Em Tue, Aug 25, 2020 at 10:40:43AM -0700, Andi Kleen escreveu:
>>>> On Mon, Aug 24, 2020 at 10:28:34AM +0100, Al Grant wrote:
>>>>> perf_event.h has macros that define the field offsets in the
>>>>> data_src bitmask in perf records. The SNOOPX and REMOTE offsets
>>>>> were both 37. These are distinct fields, and the bitfield layout
>>>>> in perf_mem_data_src confirms that SNOOPX should be at offset 38.
>>>>
>>>> Looks good.
>>>>
>>>> Reviewed-by: Andi Kleen <[email protected]>
>>>>
>>>> Probably should have a Fixes: header
>>>
>>> Please do so, find the patch that introduced the error, add the Fixes
>>> tag, will help me not having to do it myself :-)
>>
>> Fixes: 52839e653b562 ("perf tools: Add support for printing new mem_info
>> encodings")
>
> Ok, I'll add that, thanks.
> > But you forgot to add your Signed-off-by:, can you please provide it?

Signed-off-by: Al Grant <[email protected]>

> There was also a minor problem in the patch, there was no separation of
> --- from the patch comment section to the patch itself, I'll fix that as
> well.

Thanks, will remember for next time.

Al

2020-09-01 16:01:58

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

Em Tue, Sep 01, 2020 at 05:12:04PM +0200, [email protected] escreveu:
> On Tue, Sep 01, 2020 at 12:06:30PM -0300, Arnaldo Carvalho de Melo wrote:
>
> > Also you mixed up tools/ with include/ things, the perf part of the
> > kernel is maintained by Ingo, PeterZ.
>
> Right, it helps if the right people are on Cc.
>
> > Peter, the patch is the one below, I'll collect the
> > tools/include/uapi/linux/perf_event.h bit as it fixes the tooling,
> > please consider taking the kernel part.
>
> Al, can you resend with the right people on Cc? Also see below.
>
> > ---
> >
> > From: Al Grant <[email protected]>
> > Subject: [PATCH] perf: correct SNOOPX field offset
> > Message-ID: <[email protected]>
> > Date: Mon, 24 Aug 2020 10:28:34 +0100
> >
> > perf_event.h has macros that define the field offsets in the
> > data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> > were both 37. These are distinct fields, and the bitfield layout
> > in perf_mem_data_src confirms that SNOOPX should be at offset 38.
> >
>
> This needs a Fixes: tag.

He provided it in a later message, here it goes:

Fixes: 52839e653b5629bd ("perf tools: Add support for printing new mem_info encodings")

Also Andi has provided this:

Reviewed-by: Andi Kleen <[email protected]>

- Arnaldo


> > Signed-off-by: Al Grant <[email protected]>
> >
> > ---
> >
> > include/uapi/linux/perf_event.h | 2 +-
> > tools/include/uapi/linux/perf_event.h | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > ---
> >
> > diff --git a/include/uapi/linux/perf_event.h
> > b/include/uapi/linux/perf_event.h
> > index 077e7ee69e3d..3e5dcdd48a49 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
> >
> > #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> > /* 1 free */
> > -#define PERF_MEM_SNOOPX_SHIFT 37
> > +#define PERF_MEM_SNOOPX_SHIFT 38
> >
> > /* locked instruction */
> > #define PERF_MEM_LOCK_NA 0x01 /* not available */
> > diff --git a/tools/include/uapi/linux/perf_event.h
> > b/tools/include/uapi/linux/perf_event.h
> > index 077e7ee69e3d..3e5dcdd48a49 100644
> > --- a/tools/include/uapi/linux/perf_event.h
> > +++ b/tools/include/uapi/linux/perf_event.h
> > @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
> >
> > #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> > /* 1 free */
> > -#define PERF_MEM_SNOOPX_SHIFT 37
> > +#define PERF_MEM_SNOOPX_SHIFT 38
> >
> > /* locked instruction */
> > #define PERF_MEM_LOCK_NA 0x01 /* not available */

2020-09-01 17:23:16

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

On Tue, Sep 01, 2020 at 12:06:30PM -0300, Arnaldo Carvalho de Melo wrote:

> Also you mixed up tools/ with include/ things, the perf part of the
> kernel is maintained by Ingo, PeterZ.

Right, it helps if the right people are on Cc.

> Peter, the patch is the one below, I'll collect the
> tools/include/uapi/linux/perf_event.h bit as it fixes the tooling,
> please consider taking the kernel part.

Al, can you resend with the right people on Cc? Also see below.

> ---
>
> From: Al Grant <[email protected]>
> Subject: [PATCH] perf: correct SNOOPX field offset
> Message-ID: <[email protected]>
> Date: Mon, 24 Aug 2020 10:28:34 +0100
>
> perf_event.h has macros that define the field offsets in the
> data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> were both 37. These are distinct fields, and the bitfield layout
> in perf_mem_data_src confirms that SNOOPX should be at offset 38.
>

This needs a Fixes: tag.

> Signed-off-by: Al Grant <[email protected]>
>
> ---
>
> include/uapi/linux/perf_event.h | 2 +-
> tools/include/uapi/linux/perf_event.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> ---
>
> diff --git a/include/uapi/linux/perf_event.h
> b/include/uapi/linux/perf_event.h
> index 077e7ee69e3d..3e5dcdd48a49 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
>
> #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> /* 1 free */
> -#define PERF_MEM_SNOOPX_SHIFT 37
> +#define PERF_MEM_SNOOPX_SHIFT 38
>
> /* locked instruction */
> #define PERF_MEM_LOCK_NA 0x01 /* not available */
> diff --git a/tools/include/uapi/linux/perf_event.h
> b/tools/include/uapi/linux/perf_event.h
> index 077e7ee69e3d..3e5dcdd48a49 100644
> --- a/tools/include/uapi/linux/perf_event.h
> +++ b/tools/include/uapi/linux/perf_event.h
> @@ -1196,7 +1196,7 @@ union perf_mem_data_src {
>
> #define PERF_MEM_SNOOPX_FWD 0x01 /* forward */
> /* 1 free */
> -#define PERF_MEM_SNOOPX_SHIFT 37
> +#define PERF_MEM_SNOOPX_SHIFT 38
>
> /* locked instruction */
> #define PERF_MEM_LOCK_NA 0x01 /* not available */

2020-09-01 17:37:33

by Peter Zijlstra

[permalink] [raw]
Subject: Re: [PATCH] perf: correct SNOOPX field offset

On Tue, Sep 01, 2020 at 12:58:34PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Sep 01, 2020 at 05:12:04PM +0200, [email protected] escreveu:
> > On Tue, Sep 01, 2020 at 12:06:30PM -0300, Arnaldo Carvalho de Melo wrote:
> >
> > > Also you mixed up tools/ with include/ things, the perf part of the
> > > kernel is maintained by Ingo, PeterZ.
> >
> > Right, it helps if the right people are on Cc.
> >
> > > Peter, the patch is the one below, I'll collect the
> > > tools/include/uapi/linux/perf_event.h bit as it fixes the tooling,
> > > please consider taking the kernel part.
> >
> > Al, can you resend with the right people on Cc? Also see below.
> >
> > > ---
> > >
> > > From: Al Grant <[email protected]>
> > > Subject: [PATCH] perf: correct SNOOPX field offset
> > > Message-ID: <[email protected]>
> > > Date: Mon, 24 Aug 2020 10:28:34 +0100
> > >
> > > perf_event.h has macros that define the field offsets in the
> > > data_src bitmask in perf records. The SNOOPX and REMOTE offsets
> > > were both 37. These are distinct fields, and the bitfield layout
> > > in perf_mem_data_src confirms that SNOOPX should be at offset 38.
> > >
> >
> > This needs a Fixes: tag.
>
> He provided it in a later message, here it goes:
>
> Fixes: 52839e653b5629bd ("perf tools: Add support for printing new mem_info encodings")
>
> Also Andi has provided this:
>
> Reviewed-by: Andi Kleen <[email protected]>

Have him send a new and complete patch, we're not an editing service.