From: Stefan Hajnoczi <stefanha@gmail.com>
To: Vanderson Martins do Rosario <vandersonmr2@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>,
Riku Voipio <riku.voipio@iki.fi>,
qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>
Subject: Re: [Qemu-devel] [PATCH v1 1/2] accel/tcg: adding integration with linux perf
Date: Thu, 22 Aug 2019 15:44:07 +0100 [thread overview]
Message-ID: <20190822144407.GN20491@stefanha-x1.localdomain> (raw)
In-Reply-To: <CAMzYVD2pqphWChXPXCCuC9R3NcOHGz5yojLkT_+CMYbNdc4F=Q@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]
On Wed, Aug 21, 2019 at 04:01:48PM -0300, Vanderson Martins do Rosario wrote:
> On Thu, Aug 15, 2019 at 11:40 AM Stefan Hajnoczi <stefanha@gmail.com> wrote:
> > On Wed, Aug 14, 2019 at 11:37:24PM -0300, vandersonmr wrote:
> > > +void start_jitdump_file(void)
> > > +{
> > > + GString *dumpfile_name = g_string_new(NULL);;
> > > + g_string_printf(dumpfile_name, "./jit-%d.dump", getpid());
> >
> > Simpler:
> >
> > gchar *dumpfile_name = g_strdup_printf("./jit-%d.dump", getpid());
> > ...
> > g_free(dumpfile_name);
> >
> > > + dumpfile = fopen(dumpfile_name->str, "w+");
> >
> > getpid() and the global dumpfile variable make me wonder what happens
> > with multi-threaded TCG?
> >
>
> I did some tests and it appears to be working fine with multi-threaded TCG.
> tcg_exec_init should execute only once even in multi-threaded TCG, right?
> If so, we are going to create only one jitdump file. Also, both in Windows
> and Linux/POSIX fwrites is thread-safe, thus we would be safely updating
> the jitdump file. Does it make sense?
append_load_in_jitdump_file() calls fwrite() multiple times. What
guarantees they will not be interleaved when multiple threads call this
function?
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-08-22 14:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 2:37 [Qemu-devel] [PATCH v1 0/2] Integrating qemu to Linux Perf vandersonmr
2019-08-15 2:37 ` [Qemu-devel] [PATCH v1 1/2] accel/tcg: adding integration with linux perf vandersonmr
2019-08-15 14:40 ` Stefan Hajnoczi
2019-08-15 16:17 ` Alex Bennée
2019-08-22 14:41 ` Stefan Hajnoczi
2019-08-21 19:01 ` Vanderson Martins do Rosario
2019-08-22 14:44 ` Stefan Hajnoczi [this message]
2019-08-15 2:37 ` [Qemu-devel] [PATCH v1 2/2] tb-stats: adding TBStatistics info into perf dump vandersonmr
2019-08-15 16:19 ` Alex Bennée
2019-08-15 9:14 ` [Qemu-devel] [PATCH v1 0/2] Integrating qemu to Linux Perf no-reply
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=20190822144407.GN20491@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=laurent@vivier.eu \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
--cc=vandersonmr2@gmail.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;
as well as URLs for NNTP newsgroup(s).