Skip to contentSkip to conversation

perf top -z not working?

DISCUSSION Ryan Johnson 5 participants 13 messages Oct 17, 2012 – Oct 23, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

(Please CC me in replies, not a list member)

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Have I misunderstood this feature, or is this a bug that has perhaps been fixed in later kernel versions? I haven't been successful searching for information about it, beyond the man pages and what the perf wiki says.

Thanks,
Ryan

#1 lore raw

2012-10-17 오후 9:26, Ryan Johnson 쓴 글:

Quoted 5 lines

Hi,

(Please CC me in replies, not a list member)

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

My kernel version is 3.0.0 (ubuntu 11.10).
Mine seems to work well. The result was not the accumulated one, definitely.

In my opinion, it is a buf in the perf tool in that kernel version.

Quoted 11 lines

Have I misunderstood this feature, or is this a bug that has perhaps been fixed in later kernel versions? I haven't been successful searching for information about it, beyond the man pages and what the perf wiki says.

Thanks,
Ryan

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
#2 lore raw

Em Wed, Oct 17, 2012 at 10:49:42PM +0900, Chulmin Kim escreveu:

Quoted 10 lines

2012-10-17 오후 9:26, Ryan Johnson 쓴 글:

Quoted 9 lines

(Please CC me in replies, not a list member)

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

- Arnaldo

#3 lore raw
Quoted 11 lines · Arnaldo Carvalho de Melo

Em Wed, Oct 17, 2012 at 10:49:42PM +0900, Chulmin Kim escreveu:

Quoted 10 lines

2012-10-17 오후 9:26, Ryan Johnson 쓴 글:

Quoted 9 lines

(Please CC me in replies, not a list member)

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Quoted 2 lines

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

Thanks,
Ryan

#4 lore raw
Quoted 11 lines · Ryan Johnson
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

David

#5 lore raw
Quoted 13 lines · David Ahern
Quoted 11 lines · Ryan Johnson
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

Quoted 8 lines

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

Chulmin says his 3.0 version works. My 3.2.18 doesn't. I don't have a copy of the git tree on that machine, but I'll try building 3.4.x and tip when I get a chance. I have never built perf-tools before, though, so I'd appreciate tips on what might be different for building perf-tools compared to the kernel, and how to avoid building the standard kernel along the way. Hopefully it's just configure-make-install?

Regards,
Ryan

#6 lore raw

2012-10-22 오후 11:10, Ryan Johnson 쓴 글:

Quoted 16 lines · David Ahern
Quoted 15 lines · Ryan Johnson
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

Quoted 8 lines
Quoted 6 lines
    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

Chulmin says his 3.0 version works. My 3.2.18 doesn't. I don't have a copy of the git tree on that machine, but I'll try building 3.4.x and tip when I get a chance. I have never built perf-tools before, though, so I'd appreciate tips on what might be different for building perf-tools compared to the kernel, and how to avoid building the standard kernel along the way. Hopefully it's just configure-make-install?

How about checking your "top" version first?

According to David's suggestion, it is the matter of top version.

Mine was 3.2.8. (top --version).

Quoted 3 lines

Regards,
Ryan

#7 lore raw

2012-10-22 오후 11:13, Chulmin Kim 쓴 글:

Quoted 37 lines

2012-10-22 오후 11:10, Ryan Johnson 쓴 글:

Quoted 27 lines · David Ahern
Quoted 18 lines · Ryan Johnson
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Quoted 5 lines
Quoted 3 lines

Are you using the --tui or --stdio interface? Try with both and check if
it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

Quoted 8 lines
    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

Quoted 8 lines

Chulmin says his 3.0 version works. My 3.2.18 doesn't. I don't have a copy of the git tree on that machine, but I'll try building 3.4.x and tip when I get a chance. I have never built perf-tools before, though, so I'd appreciate tips on what might be different for building perf-tools compared to the kernel, and how to avoid building the standard kernel along the way. Hopefully it's just configure-make-install?

Quoted 7 lines

How about checking your "top" version first?

According to David's suggestion, it is the matter of top version.

Mine was 3.2.8. (top --version).

Forget this message. My misunderstanding. :)

Quoted 5 lines
Quoted 5 lines

Regards,
Ryan

#8 lore raw
In reply to Ryan Johnson

Em Mon, Oct 22, 2012 at 10:10:25AM -0400, Ryan Johnson escreveu:

Quoted 14 lines · David Ahern
Quoted 9 lines

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

   if (top->zero)
       symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
   else
       symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);
Quoted 4 lines

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

Quoted 7 lines

