public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Stephane Eranian <eranian@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	acme@redhat.com, mingo@elte.hu, paulus@samba.org,
	cjashfor@linux.vnet.ibm.com, fweisbec@gmail.com,
	gorcunov@openvz.org, tzanussi@gmail.com, mhiramat@redhat.com,
	robert.richter@amd.com, fche@redhat.com,
	linux-kernel@vger.kernel.org, masami.hiramatsu.pt@hitachi.com,
	drepper@gmail.com, asharma@fb.com,
	benjamin.redelings@nescent.org
Subject: Re: [PATCH 01/16] perf: Unified API to record selective sets of arch registers
Date: Thu, 24 May 2012 14:37:50 +0200	[thread overview]
Message-ID: <20120524123750.GD1775@m.brq.redhat.com> (raw)
In-Reply-To: <CABPqkBTshaU6cMnrcbO9aQ5GyO4rbNSSSP6_3DCD0YSZgS7tXA@mail.gmail.com>

On Thu, May 24, 2012 at 02:13:19PM +0200, Stephane Eranian wrote:
> 2012/5/24 Peter Zijlstra <a.p.zijlstra@chello.nl>:
> > On Wed, 2012-05-23 at 21:32 +0200, Jiri Olsa wrote:
> >> +enum perf_event_x86_32_regs {
> >> +       PERF_X86_32_REG_EAX,
> >> +       PERF_X86_32_REG_EBX,
> >> +       PERF_X86_32_REG_ECX,
> >> +       PERF_X86_32_REG_EDX,
> >> +       PERF_X86_32_REG_ESI,
> >> +       PERF_X86_32_REG_EDI,
> >> +       PERF_X86_32_REG_EBP,
> >> +       PERF_X86_32_REG_ESP,
> >> +       PERF_X86_32_REG_EIP,
> >> +       PERF_X86_32_REG_FLAGS,
> >> +       PERF_X86_32_REG_CS,
> >> +       PERF_X86_32_REG_DS,
> >> +       PERF_X86_32_REG_ES,
> >> +       PERF_X86_32_REG_FS,
> >> +       PERF_X86_32_REG_GS,
> >> +
> >> +       /* Non ABI */
> >> +       PERF_X86_32_REG_MAX,
> >> +};
> >
> >> +enum perf_event_x86_64_regs {
> >> +       PERF_X86_64_REG_RAX,
> >> +       PERF_X86_64_REG_RBX,
> >> +       PERF_X86_64_REG_RCX,
> >> +       PERF_X86_64_REG_RDX,
> >> +       PERF_X86_64_REG_RSI,
> >> +       PERF_X86_64_REG_RDI,
> >> +       PERF_X86_64_REG_R8,
> >> +       PERF_X86_64_REG_R9,
> >> +       PERF_X86_64_REG_R10,
> >> +       PERF_X86_64_REG_R11,
> >> +       PERF_X86_64_REG_R12,
> >> +       PERF_X86_64_REG_R13,
> >> +       PERF_X86_64_REG_R14,
> >> +       PERF_X86_64_REG_R15,
> >> +       PERF_X86_64_REG_RBP,
> >> +       PERF_X86_64_REG_RSP,
> >> +       PERF_X86_64_REG_RIP,
> >> +       PERF_X86_64_REG_FLAGS,
> >> +       PERF_X86_64_REG_CS,
> >> +       PERF_X86_64_REG_SS,
> >> +
> >> +       /* Non ABI */
> >> +       PERF_X86_64_REG_MAX,
> >> +};
> >
> > So why bother with two different APIs? Why not have only the x86_64 one
> > and maybe add a warning/error/fail whatever when x86_64 regs are
> > selected on i386/compat tasks.
> >
> >
> I agree with Peter here especially after our earlier discussion about how
> to handle 32-bit ABI threads on a 64-bit ABI kernel. You should simply
> fill in the record with zeroes when the register does not exists. You cannot
> predict what will be sampled in system-wide mode.
> 
> The only sanity check you can do is on 32-bit ABI kernel, reject any 64-bit
> ABI only regs but then that would require invoking arch specific code from
> perf_copy_attr()....

