On Wed, Jan 16, 2013 at 09:00:07AM -0500, Ulrich Drepper wrote:
> On Tue, Jan 15, 2013 at 8:39 AM, Jiri Olsa <jo...@redhat.com> wrote:
> >   $ perf stat -f formula.conf:cpi kill
> >   usage: kill [ -s signal | -p ] [ -a ] pid ...
> >          kill -l [ signal ]
> 
> I do like this proposal.  The only comment I have is that perhaps the
> command line syntax isn't ideal.  What you use above is tied to the
> ratios be defined in the config file.  I would imagine that at least
> over time (for some ratios probably right away) they become available
> by default and don't require a config file.  Also, users might want to
> put individualized ratio definitions in a config file which is read by
> default.
> 
> How about the formulas becoming available whenever the config file is
> read.  Maybe this means a few more keywords in the config file (ratio,
> ratio-set, ...).  E.g.:
> 
> ratio-set branch {
>           events = {instructions,branch-instructions,branch-misses}:u
> 
>           ratio branch-rate {
>                   formula = branch-instructions / instructions
>                   desc = branch rate
>           }
> 
>           ratio branch-miss-rate {
>                   formula = branch-misses / instructions
>                   desc = branch misprediction rate
>           }
> 
>           ratio branch-miss-ratio{
>                   formula = branch-misses / branch-instructions
>                   desc = branch misprediction ratio
>           }
>   }

I was thinking having config files (global and arch specific)
comming with perf having predefined formulas.

Plus adding the possibility to load extra config file via command
line option.

> 
> You get the idea.  Maybe substitute "ratio":with "formula". Then allow
> such a ratio/formula to be used just like a normal event, perhaps with
> a special suffix/prefix to designate it.  This should then also mark

I like the idea of having ratios handled within event definitions
maybe even in a similar way like aliases are handled today.. like:

1)  -e 'ratio/branch-rate/'  # special event class
2)  -e 'ratio-branch-rate'   # 'ratio-' prefix
3)  -e cpu/branch-rate/      # handled like aliases, ratio name would need to 
be unique 
  ... ?

ideas?

Having both 2) with 3) seems good to me

> the events as part of a group so that the underlying counters are
> scheduled in together.

the 'events' definitions could be put into group by default,
meanwhile I used 'events = { ... }'

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to