[PATCH V6 6/8] perf/tools: Extend branch type classification

German Gomez german.gomez at arm.com
Wed Jun 15 06:39:01 PDT 2022


On 15/06/2022 04:21, Anshuman Khandual wrote:
> [...]
>  
> +const char *get_branch_type(struct branch_entry *e)
> +{
> +	if (e->flags.type == PERF_BR_UNKNOWN)
> +		return "";
>> There is a small change of behavior in "perf script --field brstack".
>> Unknown branches were printed as "-" before but now it's an empty
>> string.
> get_branch_type() replaces print output in two different functions.
> branch_stack__printf() used to print a space " " for PERF_BR_UNKNOWN,
> and print_bstack_flags() used to print a "-" for PERF_BR_UNKNOWN.
> When they are factorized via get_branch_type(), one of those print
> formats need to be choosen.

Thanks for clarifying, Anshuman. I only bring it up in case somebody is
parsing this line for their use case. While running on x86 I came across
some UNKNOWN branches during my runs.

I have updated and sent a generic branch stack sampling perf test that
supports both ("-" and empty string) just in case. Hope it's useful.

https://lore.kernel.org/all/20220615130901.1151397-1-german.gomez@arm.com/

Thanks,
German



More information about the linux-arm-kernel mailing list