mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Sandipan Das <sandipan.das@amd.com>,
	linux-perf-users@vger.kernel.org, acme@kernel.org,
	Anshuman.Khandual@arm.com
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] perf: Fix interpretation of branch records
Date: Thu, 1 Dec 2022 10:17:41 +0000	[thread overview]
Message-ID: <38c6bc97-0c18-c645-6973-55a0d29083ff@arm.com> (raw)
In-Reply-To: <444e806b-4593-7ea9-a8aa-27d2f726a751@amd.com>



On 01/12/2022 09:02, Sandipan Das wrote:
> On 11/30/2022 10:21 PM, James Clark wrote:
>> Commit 93315e46b000 ("perf/core: Add speculation info to branch
>> entries") added a new field in between type and new_type. Perf has
>> its own copy of this struct so update it to match the kernel side.
>>
>> This doesn't currently cause any issues because new_type is only used
>> by the Arm BRBE driver which isn't merged yet.
>>
>> Fixes: 93315e46b000 ("perf/core: Add speculation info to branch entries")
> 
> Technically, in the kernel sources, commit 93315e46b000 ("perf/core: Add
> speculation info to branch entries") landed before commit b190bc4ac9e6
> ("perf: Extend branch type classification").
> 
> So I think the Fixes tag should instead have commit 0ddea8e2a0c2
> ("perf branch: Extend branch type classification") which added the
> UAPI changes to the perf tool headers.

Yes maybe, or 831c05a7621b ("tools headers UAPI: Sync linux/perf_event.h
with the kernel sources") where spec was added to the perf copy of the
headers.

It's hard to say for sure which one is best. I think that the earliest
possible one is best in case anyone is debugging that kernel version
with userspace Perf. And to me it seems any kernel that has the spec
record should have it matching in userspace so I would still prefer
93315e46b000. Applying it on top of any other change would still lead to
misleading interpretation of the records.

> 
> Aside from that, the patch looks good to me.

Thanks for the review.

> 
>> Signed-off-by: James Clark <james.clark@arm.com>
>> ---
>>  tools/perf/util/branch.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/util/branch.h b/tools/perf/util/branch.h
>> index d6017c9b1872..3ed792db1125 100644
>> --- a/tools/perf/util/branch.h
>> +++ b/tools/perf/util/branch.h
>> @@ -22,9 +22,10 @@ struct branch_flags {
>>  			u64 abort:1;
>>  			u64 cycles:16;
>>  			u64 type:4;
>> +			u64 spec:2;
>>  			u64 new_type:4;
>>  			u64 priv:3;
>> -			u64 reserved:33;
>> +			u64 reserved:31;
>>  		};
>>  	};
>>  };
> 
> 

      reply	other threads:[~2022-12-01 10:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30 16:51 James Clark
2022-11-30 18:35 ` Namhyung Kim
2022-12-01  4:16 ` Anshuman Khandual
2022-12-02 18:33   ` Arnaldo Carvalho de Melo
2022-12-01  9:02 ` Sandipan Das
2022-12-01 10:17   ` James Clark [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38c6bc97-0c18-c645-6973-55a0d29083ff@arm.com \
    --to=james.clark@arm.com \
    --cc=Anshuman.Khandual@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=sandipan.das@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®