[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/5] Implement code to read coverage informations



> diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
> index 3225b2a..5e80400 100644
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -596,6 +596,42 @@ struct xen_sysctl_scheduler_op {
>  typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
>  
> +/* XEN_SYSCTL_coverage_op */
> +/*
> + * Check if coverage informations are available
> + * return just success or error, no parameters
> + */
> +#define XEN_SYSCTL_COVERAGE_enabled        0

You can detect this by getting -ENOSYS from the hypercall, which is what
you would get running the tool on an older hypervisor, so you need to
handle it anyway.

> +
> +/*
> + * Get total size of information, to help allocate
> + * the buffer. The pointer points to a 32 bit value.
> + */
> +#define XEN_SYSCTL_COVERAGE_get_total_size 1
> +
> +/*
> + * Read coverage information in a single run
> + * You must use a tool to split them
> + */
> +#define XEN_SYSCTL_COVERAGE_read           2
> +
> +/*
> + * Reset all the coverage counters to 0
> + * No parameters.
> + */
> +#define XEN_SYSCTL_COVERAGE_reset          3

Any need for simultaneous read+reset?

> +struct xen_sysctl_coverage_op {
> +    uint32_t cmd;        /* XEN_SYSCTL_COVERAGE_* */
> +    union {
> +        XEN_GUEST_HANDLE_64(uint32) total_size; /* OUT */

This one can just be a uint32_t I think, no need for it to be a
pointer/handle.

> +        XEN_GUEST_HANDLE_64(uint8)  raw_info;   /* OUT */
> +    } u;
> +};
> +typedef struct xen_sysctl_coverage_op xen_sysctl_coverage_op_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_sysctl_coverage_op_t);
> +
> +
>  struct xen_sysctl {
>      uint32_t cmd;
>  #define XEN_SYSCTL_readconsole                    1
> @@ -616,6 +652,7 @@ struct xen_sysctl {
>  #define XEN_SYSCTL_numainfo                      17
>  #define XEN_SYSCTL_cpupool_op                    18
>  #define XEN_SYSCTL_scheduler_op                  19
> +#define XEN_SYSCTL_coverage_op                   20
>      uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
>      union {
>          struct xen_sysctl_readconsole       readconsole;
> @@ -636,6 +673,7 @@ struct xen_sysctl {
>          struct xen_sysctl_lockprof_op       lockprof_op;
>          struct xen_sysctl_cpupool_op        cpupool_op;
>          struct xen_sysctl_scheduler_op      scheduler_op;
> +        struct xen_sysctl_coverage_op       coverage_op;
>          uint8_t                             pad[128];
>      } u;
>  };



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.