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,
Arun Sharma <asharma@fb.com>
Subject: Re: [PATCH 02/16] perf: Unified API to record selective sets of arch registers
Date: Wed, 2 May 2012 14:58:30 +0200 [thread overview]
Message-ID: <20120502125830.GF1548@m.brq.redhat.com> (raw)
In-Reply-To: <CABPqkBTFfHtqd0Zk7go4w6aC26vdjHirOyWRqXFct_5Q-ndx5A@mail.gmail.com>
SNIP
> >
> > I just sent v3, with changed design to be more generic, please check
> >
> > anyway, currently there's no way to mix 32 and 64 bit registers in sample.
> >
> > As I mentioned above, once running compat task, 64 bit registers
> > are stored anyway. Given that all 32 bit registers have 64 equiv.
> > you can ask to store RAX|RBX|R15.
> >
> Well, R8-R15 do not exist in 32-bit mode. So I wonder what is saved
> on the stack for those, probably nothing. And in that case, how do you
> handle the case where the user asked for R15 but it is not available and
> you know that only on PMU interrupt.
right, R8-R15 do not exist in 32 bit mode, meaning that the 32 bit task
do not use them... but when you enter 64 bit kernel from 32 bit compat
task, still 64bits registers are saved.. as for native 64 process,
there's no difference.. so even for 32 bit task you get 64 bits
registers described below.
The availbility of registers is tricky for user space register dump.
We dump whatever we got in pt_regs structure from perf_sample_regs_user.
The problem is, that exception do not store all of the registers.. the rest
of the registers is whatever is in stack occupying the pt_regs space.
When kernel is entered (by exception or irq), following is saved by CPU
(both 32 and 64 bits):
ss, sp, flags, cs ip
followed by SAVE_ARGS (for exception):
movq_cfi rdi, 8*8
movq_cfi rsi, 7*8
movq_cfi rdx, 6*8
.if \save_rcx
movq_cfi rcx, 5*8
.endif
movq_cfi rax, 4*8
.if \save_r891011
movq_cfi r8, 3*8
movq_cfi r9, 2*8
movq_cfi r10, 1*8
movq_cfi r11, 0*8
SAVE_REST - saves the whole pt_regs structure just for the
sake of the syscall_trace_enter function, once finished it's
poped out..
As for unwind we should get the most important ones. Of course
the unwind could be based on any register, and with bogus value
the unwind just stops.
I think we are in better shape for irqs but I'd need to check.
jirka
next prev parent reply other threads:[~2012-05-02 12:59 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
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 [this message]
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=20120502125830.GF1548@m.brq.redhat.com \
--to=jolsa@redhat.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=asharma@fb.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