linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf script: Update brstack syntax documentation
@ 2025-03-12  7:23 Yujie Liu
  2025-03-12  9:56 ` Leo Yan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yujie Liu @ 2025-03-12  7:23 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Andi Kleen, Martin Liska,
	James Clark, Leo Yan, Sandipan Das

The following commits added new fields/flags to the branch stack field
list:

commit 1f48989cdc7d ("perf script: Output branch sample type")
commit 6ade6c646035 ("perf script: Show branch speculation info")
commit 1e66dcff7b9b ("perf script: Add not taken event for branch stack")

Update brstack syntax documentation to be consistent with the latest
branch stack field list. Improve the descriptions to help users
interpret the fields accurately.

Signed-off-by: Yujie Liu <yujie.liu@intel.com>
---
Changes in v2:
- Add not taken event (Namhyung, Leo)
- Change field name from PRED to EVENT for generic use and furture
  extension (Leo)

v1: https://lore.kernel.org/all/20250225061736.1698175-1-yujie.liu@intel.com/
---
 tools/perf/Documentation/perf-script.txt | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
index b72866ef270b..28bec7e78bc8 100644
--- a/tools/perf/Documentation/perf-script.txt
+++ b/tools/perf/Documentation/perf-script.txt
@@ -239,13 +239,22 @@ OPTIONS
 	i.e., -F "" is not allowed.
 
 	The brstack output includes branch related information with raw addresses using the
-	/v/v/v/v/cycles syntax in the following order:
-	FROM: branch source instruction
-	TO  : branch target instruction
-        M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported
-	X/- : X=branch inside a transactional region, -=not in transaction region or not supported
-	A/- : A=TSX abort entry, -=not aborted region or not supported
-	cycles
+	FROM/TO/EVENT/INTX/ABORT/CYCLES/TYPE/SPEC syntax in the following order:
+	FROM  : branch source instruction
+	TO    : branch target instruction
+	EVENT : M=branch target or direction was mispredicted
+	        P=branch target or direction was predicted
+	        N=branch not-taken
+	        -=no event or not supported
+	INTX  : X=branch inside a transactional region
+	        -=branch not in transaction region or not supported
+	ABORT : A=TSX abort entry
+	        -=not aborted region or not supported
+	CYCLES: the number of cycles that have elapsed since the last branch was recorded
+	TYPE  : branch type: COND/UNCOND/IND/CALL/IND_CALL/RET etc.
+	        -=not supported
+	SPEC  : branch speculation info: SPEC_WRONG_PATH/NON_SPEC_CORRECT_PATH/SPEC_CORRECT_PATH
+	        -=not supported
 
 	The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible.
 

base-commit: b10f74308e1305275e69ddde711ec817cc69e306
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf script: Update brstack syntax documentation
  2025-03-12  7:23 [PATCH v2] perf script: Update brstack syntax documentation Yujie Liu
@ 2025-03-12  9:56 ` Leo Yan
  2025-03-14  7:04 ` Sandipan Das
  2025-03-14 17:43 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Leo Yan @ 2025-03-12  9:56 UTC (permalink / raw)
  To: Yujie Liu
  Cc: linux-perf-users, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang, Kan, Andi Kleen, Martin Liska, James Clark, Sandipan Das

On Wed, Mar 12, 2025 at 03:23:29PM +0800, Yujie Liu wrote:
> The following commits added new fields/flags to the branch stack field
> list:
> 
> commit 1f48989cdc7d ("perf script: Output branch sample type")
> commit 6ade6c646035 ("perf script: Show branch speculation info")
> commit 1e66dcff7b9b ("perf script: Add not taken event for branch stack")
> 
> Update brstack syntax documentation to be consistent with the latest
> branch stack field list. Improve the descriptions to help users
> interpret the fields accurately.
> 
> Signed-off-by: Yujie Liu <yujie.liu@intel.com>

Reviewed-by: Leo Yan <leo.yan@arm.com>

> ---
> Changes in v2:
> - Add not taken event (Namhyung, Leo)
> - Change field name from PRED to EVENT for generic use and furture
>   extension (Leo)
> 
> v1: https://lore.kernel.org/all/20250225061736.1698175-1-yujie.liu@intel.com/
> ---
>  tools/perf/Documentation/perf-script.txt | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
> index b72866ef270b..28bec7e78bc8 100644
> --- a/tools/perf/Documentation/perf-script.txt
> +++ b/tools/perf/Documentation/perf-script.txt
> @@ -239,13 +239,22 @@ OPTIONS
>  	i.e., -F "" is not allowed.
>  
>  	The brstack output includes branch related information with raw addresses using the
> -	/v/v/v/v/cycles syntax in the following order:
> -	FROM: branch source instruction
> -	TO  : branch target instruction
> -        M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported
> -	X/- : X=branch inside a transactional region, -=not in transaction region or not supported
> -	A/- : A=TSX abort entry, -=not aborted region or not supported
> -	cycles
> +	FROM/TO/EVENT/INTX/ABORT/CYCLES/TYPE/SPEC syntax in the following order:
> +	FROM  : branch source instruction
> +	TO    : branch target instruction
> +	EVENT : M=branch target or direction was mispredicted
> +	        P=branch target or direction was predicted
> +	        N=branch not-taken
> +	        -=no event or not supported
> +	INTX  : X=branch inside a transactional region
> +	        -=branch not in transaction region or not supported
> +	ABORT : A=TSX abort entry
> +	        -=not aborted region or not supported
> +	CYCLES: the number of cycles that have elapsed since the last branch was recorded
> +	TYPE  : branch type: COND/UNCOND/IND/CALL/IND_CALL/RET etc.
> +	        -=not supported
> +	SPEC  : branch speculation info: SPEC_WRONG_PATH/NON_SPEC_CORRECT_PATH/SPEC_CORRECT_PATH
> +	        -=not supported
>  
>  	The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible.
>  
> 
> base-commit: b10f74308e1305275e69ddde711ec817cc69e306
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf script: Update brstack syntax documentation
  2025-03-12  7:23 [PATCH v2] perf script: Update brstack syntax documentation Yujie Liu
  2025-03-12  9:56 ` Leo Yan
