From owner-freebsd-hackers@freebsd.org Fri May 5 11:16:12 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14B8AD5FEE7 for ; Fri, 5 May 2017 11:16:12 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 057F01FBD for ; Fri, 5 May 2017 11:16:12 +0000 (UTC) (envelope-from zec@fer.hr) Received: by mailman.ysv.freebsd.org (Postfix) id 01DDFD5FEE6; Fri, 5 May 2017 11:16:12 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0181BD5FEE5 for ; Fri, 5 May 2017 11:16:12 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9101D1FBC for ; Fri, 5 May 2017 11:16:11 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (161.53.63.210) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 5 May 2017 13:16:01 +0200 Date: Fri, 5 May 2017 13:16:38 +0200 From: Marko Zec To: Subject: AMD CPU cache monitoring Message-ID: <20170505131638.4835dfce@x23> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [161.53.63.210] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 11:16:12 -0000 I'm looking for a simple, vendor-neutral tool for monitoring per-CPU-core data cache hits and misses (L2, L3). Adrian mentioned https://github.com/opcm/pcm in his article on profiling: http://adrianchadd.blogspot.hr/2013/08/profiling-on-superscalar-architectures.html This tool works fine on FBSD 11 and Intel silicon, and would be almost ideal for my needs, but unfortunately it doesn't work with AMD CPUs. OTOH, pmc(3) seems to be a more generic mechanism for working with performance counters, but I couldn't find useful examples on how to harvest per-cpu counters. Most of the pmc-related examples I bumped itno seem to be focused on call stack profiling, which isn't what I'm looking for. Any ideas on how to monitor CPU cache hits / misses on AMD CPUs? Thanks, Marko