Chulmin says his 3.0 version works. My 3.2.18 doesn't. I don't have a copy of the git tree on that machine, but I'll try building 3.4.x and tip when I get a chance. I have never built perf-tools before, though, so I'd appreciate tips on what might be different for building perf-tools compared to the kernel, and how to avoid building the standard kernel along the way. Hopefully it's just configure-make-install?

To build just the tools, on a /usr/src/linux or wherever you have the newer kernel sources:

make -C tools/perf install

Then make sure you use what is in your ~/bin/ before the standard path:

export PATH=~/bin:$PATH
hash -r

Then try perf top -z again.

- Arnaldo

#9 lore raw

On 10/22/12 8:45 AM, Arnaldo Carvalho de Melo wrote:

To add to Arnaldo's instructions, here's how to get a copy of his tree:

mkdir perf.git
cd perf.git

git init
git add remote acme git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
git remote update

git checkout remotes/acme/perf/core
mkdir /tmp/pbuild
make -C tools/perf O=/tmp/pbuild
/tmp/pbuild/perf top -z

To try out a different version:
git checkout v3.0
make -C tools/perf

or v3.2, v3.4, etc.

Building perf is fairly quick and you do not have to install them -- just run the built binary.

Quoted 15 lines

To build just the tools, on a /usr/src/linux or wherever you have the newer kernel sources:

make -C tools/perf install

Then make sure you use what is in your ~/bin/ before the standard path:

export PATH=~/bin:$PATH
hash -r

Then try perf top -z again.

- Arnaldo

#10 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 25 lines · Arnaldo Carvalho de Melo

Em Mon, Oct 22, 2012 at 10:10:25AM -0400, Ryan Johnson escreveu:

Quoted 14 lines · David Ahern
Quoted 9 lines

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);
Quoted 4 lines

I recall it working recently - last year or so. Can you try different versions -- say 3.0, 3.2, 3.4 and latest? If you have a copy of Linus' tree or Arnaldo's git tree it should not take much time.

Quoted 7 lines

Chulmin says his 3.0 version works. My 3.2.18 doesn't. I don't have a copy of the git tree on that machine, but I'll try building 3.4.x and tip when I get a chance. I have never built perf-tools before, though, so I'd appreciate tips on what might be different for building perf-tools compared to the kernel, and how to avoid building the standard kernel along the way. Hopefully it's just configure-make-install?

To build just the tools, on a /usr/src/linux or wherever you have the newer kernel sources:

Quoted 8 lines

make -C tools/perf install

Then make sure you use what is in your ~/bin/ before the standard path:

export PATH=~/bin:$PATH
hash -r

Then try perf top -z again.

OK! That doesn't sound bad at all.

Thanks,
Ryan

#11 lore raw
In reply to David Ahern
Quoted 13 lines · David Ahern
Quoted 11 lines · Ryan Johnson
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines

It seems that `perf top -z' does not behave as advertized, at least not on the 3.2.0-25 kernel (Ubuntu) that I'm running. The man page states that it should "zero history across display updates" but the counts still seem to accumulate (the total samples reported rises monotonically) and processes still show up in the display long after they have exited. Pressing z' or Z' seems to have no effect, either.

Are you using the --tui or --stdio interface? Try with both and check if it works in one of them, I bet the problem is with --tui.

--stdio does the same, so I'll have to try updating my kernel like Chulmin suggested (haven't had time to do that yet)

Quoted 8 lines

The kernel has nothing to do with the feature. From builtin-top.c, this part is either not happening or more likely not happening correctly.

    if (top->zero)
        symbol__annotate_zero_histogram(symbol, top->sym_evsel->idx);
    else
        symbol__annotate_decay_histogram(symbol, top->sym_evsel->idx);

Why symbol__annotate_zero_histogram only? AFAICS it only zeros sym_hist not hist_entry so meaningful just for annotation, right?

Anyway, it's called iff top->sym_filter_entry is set. Not sure what's the intended behavior of the -z switch..

Thanks,
Namhyung

#12 lore raw

took a minute to bisect it this morning:

$ git bisect good
ab81f3fd350c510730adb1ca40ef55c2b2952121 is the first bad commit
commit ab81f3fd350c510730adb1ca40ef55c2b2952121
Author: Arnaldo Carvalho de Melo <[email protected]>
Date:   Wed Oct 5 19:16:15 2011 -0300

perf top: Reuse the 'report' hist_entry/hists classes

This actually fixes several problems we had in the old 'perf top':

1. Unresolved symbols not show, limitation that came from the old "KernelTop" codebase, to solve it we would need to do changes that would make sym_entry have most of the hist_entry fields.
2. It was using the number of samples, not the sum of sample->period.

And brings the --sort code that allows us to have all the views in 'perf report', for instance: