public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	mingo@elte.hu, ak@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org
Subject: Re: [PATCH 1/4] perf: add ability to sample machine state on interrupt
Date: Wed, 9 Jul 2014 12:03:29 -0300	[thread overview]
Message-ID: <20140709150329.GB2384@redhat.com> (raw)
In-Reply-To: <1404857759-25105-2-git-send-email-eranian@google.com>

Em Wed, Jul 09, 2014 at 12:15:56AM +0200, Stephane Eranian escreveu:
> Enable capture of interrupted machine state in each
> sample.
> 
> Registers to sample are passed per event in the
> sample_regs_intr bitmask.
> 
> To sample interrupt machine state, the 
> PERF_SAMPLE_INTR_REGS must be passed in
> sample_type.
> 
> The list of available registers is arch
> dependent and provided by asm/perf_regs.h
> 
> Registers are laid out as u64 in the order
> of the bit order of sample_intr_regs.

I would have broken this into smaller pieces, with the first patch doing
the prep of renaming perf_regs_user to perf_regs, for instance.
 
> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---
>  include/linux/perf_event.h      |  7 +++++--
>  include/uapi/linux/perf_event.h | 14 ++++++++++++-
>  kernel/events/core.c            | 44 +++++++++++++++++++++++++++++++++++++++--
>  3 files changed, 60 insertions(+), 5 deletions(-)
> 
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 707617a..4970c1d 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -78,7 +78,7 @@ struct perf_branch_stack {
>  	struct perf_branch_entry	entries[0];
>  };
>  
> -struct perf_regs_user {
> +struct perf_regs {
>  	__u64		abi;
>  	struct pt_regs	*regs;
>  };
> @@ -595,7 +595,8 @@ struct perf_sample_data {
>  	struct perf_callchain_entry	*callchain;
>  	struct perf_raw_record		*raw;
>  	struct perf_branch_stack	*br_stack;
> -	struct perf_regs_user		regs_user;
> +	struct perf_regs		regs_user;
> +	struct perf_regs		regs_intr;
>  	u64				stack_user_size;
>  	u64				weight;
>  	/*
> @@ -618,6 +619,8 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
>  	data->weight = 0;
>  	data->data_src.val = 0;
>  	data->txn = 0;
> +	data->regs_intr.abi = PERF_SAMPLE_REGS_ABI_NONE;
> +	data->regs_intr.regs = NULL;

Nit:

This would be better right after the equivalent ones for regs_user, I
had to go to perf_sample_data_init() to check if that was done, yes, it
is right before data->weight = 0 :-)

Reading on...

  reply	other threads:[~2014-07-09 15:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 22:15 [PATCH v1 0/4] perf: add ability to sample interrupted machine state Stephane Eranian
2014-07-08 22:15 ` [PATCH 1/4] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-07-09 15:03   ` Arnaldo Carvalho de Melo [this message]
2014-07-09 15:46   ` Andi Kleen
2014-07-11  7:58   ` Jiri Olsa
2014-07-11  8:11   ` Jiri Olsa
2014-07-11  8:14   ` Jiri Olsa
2014-07-08 22:15 ` [PATCH 2/4] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-07-11  8:15   ` Jiri Olsa
2014-07-08 22:15 ` [PATCH 3/4] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-07-09 15:44   ` Andi Kleen
2014-07-11  8:20   ` Jiri Olsa
2014-07-11  8:25   ` Jiri Olsa
2014-07-14 17:54     ` Stephane Eranian
2014-07-11  8:27   ` Jiri Olsa
2014-07-08 22:15 ` [PATCH 4/4] perf record: add new -I option to sample interrupted machine state Stephane Eranian
2014-07-09 15:45   ` Andi Kleen
2014-07-14  8:00   ` Namhyung Kim
2014-07-14 17:52     ` Stephane Eranian
2014-07-09  8:26 ` [PATCH v1 0/4] perf: add ability " Namhyung Kim
2014-07-09 14:53   ` Arnaldo Carvalho de Melo
2014-07-09 15:26     ` Stephane Eranian
2014-07-09 15:47       ` Andi Kleen
2014-07-09 17:14         ` Stephane Eranian

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=20140709150329.GB2384@redhat.com \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /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