From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: acme@redhat.com, a.p.zijlstra@chello.nl, mingo@elte.hu,
paulus@samba.org, cjashfor@linux.vnet.ibm.com,
fweisbec@gmail.com, gorcunov@openvz.org, tzanussi@gmail.com,
mhiramat@redhat.com, rostedt@goodmis.org, robert.richter@amd.com,
fche@redhat.com, linux-kernel@vger.kernel.org,
masami.hiramatsu.pt@hitachi.com, drepper@gmail.com
Subject: Re: [PATCH 02/16] perf: Unified API to record selective sets of arch registers
Date: Thu, 26 Apr 2012 17:28:40 +0200 [thread overview]
Message-ID: <20120426152840.GC1659@m.brq.redhat.com> (raw)
In-Reply-To: <20120423103350.GB1720@m.brq.redhat.com>
On Mon, Apr 23, 2012 at 12:33:50PM +0200, Jiri Olsa wrote:
> On Mon, Apr 23, 2012 at 12:10:57PM +0200, Stephane Eranian wrote:
> > On Tue, Apr 17, 2012 at 1:17 PM, Jiri Olsa <jolsa@redhat.com> wrote:
SNIP
> > How are you going to deal with 32-bit binaries sampled on a 64-bit system?
>
> I dont have the solution right now... but seems like compat tasks need more
> thinking even before go ahead with this patchset.. since it's going affect
> the perf_event_attr and could bite us in future.
hi,
got more info on the compat task unwind
- for 32 bit task running under 64 bit env. the 64 bits user
registers values are stored on kernel stack when entering
the kernel via exception or interrupt, like for native
64 bit task
So I think we can keep the current interface as far as
compat tasks are concerned, since we will get 64 bits
registers all the time anyway.
The place that will take care of compat task unwind
is the post processing unwind.
For each processed sample we:
- get the sample and translate IP into MAP and DSO
- read DSO ELF class and figure out wether we deal with
64 or 32 bit task
- run libunwind interface with proper task class info,
which gets us to next bullet:
- 64 bit libunwind does not support unwind of 32 bit tasks ;)
so unless that change, I can see just one hacky way of doing
this via 32 bit libunwind being loaded in separate 32 bit
process and doing remote unwind for us..
I'll try to follow on this to see if there'd be some better
libunwind interface solution.. but thats quite longterm ;)
As for the sample registers interface.
Currently we have:
u64 user_sample_regs
- if != 0 we provide the user registers with mask specified
by its value
- it will stay for compat tasks as well
- we could use PERF_SAMPLE_USER_REGS sample type instead of the != 0
check to be more consistent, but that would eat up one sample bit
unnecessary
In some previous email you suggested some generic interface like
attr->sample_type |= PERF_SAMPLE_REGS
attr->sample_regs = EAX | EBX | EDI | ESI |.....
attr->sample_reg_mode = { INTR, PRECISE, USER }
I think we can have something like:
attr->sample_type |= PERF_SAMPLE_REGS
attr->sample_reg_mode = { INTR, PRECISE, USER }
but in case we want eg both USER and INTR modes together then we still
need to have:
u64 user_sample_regs
u64 intr_sample_regs
...
for the register modes mask definition. Some mode combinations might be
useless, but I think this could work.. we could always customize our
needs with new mode ;)
I'll start to work on this unless I hear some screaming ;)
thoughts? ;)
thanks and sorry for long email,
jirka
next prev parent reply other threads:[~2012-04-26 16:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 11:17 [RFCv2 00/15] perf: Add backtrace post dwarf unwind Jiri Olsa
2012-04-17 11:17 ` [PATCH 01/16] uaccess: Add new copy_from_user_gup API Jiri Olsa
2012-04-17 11:17 ` [PATCH 02/16] perf: Unified API to record selective sets of arch registers Jiri Olsa
2012-04-23 10:10 ` Stephane Eranian
2012-04-23 10:33 ` Jiri Olsa
2012-04-26 15:28 ` Jiri Olsa [this message]
2012-05-02 12:00 ` Stephane Eranian
2012-05-02 12:26 ` Jiri Olsa
2012-05-02 12:36 ` Stephane Eranian
2012-05-02 12:58 ` Jiri Olsa
2012-05-02 14:46 ` Stephane Eranian
2012-05-03 10:25 ` Jiri Olsa
2012-04-17 11:17 ` [PATCH 03/16] perf: Add ability to dump user regs Jiri Olsa
2012-04-23 10:15 ` Stephane Eranian
2012-04-17 11:17 ` [PATCH 04/16] perf: Add ability to dump part of the user stack Jiri Olsa
2012-04-17 11:17 ` [PATCH 05/16] perf: Add attribute to filter out user callchains Jiri Olsa
2012-04-17 11:17 ` [PATCH 06/16] perf, tool: Factor DSO symtab types to generic binary types Jiri Olsa
2012-04-17 11:17 ` [PATCH 07/16] perf, tool: Add interface to read DSO image data Jiri Olsa
2012-04-17 11:17 ` [PATCH 08/16] perf, tool: Add '.note' check into search for NOTE section Jiri Olsa
2012-04-17 11:17 ` [PATCH 09/16] perf, tool: Back [vdso] DSO with real data Jiri Olsa
2012-04-17 11:17 ` [PATCH 10/16] perf, tool: Add interface to arch registers sets Jiri Olsa
2012-04-17 11:17 ` [PATCH 11/16] perf, tool: Add libunwind dependency for dwarf cfi unwinding Jiri Olsa
2012-04-17 11:17 ` [PATCH 12/16] perf, tool: Support user regs and stack in sample parsing Jiri Olsa
2012-04-17 11:17 ` [PATCH 13/16] perf, tool: Support for dwarf cfi unwinding on post processing Jiri Olsa
2012-04-17 11:17 ` [PATCH 14/16] perf, tool: Support for dwarf mode callchain on perf record Jiri Olsa
2012-04-17 11:17 ` [PATCH 15/16] perf, tool: Add dso data caching Jiri Olsa
2012-04-17 11:17 ` [PATCH 16/16] perf, tool: Add dso data caching tests Jiri Olsa
2012-04-18 6:51 ` [RFCv2 00/15] perf: Add backtrace post dwarf unwind Frederic Weisbecker
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=20120426152840.GC1659@m.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=drepper@gmail.com \
--cc=eranian@google.com \
--cc=fche@redhat.com \
--cc=fweisbec@gmail.com \
--cc=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mhiramat@redhat.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=robert.richter@amd.com \
--cc=rostedt@goodmis.org \
--cc=tzanussi@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