Skip to contentSkip to conversation

What do zeroing of samples in 'perf top' mean ?

DISCUSSION taeung 2 participants 4 messages Sep 30, 2014 – Oct 4, 2014

lore
Share & tools
lore

taeung

author
#0 lore raw

Hi,

I have two questions about 'zeroing of samples' in 'perf top'.

I knew if I use 'perf top', I can see a performance counter profile in real time. But I can't find a difference between 'perf top -a' and 'perf top --zero'.

After 'perf top' is run , I press key 'z' to toggle zeroing of samples. But I don't know a difference between when I press key 'z' and before I did it.

1. What is 'Zero history' ?
(I saw it in Documentation/perf-top.txt that '--zero' option is 'Zero history across display updates.')

2. What do 'zeroing of samples' mean ?

Thanks,
Taeung

#1 lore raw

Hi Taeung,

Quoted 12 lines · taeung

Hi,

I have two questions about 'zeroing of samples' in 'perf top'.

I knew if I use 'perf top', I can see a performance counter profile in real time.
But I can't find a difference between 'perf top -a' and 'perf top --zero'.

After 'perf top' is run , I press key 'z' to toggle zeroing of samples. But I don't know a difference between when I press key 'z' and before I did it.

Quoted 5 lines

1. What is 'Zero history' ?
(I saw it in Documentation/perf-top.txt that '--zero' option is 'Zero history across display updates.')

2. What do 'zeroing of samples' mean ?

It seems that both questions are same.

The way perf top works is collecting samples and cumulate them into the history (with decaying). So it basically shows current value + old value. With -z option, it won't use old values.

And yes, one cannot easily find a difference between -z option and normal output. So we might need a visual cue as Arnaldo suggested earlier. Are you interested in implementing it? :)

Thanks,
Namhyung

author
#2 lore raw
In reply to taeung

Thanks for your answer.

Quoted 23 lines · Namhyung Kim

Hi Taeung,

Quoted 13 lines · taeung

Hi,

I have two questions about 'zeroing of samples' in 'perf top'.

I knew if I use 'perf top', I can see a performance counter profile in real time.
But I can't find a difference between 'perf top -a' and 'perf top --zero'.

After 'perf top' is run , I press key 'z' to toggle zeroing of samples. But I don't know a difference between when I press key 'z' and before I did it.

Quoted 5 lines

1. What is 'Zero history' ?
(I saw it in Documentation/perf-top.txt that '--zero' option is 'Zero history across display updates.')

2. What do 'zeroing of samples' mean ?

It seems that both questions are same.

Quoted 7 lines

The way perf top works is collecting samples and cumulate them into the history (with decaying). So it basically shows current value + old value. With -z option, it won't use old values.

And yes, one cannot easily find a difference between -z option and normal output. So we might need a visual cue as Arnaldo suggested earlier. Are you interested in implementing it?

Yes , I really wanna implement it
to easily find a difference between -z option and default option.

At last, I understand what -z option mean.

As what Arnaldo suggested , I'll implement it.

Thanks,
Taeung

#3 lore raw

Hi,

I sent patch file about a visual cue for toggle zeroing of samples in pert top.

To know whether it is with -z option in a function hists__browser_title(), I add a argument 'struct hist_browser_timer *hbt' in the function.

The cause is 'hbt' can get current value of 'pert_top.zero' and know whether it is 'report' or 'top'.

Does it look good ?

Thanks,
Taeung

Quoted 39 lines · taeung

Thanks for your answer.

Quoted 22 lines · Namhyung Kim

Hi Taeung,

Quoted 12 lines · taeung

Hi,

I have two questions about 'zeroing of samples' in 'perf top'.

I knew if I use 'perf top', I can see a performance counter profile in real time.
But I can't find a difference between 'perf top -a' and 'perf top --zero'.

After 'perf top' is run , I press key 'z' to toggle zeroing of samples. But I don't know a difference between when I press key 'z' and before I did it.

Quoted 5 lines

1. What is 'Zero history' ?
(I saw it in Documentation/perf-top.txt that '--zero' option is 'Zero history across display updates.')

2. What do 'zeroing of samples' mean ?

It seems that both questions are same.

Quoted 7 lines

The way perf top works is collecting samples and cumulate them into the history (with decaying). So it basically shows current value + old value. With -z option, it won't use old values.

And yes, one cannot easily find a difference between -z option and normal output. So we might need a visual cue as Arnaldo suggested earlier. Are you interested in implementing it?

Yes , I really wanna implement it
to easily find a difference between -z option and default option.

At last, I understand what -z option mean.

As what Arnaldo suggested , I'll implement it.