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

From: Alexey Brodkin
Date: Wed Aug 26 2015 - 09:21:18 EST

Hi Peter,

On Wed, 2015-08-26 at 15:12 +-0200, Peter Zijlstra wrote:
+AD4- On Mon, Aug 24, 2015 at 05:20:20PM +-0300, Alexey Brodkin wrote:
+AD4- +AD4- +AEAAQA- -295,6 +-317,16 +AEAAQA- static int arc+AF8-pmu+AF8-add(struct perf+AF8-event +ACo-event, int flags)
+AD4- +AD4- +AH0-
+AD4- +AD4-
+AD4- +AD4- write+AF8-aux+AF8-reg(ARC+AF8-REG+AF8-PCT+AF8-INDEX, idx)+ADs-
+AD4- +AD4- +-
+AD4- +AD4- +- arc+AF8-pmu-+AD4-act+AF8-counter+AFs-idx+AF0- +AD0- event+ADs-
+AD4- +AD4- +-
+AD4- +AD4- +- if (is+AF8-sampling+AF8-event(event)) +AHs-
+AD4- +AD4- +- /+ACo- Mimic full counter overflow as other arches do +ACo-/
+AD4- +AD4- +- write+AF8-aux+AF8-reg(ARC+AF8-REG+AF8-PCT+AF8-INT+AF8-CNTL, (u32)arc+AF8-pmu-+AD4-max+AF8-period)+ADs-
+AD4- +AD4- +- write+AF8-aux+AF8-reg(ARC+AF8-REG+AF8-PCT+AF8-INT+AF8-CNTH,
+AD4- +AD4- +- (arc+AF8-pmu-+AD4-max+AF8-period +AD4APg- 32))+ADs-
+AD4- +AD4- +- +AH0-
+AD4- +AD4- +-
+AD4- pmu::add should call pmu::start when PERF+AF8-EF+AF8-START, without that it
+AD4- should not start the counter, only schedule it.
+AD4- (although currently all pmu::add() calls will have EF+AF8-START set)

And that's what we do, don't we?
if (flags +ACY- PERF+AF8-EF+AF8-START)
arc+AF8-pmu+AF8-start(event, PERF+AF8-EF+AF8-RELOAD)+ADs-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at