mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, ak@linux.intel.com,
	jolsa@redhat.com, acme@redhat.com, namhyung@kernel.org
Subject: Re: [PATCH v2 1/5] perf: add ability to sample machine state on interrupt
Date: Tue, 15 Jul 2014 16:25:24 +0200	[thread overview]
Message-ID: <20140715142524.GI9918@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1405384304-26816-2-git-send-email-eranian@google.com>

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Tue, Jul 15, 2014 at 02:31:40AM +0200, Stephane Eranian wrote:
> @@ -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;
>  }

> +static void perf_sample_regs_intr(struct perf_regs *regs_intr,
> +				  struct pt_regs *regs)
> +{
> +	regs_intr->regs = regs;
> +	regs_intr->abi  = perf_reg_abi(current);
> +}

> @@ -4800,6 +4824,20 @@ void perf_prepare_sample(struct perf_event_header *header,
>  		data->stack_user_size = stack_size;
>  		header->size += size;
>  	}
> +
> +	if (sample_type & PERF_SAMPLE_REGS_INTR) {
> +		/* regs dump ABI info */
> +		int size = sizeof(u64);
> +
> +		perf_sample_regs_intr(&data->regs_intr, regs);
> +
> +		if (data->regs_intr.regs) {
> +			u64 mask = event->attr.sample_regs_intr;
> +			size += hweight64(mask) * sizeof(u64);
> +		}
> +
> +		header->size += size;
> +	}

Given that the prepare_sample hunk sets both regs_intr fields, the
addition to perf_sample_data_init() is entirely superfluous, no?

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-07-15 14:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  0:31 [PATCH v2 0/5] perf: add ability to sample interrupted machine state Stephane Eranian
2014-07-15  0:31 ` [PATCH v2 1/5] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-07-15 14:16   ` Peter Zijlstra
2014-07-16  0:05     ` Stephane Eranian
2014-07-15 14:25   ` Peter Zijlstra [this message]
2014-07-15 23:58     ` Stephane Eranian
2014-07-15  0:31 ` [PATCH v2 2/5] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-07-15 14:29   ` Peter Zijlstra
2014-07-15 23:56     ` Stephane Eranian
2014-07-15  0:31 ` [PATCH v2 3/5] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-07-15  0:31 ` [PATCH v2 4/5] perf/tests: add interrupted state sample parsing test Stephane Eranian
2014-07-15  0:31 ` [PATCH v2 5/5] perf record: add new -I option to sample interrupted machine state 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=20140715142524.GI9918@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --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 \
    /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

all inboxes | Powered by JetHome®