Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758592AbZCYJnY (ORCPT ); Wed, 25 Mar 2009 05:43:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758690AbZCYJnF (ORCPT ); Wed, 25 Mar 2009 05:43:05 -0400 Received: from bilbo.ozlabs.org ([203.10.76.25]:49364 "EHLO bilbo.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755218AbZCYJnD (ORCPT ); Wed, 25 Mar 2009 05:43:03 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18889.64659.917207.685779@cargo.ozlabs.ibm.com> Date: Wed, 25 Mar 2009 20:42:43 +1100 From: Paul Mackerras To: Ingo Molnar Cc: Andrew Morton , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf_counter: allow and require one-page mmap on counting counters In-Reply-To: <20090325090336.GC2341@elte.hu> References: <18889.59409.260586.87939@cargo.ozlabs.ibm.com> <20090325082844.GA11217@elte.hu> <18889.61903.636761.471281@cargo.ozlabs.ibm.com> <20090325090336.GC2341@elte.hu> X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i486-pc-linux-gnu) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1647 Lines: 37 Ingo Molnar writes: > ah - ok. Morning confusion. (any email from me that comes at single > digit hour local time should be considered fundamentally suspect ;-) :) > Wouldnt it still be better to keep the symmetry between counting and > sampling counters? In theory we could transit between these stags > and 'switch off' a sampling counter or 'switch on' a counting > counter - via an ioctl or so. Shouldnt counting counters be sampling > counters that were created while disabled temporarily? Well, the buffer size can already be changed on the fly, by unmapping the counter and remapping. So, shouldn't I be allowed to select a zero-sized ring buffer at the times when I'm not sampling, i.e. when it's a counting counter? And here's something else that is semi-related: the PAPI guys want a kind of counter that counts until it overflows, and then sends a signal to the process and disables itself (and the whole group it's in). The signal handler can then record whatever application-specific information is interesting, re-enable the counter and return. It seems to be a way to do profiling where what you're recording is something specific to the program rather than generic things like the instruction pointer. So that could be a case where we want a sampling counter that doesn't generate any event records in the kernel, and so a 0-sized ring buffer could be appropriate. Paul. -- 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/