[lttng-dev] [PATCH lttng-modules 1/1] Add new tracepoint in KVM.

Simon Marchi simon.marchi at polymtl.ca
Thu Oct 3 11:39:33 EDT 2013


Hi Mohamad,

Since this tracepoint was not present in previous kernel versions, I
think you should use ifdefs to enable the tracepoint only for the
versions that have it. Grep for LINUX_VERSION_CODE in the other files.

Simon

On 3 October 2013 00:11, Mohamad Gebai <mohamad.gebai at gmail.com> wrote:
> New tracepoint added in kvm: kvm_write_tsc_offset.
>
> Signed-off-by: Mohamad Gebai <mohamad.gebai at polymtl.ca>
> ---
>  .../events/lttng-module/arch/x86/kvm/trace.h       |   21 ++++++++++++++++++++
>  .../events/mainline/arch/x86/kvm/trace.h           |   21 ++++++++++++++++++++
>  2 files changed, 42 insertions(+)
>
> diff --git a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
> index 8e71a7f..0823a9d 100644
> --- a/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
> +++ b/instrumentation/events/lttng-module/arch/x86/kvm/trace.h
> @@ -761,6 +761,27 @@ TRACE_EVENT(
>                   __entry->gpa_match ? "GPA" : "GVA")
>  )
>
> +TRACE_EVENT(kvm_write_tsc_offset,
> +       TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset,
> +                __u64 next_tsc_offset),
> +       TP_ARGS(vcpu_id, previous_tsc_offset, next_tsc_offset),
> +
> +       TP_STRUCT__entry(
> +               __field( unsigned int,  vcpu_id                         )
> +               __field(        __u64,  previous_tsc_offset             )
> +               __field(        __u64,  next_tsc_offset                 )
> +       ),
> +
> +       TP_fast_assign(
> +               tp_assign(vcpu_id, vcpu_id)
> +               tp_assign(previous_tsc_offset, previous_tsc_offset)
> +               tp_assign(next_tsc_offset, next_tsc_offset)
> +       ),
> +
> +       TP_printk("vcpu=%u prev=%llu next=%llu", __entry->vcpu_id,
> +                 __entry->previous_tsc_offset, __entry->next_tsc_offset)
> +)
> +
>  #ifdef CONFIG_X86_64
>
>  #define host_clocks                                    \
> diff --git a/instrumentation/events/mainline/arch/x86/kvm/trace.h b/instrumentation/events/mainline/arch/x86/kvm/trace.h
> index fe5e00e..545245d 100644
> --- a/instrumentation/events/mainline/arch/x86/kvm/trace.h
> +++ b/instrumentation/events/mainline/arch/x86/kvm/trace.h
> @@ -756,6 +756,27 @@ TRACE_EVENT(
>                   __entry->gpa_match ? "GPA" : "GVA")
>  );
>
> +TRACE_EVENT(kvm_write_tsc_offset,
> +       TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset,
> +                __u64 next_tsc_offset),
> +       TP_ARGS(vcpu_id, previous_tsc_offset, next_tsc_offset),
> +
> +       TP_STRUCT__entry(
> +               __field( unsigned int,  vcpu_id                         )
> +               __field(        __u64,  previous_tsc_offset             )
> +               __field(        __u64,  next_tsc_offset                 )
> +       ),
> +
> +       TP_fast_assign(
> +               __entry->vcpu_id                = vcpu_id;
> +               __entry->previous_tsc_offset    = previous_tsc_offset;
> +               __entry->next_tsc_offset        = next_tsc_offset;
> +       ),
> +
> +       TP_printk("vcpu=%u prev=%llu next=%llu", __entry->vcpu_id,
> +                 __entry->previous_tsc_offset, __entry->next_tsc_offset)
> +);
> +
>  #ifdef CONFIG_X86_64
>
>  #define host_clocks                                    \
> --
> 1.7.10.4
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev



More information about the lttng-dev mailing list