@ 2025-03-14  7:04 ` Sandipan Das
  2025-03-14 17:43 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Sandipan Das @ 2025-03-14  7:04 UTC (permalink / raw)
  To: Yujie Liu
  Cc: linux-perf-users, linux-kernel, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang, Kan, Andi Kleen, Martin Liska, James Clark, Leo Yan

On 3/12/2025 12:53 PM, Yujie Liu wrote:
> The following commits added new fields/flags to the branch stack field
> list:
> 
> commit 1f48989cdc7d ("perf script: Output branch sample type")
> commit 6ade6c646035 ("perf script: Show branch speculation info")
> commit 1e66dcff7b9b ("perf script: Add not taken event for branch stack")
> 
> Update brstack syntax documentation to be consistent with the latest
> branch stack field list. Improve the descriptions to help users
> interpret the fields accurately.
> 
> Signed-off-by: Yujie Liu <yujie.liu@intel.com>
> ---
> Changes in v2:
> - Add not taken event (Namhyung, Leo)
> - Change field name from PRED to EVENT for generic use and furture
>   extension (Leo)
> 
> v1: https://lore.kernel.org/all/20250225061736.1698175-1-yujie.liu@intel.com/
> ---
>  tools/perf/Documentation/perf-script.txt | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-script.txt b/tools/perf/Documentation/perf-script.txt
> index b72866ef270b..28bec7e78bc8 100644
> --- a/tools/perf/Documentation/perf-script.txt
> +++ b/tools/perf/Documentation/perf-script.txt
> @@ -239,13 +239,22 @@ OPTIONS
>  	i.e., -F "" is not allowed.
>  
>  	The brstack output includes branch related information with raw addresses using the
> -	/v/v/v/v/cycles syntax in the following order:
> -	FROM: branch source instruction
> -	TO  : branch target instruction
> -        M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported
> -	X/- : X=branch inside a transactional region, -=not in transaction region or not supported
> -	A/- : A=TSX abort entry, -=not aborted region or not supported
> -	cycles
> +	FROM/TO/EVENT/INTX/ABORT/CYCLES/TYPE/SPEC syntax in the following order:
> +	FROM  : branch source instruction
> +	TO    : branch target instruction
> +	EVENT : M=branch target or direction was mispredicted
> +	        P=branch target or direction was predicted
> +	        N=branch not-taken
> +	        -=no event or not supported
> +	INTX  : X=branch inside a transactional region
> +	        -=branch not in transaction region or not supported
> +	ABORT : A=TSX abort entry
> +	        -=not aborted region or not supported
> +	CYCLES: the number of cycles that have elapsed since the last branch was recorded
> +	TYPE  : branch type: COND/UNCOND/IND/CALL/IND_CALL/RET etc.
> +	        -=not supported
> +	SPEC  : branch speculation info: SPEC_WRONG_PATH/NON_SPEC_CORRECT_PATH/SPEC_CORRECT_PATH
> +	        -=not supported
>  
>  	The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible.
>  
> 
> base-commit: b10f74308e1305275e69ddde711ec817cc69e306


Reviewed-by: Sandipan Das <sandipan.das@amd.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] perf script: Update brstack syntax documentation
  2025-03-12  7:23 [PATCH v2] perf script: Update brstack syntax documentation Yujie Liu
  2025-03-12  9:56 ` Leo Yan
  2025-03-14  7:04 ` Sandipan Das
@ 2025-03-14 17:43 ` Namhyung Kim
  2 siblings, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2025-03-14 17:43 UTC (permalink / raw)
  To: linux-perf-users, linux-kernel, Yujie Liu
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, Liang, Kan, Andi Kleen, Martin Liska, James Clark,
	Leo Yan, Sandipan Das

On Wed, 12 Mar 2025 15:23:29 +0800, Yujie Liu wrote:
> The following commits added new fields/flags to the branch stack field
> list:
> 
> commit 1f48989cdc7d ("perf script: Output branch sample type")
> commit 6ade6c646035 ("perf script: Show branch speculation info")
> commit 1e66dcff7b9b ("perf script: Add not taken event for branch stack")
> 
> [...]
Applied to perf-tools-next, thanks!

Best regards,
Namhyung



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-03-14 17:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-12  7:23 [PATCH v2] perf script: Update brstack syntax documentation Yujie Liu
2025-03-12  9:56 ` Leo Yan
2025-03-14  7:04 ` Sandipan Das
2025-03-14 17:43 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).