From: Leo Yan <leo.yan@arm.com>
To: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>,
james.clark@arm.com, mike.leach@linaro.org,
suzuki.poulose@arm.com
Cc: acme@redhat.com, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, darren@os.amperecomputing.com,
scclevenger@os.amperecomputing.com
Subject: Re: [PATCH V2] perf scripts python arm-cs-trace-disasm.py: Skip disasm of discontiguous packets
Date: Fri, 9 Aug 2024 15:06:08 +0100 [thread overview]
Message-ID: <607b4abd-108c-4d3c-97e4-906a0a21aab5@arm.com> (raw)
In-Reply-To: <20240809094047.319917-1-gankulkarni@os.amperecomputing.com>
On 8/9/24 10:40, Ganapatrao Kulkarni wrote:> Script uses contiguous address range of adjacent packets to generate
> the tracing. When there is a continuity brake due to discontiguous
> branch address, it is resulting in to a perf tool crash(segfault).
> This is expected bhehaviour since the decoder is not expecting the
> discontiguous packets.
>
> Adding an option "force" to allow the decoder to continue and complete
> the tracing without application crash by dropping the discontiguous
> packets from decoding.
>
> Signed-off-by: Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
> ---
>
> Changes since V1:
> Updated patch as per discussions[1].
>
> [1] https://lore.kernel.org/linux-arm-kernel/ce4af204-874f-404c-a7aa-42dc6693d072@linaro.org/T/
>
> tools/perf/scripts/python/arm-cs-trace-disasm.py | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> index d973c2baed1c..65d59db3bcec 100755
> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> @@ -36,7 +36,10 @@ option_list = [
> help="Set path to objdump executable file"),
> make_option("-v", "--verbose", dest="verbose",
> action="store_true", default=False,
> - help="Enable debugging log")
> + help="Enable debugging log"),
> + make_option("-f", "--force", dest="force",
> + action="store_true", default=False,
> + help="Force decoder to continue")
> ]
>
> parser = OptionParser(option_list=option_list)
> @@ -257,6 +260,13 @@ def process_event(param_dict):
> print("Stop address 0x%x is out of range [ 0x%x .. 0x%x ] for dso %s" % (stop_addr, int(dso_start), int(dso_end), dso))
> return
>
> + if (stop_addr < start_addr):
> + if (options.verbose or not options.force):
> + print("Packet Discontinuity detected [stop_add:0x%x start_addr:0x%x ] for dso %s" % (stop_addr, start_addr, dso))
> + print("Use option '-f' following the script for force mode")
> + if (options.force):
> + return
A redundant indentation? After fix it:
Reviewed-by: Leo Yan <leo.yan@arm.com>
> +
> if (options.objdump_name != None):
> # It doesn't need to decrease virtual memory offset for disassembly
> # for kernel dso and executable file dso, so in this case we set
> --
> 2.44.0
>
prev parent reply other threads:[~2024-08-09 14:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-09 9:40 Ganapatrao Kulkarni
2024-08-09 14:06 ` Leo Yan [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=607b4abd-108c-4d3c-97e4-906a0a21aab5@arm.com \
--to=leo.yan@arm.com \
--cc=acme@redhat.com \
--cc=darren@os.amperecomputing.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=james.clark@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@linaro.org \
--cc=scclevenger@os.amperecomputing.com \
--cc=suzuki.poulose@arm.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®