From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751398AbdFDTK2 (ORCPT ); Sun, 4 Jun 2017 15:10:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45536 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdFDTJ2 (ORCPT ); Sun, 4 Jun 2017 15:09:28 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C6E120B18 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jolsa@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6C6E120B18 Date: Sun, 4 Jun 2017 21:09:22 +0200 From: Jiri Olsa To: Adrian Hunter Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Michael Petlan , lkml , Ingo Molnar , Peter Zijlstra , Namhyung Kim , David Ahern , Andi Kleen Subject: Re: [PATCH 1/2] perf tests: Fix switch tracking test for P4 Message-ID: <20170604190922.GF18648@krava> References: <20170526123141.20900-1-jolsa@kernel.org> <20170601131143.GD2899@kernel.org> <0e5e60b6-2304-b3df-e619-4c1a1afd0ad9@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0e5e60b6-2304-b3df-e619-4c1a1afd0ad9@intel.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 04 Jun 2017 19:09:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2017 at 02:35:59PM +0300, Adrian Hunter wrote: > On 01/06/17 16:11, Arnaldo Carvalho de Melo wrote: > > Em Fri, May 26, 2017 at 02:31:40PM +0200, Jiri Olsa escreveu: > >> The switch tracking test keeps failing on P4 cpu, > >> when NMI watchdog is enabled. > >> > >> The reason is that P4 pmu uses substitute event for cycles > >> when it's already taken (in our case by NMI watchdog), but > >> this event does not give even results like cycles, and we > >> could end up with no samples at all for our short > >> measuring period. > > Did you consider increasing the measuring period? not really, in some cases I saw no samples generated for bigger periods for another workloads, so I did not think of that in here, but I'll check SNIP > >> > >> static int spin_sleep(void) > >> { > >> @@ -298,6 +299,27 @@ static int process_events(struct perf_evlist *evlist, > >> return ret; > >> } > >> > >> +static const char *get_hw_counter(void) > >> +{ > >> + const char *counter = "cycles:u"; > >> + char *cpuid; > >> + > >> + cpuid = get_cpuid_str(); > >> + > >> + /* > >> + * P4 pmu uses substitute event for cycles if it's already > >> + * taken, but it does not give even results like cycles, > >> + * and we could end up with no samples at all for our short > >> + * measuring period. Using "instructions:u" event instead, > >> + * which seems to be stable enough. > >> + */ > >> + if (!strcmp("GenuineIntel-15-4", cpuid)) > > Why just model 4? Isn't all family 15 P4? I thought there's just one model.. but just based on the kernel code > > >> + counter = "instructions:u"; > >> + > >> + pr_debug("using '%s' HW counter"); > > tests/switch-tracking.c: In function ‘get_hw_counter’: > tests/switch-tracking.c:319:2: error: format ‘%s’ expects a matching ‘char > *’ argument [-Werror=format=] omg.. sure ;-) thanks, jirka