2015-02-11 19:03:01

by Vince Weaver

[permalink] [raw]
Subject: [patch] perf_event_open.2: Exclude_host/exclude_guest clarification


This patch relates to the exclude_host and exclude_guest bits added
by the following commit:

exclude_host, exclude_guest; Linux 3.2
commit a240f76165e6255384d4bdb8139895fac7988799
Author: Joerg Roedel <[email protected]>
Date: Wed Oct 5 14:01:16 2011 +0200

perf, core: Introduce attrs to count in either host or guest mode

Signed-off-by: Joerg Roedel <[email protected]>
Signed-off-by: Gleb Natapov <[email protected]>
Signed-off-by: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>

The updated manpage text clarifies that the "exclude_host" and
"exclude_guest" perf_event_open() attr bits only apply in the
context of a KVM environment and are currently x86 only.

This is a resend of the patch; the previous time I sent it
(http://thread.gmane.org/gmane.linux.man/7500) it did not
receive any comments.

Signed-off-by: Vince Weaver <[email protected]>

diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
index 39c8d8c..1ea56c9 100644
--- a/man2/perf_event_open.2
+++ b/man2/perf_event_open.2
@@ -1006,11 +1006,25 @@ struct sample_id {
.TP
.IR "exclude_host" " (since Linux 3.2)"
.\" commit a240f76165e6255384d4bdb8139895fac7988799
-Do not measure time spent in VM host.
+When conducting measurements that include processes running
+VM instances (i.e. have executed a
+.I KVM_RUN
+.BR ioctl (2)
+) only measure events happening inside a guest instance.
+This is only meaningful outside the guests; this setting does
+not change counts gathered inside of a guest.
+Currently this functionality is x86 only.
.TP
.IR "exclude_guest" " (since Linux 3.2)"
.\" commit a240f76165e6255384d4bdb8139895fac7988799
-Do not measure time spent in VM guest.
+When conducting measurements that include processes running
+VM instances (i.e. have executed a
+.I KVM_RUN
+.BR ioctl (2)
+) do not measure events happening inside guest instances.
+This is only meaningful outside the guests; this setting does
+not change counts gathered inside of a guest.
+Currently this functionality is x86 only.
.TP
.IR "exclude_callchain_kernel" " (since Linux 3.7)"
.\" commit d077526485d5c9b12fe85d0b2b3b7041e6bc5f91


Subject: Re: [patch] perf_event_open.2: Exclude_host/exclude_guest clarification

Hi Joerg,

Would you be willing to review/comment on Vince's patch, please.

Cheers,

Michael

On 02/11/2015 08:06 PM, Vince Weaver wrote:
>
> This patch relates to the exclude_host and exclude_guest bits added
> by the following commit:
>
> exclude_host, exclude_guest; Linux 3.2
> commit a240f76165e6255384d4bdb8139895fac7988799
> Author: Joerg Roedel <[email protected]>
> Date: Wed Oct 5 14:01:16 2011 +0200
>
> perf, core: Introduce attrs to count in either host or guest mode
>
> Signed-off-by: Joerg Roedel <[email protected]>
> Signed-off-by: Gleb Natapov <[email protected]>
> Signed-off-by: Peter Zijlstra <[email protected]>
> Link: http://lkml.kernel.org/r/[email protected]
> Signed-off-by: Ingo Molnar <[email protected]>
>
> The updated manpage text clarifies that the "exclude_host" and
> "exclude_guest" perf_event_open() attr bits only apply in the
> context of a KVM environment and are currently x86 only.
>
> This is a resend of the patch; the previous time I sent it
> (http://thread.gmane.org/gmane.linux.man/7500) it did not
> receive any comments.
>
> Signed-off-by: Vince Weaver <[email protected]>
>
> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
> index 39c8d8c..1ea56c9 100644
> --- a/man2/perf_event_open.2
> +++ b/man2/perf_event_open.2
> @@ -1006,11 +1006,25 @@ struct sample_id {
> .TP
> .IR "exclude_host" " (since Linux 3.2)"
> .\" commit a240f76165e6255384d4bdb8139895fac7988799
> -Do not measure time spent in VM host.
> +When conducting measurements that include processes running
> +VM instances (i.e. have executed a
> +.I KVM_RUN
> +.BR ioctl (2)
> +) only measure events happening inside a guest instance.
> +This is only meaningful outside the guests; this setting does
> +not change counts gathered inside of a guest.
> +Currently this functionality is x86 only.
> .TP
> .IR "exclude_guest" " (since Linux 3.2)"
> .\" commit a240f76165e6255384d4bdb8139895fac7988799
> -Do not measure time spent in VM guest.
> +When conducting measurements that include processes running
> +VM instances (i.e. have executed a
> +.I KVM_RUN
> +.BR ioctl (2)
> +) do not measure events happening inside guest instances.
> +This is only meaningful outside the guests; this setting does
> +not change counts gathered inside of a guest.
> +Currently this functionality is x86 only.
> .TP
> .IR "exclude_callchain_kernel" " (since Linux 3.7)"
> .\" commit d077526485d5c9b12fe85d0b2b3b7041e6bc5f91
>


--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Subject: Re: [patch] perf_event_open.2: Exclude_host/exclude_guest clarification

Hello Joerg,

Ping!

Cheers,

Michael

On 02/17/2015 06:32 AM, Michael Kerrisk (man-pages) wrote:
> Hi Joerg,
>
> Would you be willing to review/comment on Vince's patch, please.
>
> Cheers,
>
> Michael
>
> On 02/11/2015 08:06 PM, Vince Weaver wrote:
>>
>> This patch relates to the exclude_host and exclude_guest bits added
>> by the following commit:
>>
>> exclude_host, exclude_guest; Linux 3.2
>> commit a240f76165e6255384d4bdb8139895fac7988799
>> Author: Joerg Roedel <[email protected]>
>> Date: Wed Oct 5 14:01:16 2011 +0200
>>
>> perf, core: Introduce attrs to count in either host or guest mode
>>
>> Signed-off-by: Joerg Roedel <[email protected]>
>> Signed-off-by: Gleb Natapov <[email protected]>
>> Signed-off-by: Peter Zijlstra <[email protected]>
>> Link: http://lkml.kernel.org/r/[email protected]
>> Signed-off-by: Ingo Molnar <[email protected]>
>>
>> The updated manpage text clarifies that the "exclude_host" and
>> "exclude_guest" perf_event_open() attr bits only apply in the
>> context of a KVM environment and are currently x86 only.
>>
>> This is a resend of the patch; the previous time I sent it
>> (http://thread.gmane.org/gmane.linux.man/7500) it did not
>> receive any comments.
>>
>> Signed-off-by: Vince Weaver <[email protected]>
>>
>> diff --git a/man2/perf_event_open.2 b/man2/perf_event_open.2
>> index 39c8d8c..1ea56c9 100644
>> --- a/man2/perf_event_open.2
>> +++ b/man2/perf_event_open.2
>> @@ -1006,11 +1006,25 @@ struct sample_id {
>> .TP
>> .IR "exclude_host" " (since Linux 3.2)"
>> .\" commit a240f76165e6255384d4bdb8139895fac7988799
>> -Do not measure time spent in VM host.
>> +When conducting measurements that include processes running
>> +VM instances (i.e. have executed a
>> +.I KVM_RUN
>> +.BR ioctl (2)
>> +) only measure events happening inside a guest instance.
>> +This is only meaningful outside the guests; this setting does
>> +not change counts gathered inside of a guest.
>> +Currently this functionality is x86 only.
>> .TP
>> .IR "exclude_guest" " (since Linux 3.2)"
>> .\" commit a240f76165e6255384d4bdb8139895fac7988799
>> -Do not measure time spent in VM guest.
>> +When conducting measurements that include processes running
>> +VM instances (i.e. have executed a
>> +.I KVM_RUN
>> +.BR ioctl (2)
>> +) do not measure events happening inside guest instances.
>> +This is only meaningful outside the guests; this setting does
>> +not change counts gathered inside of a guest.
>> +Currently this functionality is x86 only.
>> .TP
>> .IR "exclude_callchain_kernel" " (since Linux 3.7)"
>> .\" commit d077526485d5c9b12fe85d0b2b3b7041e6bc5f91
>>
>
>


--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/