From: Andi Kleen <ak@linux.intel.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-perf-users@vger.kernel.org, changbin.du@huawei.com
Subject: Re: [PATCH v4 2/2] perf, script, capstone: Add support for -F +brstackdisasm
Date: Tue, 19 Mar 2024 17:35:34 -0700 [thread overview]
Message-ID: <ZfovVgjCm5oDbze9@tassilo> (raw)
In-Reply-To: <fcdb6a82-30bf-4da5-a898-bba3c0bbc592@intel.com>
On Tue, Mar 19, 2024 at 08:52:33AM +0200, Adrian Hunter wrote:
> On 19/03/24 00:06, Andi Kleen wrote:
> >> Better to factor out a function that does not depend on "sample"
> >> e.g. see fprintf_insn_asm() below.
> >
> > this doesn't work because it completely ignores the need of the
> > cs_dump_insn caller for the path that i actually need for my feature,
> > which requires to return a string. I didn't apply it.
>
> I would probably change the call sites because they already have a
> file descriptor, but output to memory is doable:
> FILE *fp = fmemopen(x->out, sizeof(x->out), "w+");
I considered using this at some point, but I'm sure there is some non glibc,
that people build perf with, that doesn't have fmemopen, so I didn't.
Can we just use my version for now and if you prefer more refactor
please submit a follow on cleanup patch?
-andi
next prev parent reply other threads:[~2024-03-20 0:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 17:06 [PATCH v4 1/2] perf, capstone: Support 32bit code under 64bit OS Andi Kleen
2024-03-08 17:06 ` [PATCH v4 2/2] perf, script, capstone: Add support for -F +brstackdisasm Andi Kleen
2024-03-15 12:19 ` Adrian Hunter
2024-03-18 22:06 ` Andi Kleen
2024-03-19 6:52 ` Adrian Hunter
2024-03-20 0:35 ` Andi Kleen [this message]
2024-03-22 10:21 ` [PATCH] perf script: Consolidate capstone print functions Adrian Hunter
2024-04-08 20:35 ` Arnaldo Carvalho de Melo
2024-03-22 10:21 ` [PATCH v4 2/2] perf, script, capstone: Add support for -F +brstackdisasm Adrian Hunter
2024-03-15 12:19 ` [PATCH v4 1/2] perf, capstone: Support 32bit code under 64bit OS Adrian Hunter
2024-03-22 10:21 ` Adrian Hunter
2024-03-22 10:47 ` Thomas Richter
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=ZfovVgjCm5oDbze9@tassilo \
--to=ak@linux.intel.com \
--cc=adrian.hunter@intel.com \
--cc=changbin.du@huawei.com \
--cc=linux-perf-users@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).