Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932671AbbHZNMh (ORCPT ); Wed, 26 Aug 2015 09:12:37 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:42721 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755997AbbHZNMe (ORCPT ); Wed, 26 Aug 2015 09:12:34 -0400 Date: Wed, 26 Aug 2015 15:12:25 +0200 From: Peter Zijlstra To: Alexey Brodkin Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Vineet.Gupta1@synopsys.com, arc-linux-dev@synopsys.com, arnd@arndb.de, Arnaldo Carvalho de Melo Subject: Re: [PATCH v3 3/6] ARCv2: perf: Support sampling events using overflow interrupts Message-ID: <20150826131225.GD19282@twins.programming.kicks-ass.net> References: <1440426023-2792-1-git-send-email-abrodkin@synopsys.com> <1440426023-2792-4-git-send-email-abrodkin@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1440426023-2792-4-git-send-email-abrodkin@synopsys.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1059 Lines: 31 On Mon, Aug 24, 2015 at 05:20:20PM +0300, Alexey Brodkin wrote: > @@ -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); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/