All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>,
	"ak@linux.intel.com" <ak@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [PATCH 2/8] perf,x86: drop event->flags and use hw.constraint->flags
Date: Thu, 27 Jun 2013 13:14:45 +0200	[thread overview]
Message-ID: <20130627111445.GR28407@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CABPqkBSwrz_GSobSuXn+AvU1zp14nAccCer4o7DHmG2c90cxRA@mail.gmail.com>

On Thu, Jun 27, 2013 at 01:01:02PM +0200, Stephane Eranian wrote:
> Ok, the chunks that do not apply can be ignored for perf_event_intel.c.

Just to verify; I did a force apply ignoring the 2 hunks in perf_event_intel.c.
The result is the below patch; which gives:

# nice make O=defconfig-build/ -j16 -s
/usr/src/linux-2.6/arch/x86/kernel/cpu/perf_event.c: In function ‘x86_schedule_events’:
/usr/src/linux-2.6/arch/x86/kernel/cpu/perf_event.c:780:9: error: ‘struct hw_perf_event’ has no member named ‘flags’
/usr/src/linux-2.6/arch/x86/kernel/cpu/perf_event.c:794:14: error: ‘struct hw_perf_event’ has no member named ‘flags’
/usr/src/linux-2.6/arch/x86/kernel/cpu/perf_event.c: In function ‘x86_pmu_del’:
/usr/src/linux-2.6/arch/x86/kernel/cpu/perf_event.c:1180:11: error: ‘struct hw_perf_event’ has no member named ‘flags’
make[4]: *** [arch/x86/kernel/cpu/perf_event.o] Error 1


Please resend one that builds.

---
Subject: perf,x86: Drop event->flags and use hw.constraint->flags
From: Stephane Eranian <eranian@google.com>
Date: Fri, 21 Jun 2013 16:20:42 +0200

Now that we use the constraints directly from the event, we
do not need the event->flags field so drop it.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1371824448-7306-3-git-send-email-eranian@google.com
---
 arch/x86/kernel/cpu/perf_event_intel_ds.c |   19 ++++++++++---------
 include/linux/perf_event.h                |    1 -
 2 files changed, 10 insertions(+), 10 deletions(-)

