All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
To: Andi Kleen <ak@linux.intel.com>
Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
	brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com,
	heiko.carstens@de.ibm.com
Subject: Re: [PATCH] perf stat: Add support for s390 transaction counters
Date: Wed, 14 Mar 2018 17:42:36 +0100	[thread overview]
Message-ID: <20180314164236.GB5297@linux.vnet.ibm.com> (raw)
In-Reply-To: <20180314154317.GG13724@tassilo.jf.intel.com>

Hi,

On Wed, Mar 14, 2018 at 08:43:17AM -0700, Andi Kleen wrote:
> > S390 has no support for Elision and uses transaction begin/end/abort
> > instructions. The CPU measurement counter facility provides counters for
> > transaction end and transaction abort.
> 
> You don't need to implement the el-* events.
> 
> > I have used this table (taken from arch/x86/events/intel/core.c) as giudeline:
> > /* Haswell special events */
> > EVENT_ATTR_STR(tx-start,        tx_start,       "event=0xc9,umask=0x1");
> > EVENT_ATTR_STR(tx-commit,       tx_commit,      "event=0xc9,umask=0x2");
> > EVENT_ATTR_STR(tx-abort,        tx_abort,       "event=0xc9,umask=0x4");
> > EVENT_ATTR_STR(tx-capacity,     tx_capacity,    "event=0x54,umask=0x2");
> > EVENT_ATTR_STR(tx-conflict,     tx_conflict,    "event=0x54,umask=0x1");
> > EVENT_ATTR_STR(el-start,        el_start,       "event=0xc8,umask=0x1");
> > EVENT_ATTR_STR(el-commit,       el_commit,      "event=0xc8,umask=0x2");
> > EVENT_ATTR_STR(el-abort,        el_abort,       "event=0xc8,umask=0x4");
> > EVENT_ATTR_STR(el-capacity,     el_capacity,    "event=0x54,umask=0x2");
> > EVENT_ATTR_STR(el-conflict,     el_conflict,    "event=0x54,umask=0x1");
> > EVENT_ATTR_STR(cycles-t,        cycles_t,       "event=0x3c,in_tx=1");
> > EVENT_ATTR_STR(cycles-ct,       cycles_ct,      "event=0x3c,in_tx=1,in_tx_cp=1");
> > 
> > 
> > So s390 can only support tx_commit and tx-abort symbolic names.

In detail, for s390 we have:

cpum_cf/TX_C_TABORT_NO_SPECIAL/
cpum_cf/TX_C_TABORT_SPECIAL/
cpum_cf/TX_C_TEND/
cpum_cf/TX_NC_TABORT/
cpum_cf/TX_NC_TEND/

The mapping of the above is not that easy. As s390 have counters for
non-constraint (TC_NC_*) and contraint (TX_C_*) transaction commits (TEND)
and aborts (TABORTs).

> We could change perf stat to fall back to only tx commit and tx abort.
> We already did that for one limited case.

Displaying these different types for s390 is important from my point of
view.  Of course, I could create a mapping of TX_NC_TABORT/TX_NC_TEND
to tx-commit/tx-abort.  The remaining events would still appear to be specific
to the cpum_cf.

So I would propose to go with adding the cpum_cf/ specific ones first.
If necessary, they could go into the perf/arch/s390/ directory and included
in builtin-stat.  I put a todo on my list to provide at least a
tx-commit/abort for the nonconstraint transactions. (The other would still be
specific).

Kind regards,
  Hendrik

-- 
Hendrik Brueckner
brueckner@linux.vnet.ibm.com      | IBM Deutschland Research & Development GmbH
Linux on z Systems Development    | Schoenaicher Str. 220, 71032 Boeblingen


IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

  reply	other threads:[~2018-03-14 16:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 10:38 [PATCH] perf stat: Add support for s390 transaction counters Thomas Richter
2018-03-12 10:38 ` [PATCH] perf stat: Make function perf_stat_evsel_id_init static Thomas Richter
2018-03-12 15:10   ` Arnaldo Carvalho de Melo
2018-03-20  6:29   ` [tip:perf/core] " tip-bot for Thomas Richter
2018-03-12 15:06 ` [PATCH] perf stat: Add support for s390 transaction counters Arnaldo Carvalho de Melo
2018-03-13  3:23 ` Andi Kleen
2018-03-14  8:34   ` Thomas-Mich Richter
2018-03-14 13:18     ` Arnaldo Carvalho de Melo
2018-03-14 15:03       ` Thomas-Mich Richter
2018-03-14 15:43         ` Andi Kleen
2018-03-14 16:42           ` Hendrik Brueckner [this message]
2018-03-14 17:31             ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180314164236.GB5297@linux.vnet.ibm.com \
    --to=brueckner@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=tmricht@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.