All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <rth@twiddle.net>
Cc: Yeongkyoon Lee <yeongkyoon.lee@samsung.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	Kirill Batuzov <batuzovk@ispras.ru>,
	Blue Swirl <blauwirbel@gmail.com>,
	Stefan Weil <weil@mail.berlios.de>,
	Anthony Liguori <aliguori@amazon.com>,
	Amit Shah <amit.shah@redhat.com>,
	Matthew Fernandez <matthew.fernandez@gmail.com>
Subject: Re: [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-<pid>.map files
Date: Fri, 28 Mar 2014 11:12:55 +0000	[thread overview]
Message-ID: <87ppl6vao8.fsf@linaro.org> (raw)
In-Reply-To: <53348143.5060902@twiddle.net>


Richard Henderson <rth@twiddle.net> writes:

> On 03/27/2014 09:37 AM, alex.bennee@linaro.org wrote:
>> From: Alex Bennée <alex.bennee@linaro.org>
>> 
>> This allows the perf tool to map samples to each individual translation
>> block. This could be expanded for user space but currently it gives
>> enough information to find any hotblocks by other means.
>
> Plausible, I suppose.

It works fine on my toy test case (kernel + single computation
user-space /init task) but I've not really used it in anger for any
performance tweaking hence it's only an RFC patch. Hopefully it will
save re-inventing the wheel should anyone actually want to do serious
tcg optimisation.

I've had a brief poke around the TCG profiling and seen it track
generation cost. Do we have any hotblock tracking in the built-in profiler?

<snip>
>> +static void tcg_write_perfmap(uint8_t *start, uint64_t size, uint64_t target_pc)
>> +{
>> +    if (tcg_perfmap) {
>> +        g_fprintf(tcg_perfmap, "%lx %lx subject-0x%lx\n",
>> +                  (uint64_t) start, size, target_pc);
>> +    }
>> +}
>
> Why oh why do you feel the need to use g_fprintf?  That's just gratuitous glib
> obfuscation, that.

Sorry my bad, force of habit given that we have glib as a dependency.
But your right in this case it's just a dumb wrapper unlike when your
doing more string mangling where glib save a lot of time.

> For this small of a single-use function, I think it would be clearer to just do
> the printf directly in tcg_gen_code_common.  Certainly no need to use uint64_t
> all over the place; ptrdiff_t and target_ulong are exactly the right
> thing.

Do we have a format macro for target_ulong? The uint64_t was just for
simplicity. I found when I was messing with the trace-event stuff some
of the target types where barred from the common code although I guess
in this case the tcg is very aware of the execution target.

-- 
Alex Bennée

  reply	other threads:[~2014-03-28 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27 16:37 [Qemu-devel] [RFC PATCH] tcg: add ability to dump /tmp/perf-<pid>.map files alex.bennee
2014-03-27 19:51 ` Richard Henderson
2014-03-28 11:12   ` Alex Bennée [this message]
2014-03-28 13:29     ` Richard Henderson
2014-03-28 13:30     ` Richard Henderson
2014-03-28 12:29 ` Kirill Batuzov
2014-03-28 16:34   ` Alex Bennée
2014-03-28 20:04     ` Kirill Batuzov

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=87ppl6vao8.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=amit.shah@redhat.com \
    --cc=batuzovk@ispras.ru \
    --cc=blauwirbel@gmail.com \
    --cc=matthew.fernandez@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=weil@mail.berlios.de \
    --cc=yeongkyoon.lee@samsung.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.