Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1205131
| From | Jiri Olsa <jolsa@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events |
| Date | 2015-08-11 15:30 +0200 |
| Message-ID | <pWhMR-6mR-1@gated-at.bofh.it> (permalink) |
| References | <pV0O5-fI-7@gated-at.bofh.it> <pV0O7-fI-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Aug 07, 2015 at 06:06:18PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> TopDown needs to multiply events by constants (for example
> the CPU Pipeline Width) to get the correct results.
> The kernel needs to export this factor.
>
> Today *.scale is only used to scale down metrics (divide), for example
> to scale bytes to MB.
>
> Repurpose negative scale to mean scaling up, that is multiplying.
> Implement the code for this in perf stat.
>
> Signed-off-by: Andi Kleen <ak@linux.intel.com>
> ---
> tools/perf/builtin-stat.c | 27 +++++++++++++++++++--------
> 1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> index ea5298a..2590c75 100644
> --- a/tools/perf/builtin-stat.c
> +++ b/tools/perf/builtin-stat.c
> @@ -179,6 +179,17 @@ static inline int nsec_counter(struct perf_evsel *evsel)
> return 0;
> }
>
> +static double scale_val(struct perf_evsel *counter, u64 val)
> +{
> + double uval = val;
> +
> + if (counter->scale < 0)
> + uval = val * (-counter->scale);
> + else if (counter->scale)
> + uval = val / counter->scale;
hum, do you change the scale logic? the current scale > 0 works like:
uval = val * counter->scale;
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Add top down metrics to perf stat Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
[PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Jiri Olsa <jolsa@redhat.com> - 2015-08-11 15:10 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Andi Kleen <ak@linux.intel.com> - 2015-08-11 15:20 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Jiri Olsa <jolsa@redhat.com> - 2015-08-11 15:30 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Andi Kleen <ak@linux.intel.com> - 2015-08-11 15:50 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Jiri Olsa <jolsa@redhat.com> - 2015-08-11 16:40 +0200
Re: [PATCH 1/9] perf, tools: Dont stop PMU parsing on alias parse error Andi Kleen <andi@firstfloor.org> - 2015-08-11 19:00 +0200
[PATCH 7/9] x86, perf: Add Top Down events to Intel Atom Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
[PATCH 3/9] perf, tools, stat: Basic support for TopDown in perf stat Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
[PATCH 2/9] perf, tools, stat: Support up-scaling of events Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Jiri Olsa <jolsa@redhat.com> - 2015-08-11 15:30 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Andi Kleen <ak@linux.intel.com> - 2015-08-11 15:40 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Jiri Olsa <jolsa@redhat.com> - 2015-08-11 16:00 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Andi Kleen <andi@firstfloor.org> - 2015-08-11 19:10 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Jiri Olsa <jolsa@redhat.com> - 2015-08-11 19:20 +0200
Re: [PATCH 2/9] perf, tools, stat: Support up-scaling of events Andi Kleen <andi@firstfloor.org> - 2015-08-11 19:20 +0200
[PATCH 5/9] x86, perf: Support sysfs files depending on SMT status Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
[PATCH 6/9] x86, perf: Add Top Down events to Intel Core Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
[PATCH 8/9] perf, tools, stat: Add extra output of counter values with -v Andi Kleen <andi@firstfloor.org> - 2015-08-08 03:10 +0200
csiph-web