From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755851AbbFCP4F (ORCPT ); Wed, 3 Jun 2015 11:56:05 -0400 Received: from mail.kernel.org ([198.145.29.136]:37186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753886AbbFCPz5 (ORCPT ); Wed, 3 Jun 2015 11:55:57 -0400 Date: Wed, 3 Jun 2015 12:55:43 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Jiri Olsa , lkml , Peter Zijlstra , Paul Mackerras , David Ahern , Namhyung Kim , Ingo Molnar , Andi Kleen , Stephane Eranian Subject: Re: [PATCH 4/9] perf stat: Remove transaction_run from shadow update/print code Message-ID: <20150603155543.GA32707@kernel.org> References: <1433341559-31848-1-git-send-email-jolsa@kernel.org> <1433341559-31848-5-git-send-email-jolsa@kernel.org> <20150603151038.GX624@kernel.org> <20150603151450.GA1246@krava.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150603151450.GA1246@krava.redhat.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, Jun 03, 2015 at 05:14:50PM +0200, Jiri Olsa escreveu: > On Wed, Jun 03, 2015 at 12:10:38PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Wed, Jun 03, 2015 at 04:25:54PM +0200, Jiri Olsa escreveu: > > > It's no longer needed, because we use nameid to recognize > > > transaction events. > > > > > > Keeping it only in stat code to initialize transaction events. > > > > Lemme see if I understand this correctly, this update_shadow_stats() is > > called only for transaction runs? > > > > It doesn't seem so, so now we will update those stats all the time? > > update_shadow_stats is called on currently read/processed > counter and based on its 'type' we update various other > counters - shadow counters - which are the base for things > like IPC in the stat output So: - else if (transaction_run && perf_stat_evsel__is(counter, CYCLES_IN_TX)) + else if (perf_stat_evsel__is(counter, CYCLES_IN_TX)) update_stats(&runtime_transaction_stats[ctx][cpu], count[0]); Before we were going to check this _only_ when transaction_run was set, now we are doing it always, or are you saying that perf_stat_evsel__is(counter, CYCLES_IN_TX) will only return true for transaction 'perf stat' usage? Let me take a look: Yes, in all cases we, start doing: perf_evlist__alloc_stats() perf_evsel__alloc_stat_priv() perf_evsel__reset_stat_priv() perf_stat_evsel_id_init(); struct perf_stat *ps = evsel->priv; ps->id = one of the entries below: static const char *id_str[PERF_STAT_EVSEL_ID__MAX] = { ID(NONE, x), ID(CYCLES_IN_TX, cpu/cycles-t/), ID(TRANSACTION_START, cpu/tx-start/), ID(ELISION_START, cpu/el-start/), ID(CYCLES_IN_TX_CP, cpu/cycles-ct/), }; Ok, guess I understood now, all the events above are transaction events, so if one of them is present, then, yes, this is a transaction run, and we don't need to look at the 'transaction_run' variable to update the shadow stats, got it right? I.e. we _never_ needed to look at 'transaction_id', just noticing that ps->id is not zero, ok. - Arnaldo