Thread (24 messages) 24 messages, 4 authors, 2015-10-19

Re: [PATCH v3 3/6] ARCv2: perf: Support sampling events using overflow interrupts

From: Peter Zijlstra <peterz@infradead.org>
Date: 2015-08-26 13:12:37
Also in: lkml

On Mon, Aug 24, 2015 at 05:20:20PM +0300, Alexey Brodkin wrote:
quoted hunk ↗ jump to hunk
@@ -295,6 +317,16 @@ static int arc_pmu_add(struct perf_event *event, int flags)
 	}
 
 	write_aux_reg(ARC_REG_PCT_INDEX, idx);
+
+	arc_pmu->act_counter[idx] = event;
+
+	if (is_sampling_event(event)) {
+		/* Mimic full counter overflow as other arches do */
+		write_aux_reg(ARC_REG_PCT_INT_CNTL, (u32)arc_pmu->max_period);
+		write_aux_reg(ARC_REG_PCT_INT_CNTH,
+			      (arc_pmu->max_period >> 32));
+	}
+
pmu::add should call pmu::start when PERF_EF_START, without that it
should not start the counter, only schedule it.

(although currently all pmu::add() calls will have EF_START set)
 	write_aux_reg(ARC_REG_PCT_CONFIG, 0);
 	write_aux_reg(ARC_REG_PCT_COUNTL, 0);
 	write_aux_reg(ARC_REG_PCT_COUNTH, 0);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help