ok, looks like this could work.. and fix the confusion for compat tasks

  reply	other threads:[~2012-05-24 12:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23 19:31 [RFCv4 00/16] perf: Add backtrace post dwarf unwind Jiri Olsa
2012-05-23 19:32 ` [PATCH 01/16] perf: Unified API to record selective sets of arch registers Jiri Olsa
2012-05-24  9:33   ` Peter Zijlstra
2012-05-24 12:13     ` Stephane Eranian
2012-05-24 12:37       ` Jiri Olsa [this message]
2012-05-24  9:43   ` Peter Zijlstra
2012-06-07  9:46     ` Frederic Weisbecker
2012-06-07 10:29       ` Peter Zijlstra
2012-06-07 10:31         ` Frederic Weisbecker
2012-06-07 10:36         ` Stephane Eranian
2012-05-23 19:32 ` [PATCH 02/16] perf: Add ability to attach registers dump to sample Jiri Olsa
2012-05-24  9:50   ` Peter Zijlstra
2012-05-24 10:06     ` Stephane Eranian
2012-05-24 10:42       ` Peter Zijlstra
2012-05-24 11:52         ` Jiri Olsa
2012-05-25 10:01           ` Peter Zijlstra
2012-06-07  9:56           ` Frederic Weisbecker
2012-05-24  9:51   ` Peter Zijlstra
2012-05-24  9:57   ` Peter Zijlstra
2012-05-23 19:32 ` [PATCH 03/16] perf: Factor __output_copy to be usable with specific copy function Jiri Olsa
2012-05-23 19:32 ` [PATCH 04/16] perf: Add ability to attach user stack dump to sample Jiri Olsa
2012-05-24 10:44   ` Peter Zijlstra
2012-05-24 10:51   ` Peter Zijlstra
2012-05-24 12:16     ` Jiri Olsa
2012-06-07 10:07     ` Frederic Weisbecker
2012-06-07 14:07       ` Jiri Olsa
2012-05-23 19:32 ` [PATCH 05/16] perf: Add attribute to filter out user callchains Jiri Olsa
2012-05-24 10:57   ` Peter Zijlstra
2012-05-23 19:32 ` [PATCH 06/16] perf, tool: Factor DSO symtab types to generic binary types Jiri Olsa
2012-05-23 19:32 ` [PATCH 07/16] perf, tool: Add interface to read DSO image data Jiri Olsa
2012-05-23 19:32 ` [PATCH 08/16] perf, tool: Add '.note' check into search for NOTE section Jiri Olsa
2012-05-23 19:32 ` [PATCH 09/16] perf, tool: Back [vdso] DSO with real data Jiri Olsa
2012-05-23 19:32 ` [PATCH 10/16] perf, tool: Add interface to arch registers sets Jiri Olsa
2012-05-23 19:32 ` [PATCH 11/16] perf, tool: Add libunwind dependency for dwarf cfi unwinding Jiri Olsa
2012-05-23 19:32 ` [PATCH 12/16] perf, tool: Support user regs and stack in sample parsing Jiri Olsa
2012-05-23 19:32 ` [PATCH 13/16] perf, tool: Support for dwarf cfi unwinding on post processing Jiri Olsa
2012-05-23 19:32 ` [PATCH 14/16] perf, tool: Support for dwarf mode callchain on perf record Jiri Olsa
2012-05-23 19:32 ` [PATCH 15/16] perf, tool: Add dso data caching Jiri Olsa
2012-05-23 19:32 ` [PATCH 16/16] perf, tool: Add dso data caching tests Jiri Olsa

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=20120524123750.GD1775@m.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=asharma@fb.com \
    --cc=benjamin.redelings@nescent.org \
    --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=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