Re: [RFC 0/4] perf tool: Adding ratios support

From: Ulrich Drepper
Date: Wed Jan 16 2013 - 09:00:19 EST


On Tue, Jan 15, 2013 at 8:39 AM, Jiri Olsa <jolsa@xxxxxxxxxx> 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
}
}

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
the events as part of a group so that the underlying counters are
scheduled in together.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/