linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* metric expressions including metrics?
@ 2020-05-18 19:12 Paul A. Clarke
  2020-05-18 19:20 ` Jiri Olsa
  0 siblings, 1 reply; 3+ messages in thread
From: Paul A. Clarke @ 2020-05-18 19:12 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	Kajol Jain, Andi Kleen, John Garry, Jin Yao, Kan Liang,
	Cong Wang, Kim Phillips, Adrian Hunter, Leo Yan, linux-kernel,
	netdev, bpf, Stephane Eranian, Arnaldo Carvalho de Melo

I'm curious how hard it would be to define metrics using other metrics,
in the metrics definition files.

Currently, to my understanding, every metric definition must be an
expresssion based solely on arithmetic combinations of hardware events.

Some metrics are hierarchical in nature such that a higher-level metric
can be defined as an arithmetic expression of two other metrics, e.g.

cache_miss_cycles_per_instruction =
  data_cache_miss_cycles_per_instruction +
  instruction_cache_miss_cycles_per_instruction

This would need to be defined something like:
dcache_miss_cpi = "dcache_miss_cycles / instructions"
icache_miss_cpi = "icache_miss_cycles / instructions"
cache_miss_cpi = "(dcache_miss_cycles + icache_miss_cycles) / instructions"

Could the latter definition be simplified to:
cache_miss_cpi = "dcache_miss_cpi + icache_miss_cpi"

With multi-level caches and NUMA hierarchies, some of these higher-level
metrics can involve a lot of hardware events.

Given the recent activity in this area, I'm curious if this has been
considered and already on a wish/to-do list, or found onerous.

Regards,
Paul Clarke

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: metric expressions including metrics?
  2020-05-18 19:12 metric expressions including metrics? Paul A. Clarke
@ 2020-05-18 19:20 ` Jiri Olsa
  2020-05-18 19:24   ` Stephane Eranian
  0 siblings, 1 reply; 3+ messages in thread
From: Jiri Olsa @ 2020-05-18 19:20 UTC (permalink / raw)
  To: Paul A. Clarke
  Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Namhyung Kim, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Kajol Jain, Andi Kleen, John Garry,
	Jin Yao, Kan Liang, Cong Wang, Kim Phillips, Adrian Hunter,
	Leo Yan, linux-kernel, netdev, bpf, Stephane Eranian,
	Arnaldo Carvalho de Melo

On Mon, May 18, 2020 at 02:12:42PM -0500, Paul A. Clarke wrote:
> I'm curious how hard it would be to define metrics using other metrics,
> in the metrics definition files.
> 
> Currently, to my understanding, every metric definition must be an
> expresssion based solely on arithmetic combinations of hardware events.
> 
> Some metrics are hierarchical in nature such that a higher-level metric
> can be defined as an arithmetic expression of two other metrics, e.g.
> 
> cache_miss_cycles_per_instruction =
>   data_cache_miss_cycles_per_instruction +
>   instruction_cache_miss_cycles_per_instruction
> 
> This would need to be defined something like:
> dcache_miss_cpi = "dcache_miss_cycles / instructions"
> icache_miss_cpi = "icache_miss_cycles / instructions"
> cache_miss_cpi = "(dcache_miss_cycles + icache_miss_cycles) / instructions"
> 
> Could the latter definition be simplified to:
> cache_miss_cpi = "dcache_miss_cpi + icache_miss_cpi"
> 
> With multi-level caches and NUMA hierarchies, some of these higher-level
> metrics can involve a lot of hardware events.
> 
> Given the recent activity in this area, I'm curious if this has been
> considered and already on a wish/to-do list, or found onerous.

hi,
actually we were discussing this with Ian and Stephane and I plan on
checking on that.. should be doable, I'll keep you in the loop

jirka

> 
> Regards,
> Paul Clarke
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: metric expressions including metrics?
  2020-05-18 19:20 ` Jiri Olsa
@ 2020-05-18 19:24   ` Stephane Eranian
  0 siblings, 0 replies; 3+ messages in thread
From: Stephane Eranian @ 2020-05-18 19:24 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Paul A. Clarke, Ian Rogers, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Namhyung Kim, Alexei Starovoitov, Daniel Borkmann,
	Martin KaFai Lau, Song Liu, Yonghong Song, Andrii Nakryiko,
	John Fastabend, KP Singh, Kajol Jain, Andi Kleen, John Garry,
	Jin Yao, Kan Liang, Cong Wang, Kim Phillips, Adrian Hunter,
	Leo Yan, LKML, netdev, bpf, Arnaldo Carvalho de Melo

On Mon, May 18, 2020 at 12:21 PM Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Mon, May 18, 2020 at 02:12:42PM -0500, Paul A. Clarke wrote:
> > I'm curious how hard it would be to define metrics using other metrics,
> > in the metrics definition files.
> >
> > Currently, to my understanding, every metric definition must be an
> > expresssion based solely on arithmetic combinations of hardware events.
> >
> > Some metrics are hierarchical in nature such that a higher-level metric
> > can be defined as an arithmetic expression of two other metrics, e.g.
> >
> > cache_miss_cycles_per_instruction =
> >   data_cache_miss_cycles_per_instruction +
> >   instruction_cache_miss_cycles_per_instruction
> >
> > This would need to be defined something like:
> > dcache_miss_cpi = "dcache_miss_cycles / instructions"
> > icache_miss_cpi = "icache_miss_cycles / instructions"
> > cache_miss_cpi = "(dcache_miss_cycles + icache_miss_cycles) / instructions"
> >
> > Could the latter definition be simplified to:
> > cache_miss_cpi = "dcache_miss_cpi + icache_miss_cpi"
> >
> > With multi-level caches and NUMA hierarchies, some of these higher-level
> > metrics can involve a lot of hardware events.
> >
> > Given the recent activity in this area, I'm curious if this has been
> > considered and already on a wish/to-do list, or found onerous.
>
> hi,
> actually we were discussing this with Ian and Stephane and I plan on
> checking on that.. should be doable, I'll keep you in the loop
>
Yes, this is needed to minimize the number of events needed to compute
metrics groups.
Then across all metrics groups, event duplicates must be eliminated
whenever possible, except when explicit event grouping is required.

>
> jirk
>
> a
>
> >
> > Regards,
> > Paul Clarke
> >
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-18 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-18 19:12 metric expressions including metrics? Paul A. Clarke
2020-05-18 19:20 ` Jiri Olsa
2020-05-18 19:24   ` Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).