Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941477AbcJ0PTa (ORCPT ); Thu, 27 Oct 2016 11:19:30 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43244 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933490AbcJ0PT3 (ORCPT ); Thu, 27 Oct 2016 11:19:29 -0400 Date: Thu, 27 Oct 2016 10:28:01 +0200 From: Peter Zijlstra To: Pavel Machek Cc: acme@redhat.com, kernel list , mingo@redhat.com, alexander.shishkin@linux.intel.com Subject: Re: Getting interrupt every million cache misses Message-ID: <20161027082801.GE3568@worktop.programming.kicks-ass.net> References: <20161026204748.GA11177@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161026204748.GA11177@amd> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 601 Lines: 19 On Wed, Oct 26, 2016 at 10:54:16PM +0200, Pavel Machek wrote: > Hi! > > I'd like to get an interrupt every million cache misses... to do a > printk() or something like that. As far as I can tell, modern hardware > should allow me to do that. AFAICT performance events subsystem can do > something like that, but I can't figure out where the code is / what I > should call. > > Can someone help? Can you go back one step and explain why you would want this? What use is a printk() on every 1e6-th cache miss. That is, why doesn't: $ perf record -e cache-misses -c 1000000 -a -- sleep 5 suffice?