lkml.org 
[lkml]   [2013]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] perf, tools: Add perf stat --transaction v3
> > +/* Default events used for perf stat -T */
> > +static const char * const transaction_attrs[] = {
> > + "task-clock",
> > + "{"
> > + "instructions,"
> > + "cycles,"
> > + "cpu/cycles-t/,"
> > + "cpu/tx-start/,"
> > + "cpu/el-start/,"
> > + "cpu/cycles-ct/"
> > + "}"
> > +};
> > +
> > +/* More limited version when the CPU does not have all events. */
> > +static const char * const transaction_limited_attrs[] = {
> > + "task-clock",
> > + "{"
> > + "instructions,"
> > + "cycles,"
> > + "cpu/cycles-t/,"
> > + "cpu/tx-start/"
> > + "}"
> > +};
> > +
> > +/* must match the transaction_attrs above */
>
> Match in what way? It kinda matches the first one (transaction_attrs):

The second is just the beginning of the first.

The { } don't count for matches.

For the limited run the comparisons of the elements that are not there
fail.

>
> enum {
> T_TASK_CLOCK, == "task-clock",
> T_INSTRUCTIONS, == "instructions,"
> T_CYCLES, == "cycles,"
> T_CYCLES_IN_TX, ~= "cpu/cycles-t/,"
> T_TRANSACTION_START, != "cpu/tx-start/,"
> T_ELISION_START, ~= "cpu/el-start/,"
> T_CYCLES_IN_TX_CP, != "cpu/cycles-ct/"
> };

I did a quick test of the fallback path by manually disabling the events,
and it seemed to work, but it's really for POWER based on Michael E's feedback.

>
> Also the enum numbers won't match the array positions due to the '{'
> grouping (?) entries, so, without looking further, how can this match?
> Reading on...

The match is on the result array. The results don't contain the { }
as individual elements.

Anyways I use this option pretty heavily and the results are good
to my knowledge.

-Andi



\
 
 \ /
  Last update: 2013-08-15 16:21    [W:0.113 / U:0.976 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site