Re: [GIT PULL] perf changes for v3.8

From: David Ahern
Date: Thu Dec 13 2012 - 12:30:40 EST


On 12/13/12 10:02 AM, Linus Torvalds wrote:

From your response to Ingo I take it you looked into other cases. I'll summarize here to make sure we are on the same page:

1. guest only profiling from the host
perf {record|top} -e cycles:G

2. host only profiling
perf {record|top} -e cycles:H

These are 4 existing use cases that toggle exclude_guest and do work today for those who care. Not the lack of precise attribute on the commands. These are the existing use cases that break by inverting the logic in the kernel.

The problem child is perf record -e cycles:ppG. That command silently crashes running VMs. You don't get a pop up or message that says "Dave, you crashed your VMs running perf". You don't notice the VMs have crashed until you attempt to login or what have you.

So how many perf users are having weird VM crashes? I don't know. I just happened to:

1. not use libbvirt
2. have a running VM with console messages kicked to ttyS0
3. ttyS0 connected to stdio
4. screen session with a running VM open

at the time I ran perf.


Btw, I do *not* think that you should necessariyl default to 'H' for
host-only mode.

The change made to perf userspace was to set exclude_guest IF precise is requested AND GH have not been specified.


The way it should work is that ":pp", ":ppH" and ":ppV" are all different.

- "cycles:ppH" means: I want precise cycles only for the host case

- "cycles:ppV" means: I want precise cycles, and I want the VM too

This would result in EOPNOTSUPP for the case we know is buggy (but
presumably work on some other CPUs that don't have the problem)

- "cycles:pp" is "I want precise cycles, and I don't care about virtualization"

yes, this is the case I handled within perf userspace.

And then there is the whole 'perf kvm {top|record}' twists to the perf code.

David

--
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/