From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965446AbcBQTer (ORCPT ); Wed, 17 Feb 2016 14:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46882 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965237AbcBQTep (ORCPT ); Wed, 17 Feb 2016 14:34:45 -0500 Date: Wed, 17 Feb 2016 20:34:42 +0100 From: Oleg Nesterov To: Peter Zijlstra Cc: Jiri Olsa , Pratyush Anand , Jeff Bastian , Michael Petlan , linux-kernel@vger.kernel.org, arm-devel@redhat.com Subject: Re: perf: wrong event->count report (Was: perf basic-test-aarch64 failures) Message-ID: <20160217193442.GB14068@redhat.com> References: <20160211093047.GA12115@dhcp-0-82.del.redhat.com> <20160215070620.GA23850@dhcppc3.redhat.com> <20160217033416.GA7371@redhat.com> <20160217093539.GC10042@krava.brq.redhat.com> <20160217102555.GZ6357@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160217102555.GZ6357@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/17, Peter Zijlstra wrote: > > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -3173,6 +3173,10 @@ static void perf_event_enable_on_exec(in > > cpuctx = __get_cpu_context(ctx); > perf_ctx_lock(cpuctx, ctx); > + > + update_context_time(ctx); > + update_cgrp_time_from_cpuctx(cpuctx); > + Even if I don't really understand this change I agree, probably we need to update the counters for enable_on_exec events somehow. But I don't see how this change can make total_time_running == total_time_enabled. And probably this is fine. In fact I do not understand why they should be equal. I inserted printf() into perf_counts_values__scale() to verify that /usr/bin/perf always sees count->run < count->ena even if I do, say, # perf stat -x- -e module:module_load -a sleep 1 0--module:module_load-1007397333-100.00 the kernel reports run=1007397333 ena=1007397573. Close but not equal. Again, I do not think this is wrong, I am only saying that I don't understand this logic because this always means "scaled" for perf. Nevermind, I never looked into tools/perf before, most probably I simply do not understand it at all. Oleg.