--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -623,7 +623,6 @@ struct event_constraint *intel_pebs_cons
 	if (x86_pmu.pebs_constraints) {
 		for_each_event_constraint(c, x86_pmu.pebs_constraints) {
 			if ((event->hw.config & c->cmask) == c->code) {
-				event->hw.flags |= c->flags;
 				return c;
 			}
 		}
@@ -636,14 +635,15 @@ void intel_pmu_pebs_enable(struct perf_e
 {
 	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 	struct hw_perf_event *hwc = &event->hw;
+	int flags = event->hw.constraint->flags;
 
 	hwc->config &= ~ARCH_PERFMON_EVENTSEL_INT;
 
 	cpuc->pebs_enabled |= 1ULL << hwc->idx;
 
-	if (event->hw.flags & PERF_X86_EVENT_PEBS_LDLAT)
+	if (flags & PERF_X86_EVENT_PEBS_LDLAT)
 		cpuc->pebs_enabled |= 1ULL << (hwc->idx + 32);
-	else if (event->hw.flags & PERF_X86_EVENT_PEBS_ST)
+	else if (flags & PERF_X86_EVENT_PEBS_ST)
 		cpuc->pebs_enabled |= 1ULL << 63;
 }
 
@@ -651,12 +651,13 @@ void intel_pmu_pebs_disable(struct perf_
 {
 	struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
 	struct hw_perf_event *hwc = &event->hw;
+	int flags = event->hw.constraint->flags;
 
 	cpuc->pebs_enabled &= ~(1ULL << hwc->idx);
 
-	if (event->hw.constraint->flags & PERF_X86_EVENT_PEBS_LDLAT)
+	if (flags & PERF_X86_EVENT_PEBS_LDLAT)
 		cpuc->pebs_enabled &= ~(1ULL << (hwc->idx + 32));
-	else if (event->hw.constraint->flags & PERF_X86_EVENT_PEBS_ST)
+	else if (flags & PERF_X86_EVENT_PEBS_ST)
 		cpuc->pebs_enabled &= ~(1ULL << 63);
 
 	if (cpuc->enabled)
@@ -772,14 +773,14 @@ static void __intel_pmu_pebs_event(struc
 	struct perf_sample_data data;
 	struct pt_regs regs;
 	u64 sample_type;
+	int flags = event->hw.constraint->flags;
 	int fll, fst;
 
 	if (!intel_pmu_save_and_restart(event))
 		return;
 
-	fll = event->hw.flags & PERF_X86_EVENT_PEBS_LDLAT;
-	fst = event->hw.flags & (PERF_X86_EVENT_PEBS_ST |
-				 PERF_X86_EVENT_PEBS_ST_HSW);
+	fll = flags & PERF_X86_EVENT_PEBS_LDLAT;
+	fst = flags & (PERF_X86_EVENT_PEBS_ST | PERF_X86_EVENT_PEBS_ST_HSW);
 
 	perf_sample_data_init(&data, 0, event->hw.last_period);
 
@@ -802,7 +803,7 @@ static void __intel_pmu_pebs_event(struc
 		if (sample_type & PERF_SAMPLE_DATA_SRC) {
 			if (fll)
 				data.data_src.val = load_latency_data(pebs->dse);
-			else if (event->hw.flags & PERF_X86_EVENT_PEBS_ST_HSW)
+			else if (flags & PERF_X86_EVENT_PEBS_ST_HSW)
 				data.data_src.val =
 					precise_store_data_hsw(pebs->dse);
 			else
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -134,7 +134,6 @@ struct hw_perf_event {
 			int		event_base_rdpmc;
 			int		idx;
 			int		last_cpu;
-			int		flags;
 
 			struct hw_perf_event_extra extra_reg;
 			struct hw_perf_event_extra branch_reg;


  reply	other threads:[~2013-06-27 11:14 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-21 14:20 [PATCH 0/8] perf: add ability to sample physical data addresses Stephane Eranian
2013-06-21 14:20 ` [PATCH 1/8] perf,x86: disable PEBS-LL in intel_pmu_pebs_disable() Stephane Eranian
2013-06-24  8:44   ` Peter Zijlstra
2013-06-26  7:35     ` Stephane Eranian
2013-06-27  9:01   ` [tip:perf/core] perf/x86: Disable " tip-bot for Stephane Eranian
2013-06-21 14:20 ` [PATCH 2/8] perf,x86: drop event->flags and use hw.constraint->flags Stephane Eranian
2013-06-24  8:45   ` Peter Zijlstra
2013-06-26  7:36     ` Stephane Eranian
2013-06-26 10:36       ` Peter Zijlstra
2013-06-27 10:23         ` Stephane Eranian
2013-06-27 10:48           ` Peter Zijlstra
2013-06-27 11:01             ` Stephane Eranian
2013-06-27 11:14               ` Peter Zijlstra [this message]
2013-06-27 12:33                 ` Stephane Eranian
2013-06-27 14:10                   ` Peter Zijlstra
2013-06-21 14:20 ` [PATCH 3/8] perf,x86: add uvirt_to_phys_nmi helper function Stephane Eranian
2013-06-21 14:20 ` [PATCH 4/8] perf: add PERF_SAMPLE_PHYS_ADDR sample type Stephane Eranian
2013-06-21 14:20 ` [PATCH 5/8] perf,x86: add support for PERF_SAMPLE_PHYS_ADDR for PEBS-LL Stephane Eranian
2013-06-21 14:20 ` [PATCH 6/8] perf tools: add infrastructure to handle PERF_SAMPLE_PHYS_ADDR Stephane Eranian
2013-06-21 14:20 ` [PATCH 7/8] perf record: add option to sample physical load/store addresses Stephane Eranian
2013-06-21 14:20 ` [PATCH 8/8] perf mem: add physical addr sampling support Stephane Eranian
2013-06-23 21:58 ` [PATCH 0/8] perf: add ability to sample physical data addresses Jiri Olsa
2013-06-24  8:16   ` Stephane Eranian
2013-06-24  8:45     ` Jiri Olsa
2013-06-24  8:43 ` Peter Zijlstra
2013-06-25  9:59   ` Stephane Eranian
2013-06-25 10:47     ` Peter Zijlstra
2013-06-25 10:51       ` Ingo Molnar
2013-06-26 10:33         ` Peter Zijlstra
2013-06-26 19:10           ` Stephane Eranian
2013-06-28  9:58             ` Peter Zijlstra
2013-07-05 22:48               ` Stephane Eranian
2013-07-08  8:19                 ` Peter Zijlstra
2013-07-09  6:02                   ` Stephane Eranian
2013-07-30  8:02                   ` Stephane Eranian
2013-07-30  8:37                     ` Peter Zijlstra
2013-07-30  8:51                       ` Stephane Eranian
2013-07-30  9:02                         ` Peter Zijlstra
2013-07-30 13:09                           ` Stephane Eranian
2013-07-30 14:21                             ` Stephane Eranian
2013-07-30 14:50                               ` David Ahern
2013-07-30 14:53                                 ` Stephane Eranian
2013-07-30 14:59                                   ` David Ahern
2013-07-30 15:52                               ` Peter Zijlstra
2013-07-30 16:09                                 ` Stephane Eranian
2013-07-30 16:16                                   ` Peter Zijlstra
2013-06-26 13:29       ` Ingo Molnar

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=20130627111445.GR28407@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.kim@lge.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.