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

[Xen-devel] [RFC PATCH 3/8] xen, tools: rip out old gcov implementation



The internal data structure and code are tied to an old gcov format.
It's easier to just redo everything from scratch.

Salvage the reusable parts: leave xen/common/gcov and an empty Makefile
there, leave gcov support in Kconfig but mark that as broken. Also
reserve the sysctl number for later use (but delete relevant sysctl
structures).

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/misc/Makefile         |   6 --
 tools/misc/xencov.c         | 147 -----------------------------
 tools/misc/xencov_split     | 188 ------------------------------------
 xen/Kconfig.debug           |   1 +
 xen/common/gcov/Makefile    |   2 -
 xen/common/gcov/gcov.c      | 225 --------------------------------------------
 xen/common/sysctl.c         |   7 --
 xen/include/public/gcov.h   | 115 ----------------------
 xen/include/public/sysctl.h |  38 +-------
 xen/include/xen/gcov.h      |  93 ------------------
 10 files changed, 2 insertions(+), 820 deletions(-)
 delete mode 100644 tools/misc/xencov.c
 delete mode 100755 tools/misc/xencov_split
 delete mode 100644 xen/common/gcov/gcov.c
 delete mode 100644 xen/include/public/gcov.h
 delete mode 100644 xen/include/xen/gcov.h

diff --git a/tools/misc/Makefile b/tools/misc/Makefile
index 8152f7b..5ba6672 100644
--- a/tools/misc/Makefile
+++ b/tools/misc/Makefile
@@ -13,7 +13,6 @@ CFLAGS += $(CFLAGS_libxenstore)
 INSTALL_BIN-$(CONFIG_X86)      += xen-cpuid
 INSTALL_BIN-$(CONFIG_X86)      += xen-detect
 INSTALL_BIN                    += xencons
-INSTALL_BIN                    += xencov_split
 INSTALL_BIN += $(INSTALL_BIN-y)
 
 # Everything to be installed in regular sbin/
@@ -25,7 +24,6 @@ INSTALL_SBIN-$(CONFIG_X86)     += xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86)     += xen-mfndump
 INSTALL_SBIN                   += xen-ringwatch
 INSTALL_SBIN                   += xen-tmem-list-parse
-INSTALL_SBIN                   += xencov
 INSTALL_SBIN                   += xenlockprof
 INSTALL_SBIN                   += xenperf
 INSTALL_SBIN                   += xenpm
@@ -43,7 +41,6 @@ TARGETS_ALL := $(INSTALL_BIN) $(INSTALL_SBIN) 
$(INSTALL_PRIVBIN)
 TARGETS_COPY += xen-bugtool
 TARGETS_COPY += xen-ringwatch
 TARGETS_COPY += xencons
-TARGETS_COPY += xencov_split
 TARGETS_COPY += xenpvnetboot
 
 # Everything which needs to be built
@@ -105,7 +102,4 @@ xen-livepatch: xen-livepatch.o
 xen-lowmemd: xen-lowmemd.o
        $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenevtchn) $(LDLIBS_libxenctrl) 
$(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
 
-xencov: xencov.o
-       $(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
-
 -include $(DEPS)
diff --git a/tools/misc/xencov.c b/tools/misc/xencov.c
deleted file mode 100644
index 2aafb1d..0000000
--- a/tools/misc/xencov.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * xencov: handle test coverage information from Xen.
- *
- * Copyright (c) 2013, Citrix Systems R&D Ltd.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <xenctrl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <err.h>
-
-static xc_interface *gcov_xch = NULL;
-
-static void gcov_init(void)
-{
-    gcov_xch = xc_interface_open(NULL, NULL, 0);
-    if ( !gcov_xch )
-        err(1, "opening interface");
-}
-
-int gcov_get_info(int op, struct xen_sysctl *sys, struct xc_hypercall_buffer 
*ptr)
-{
-    struct xen_sysctl_coverage_op *cov;
-    DECLARE_HYPERCALL_BUFFER_ARGUMENT(ptr);
-
-    memset(sys, 0, sizeof(*sys));
-    sys->cmd = XEN_SYSCTL_coverage_op;
-
-    cov = &sys->u.coverage_op;
-    cov->cmd = op;
-    set_xen_guest_handle(cov->u.raw_info, ptr);
-
-    return xc_sysctl(gcov_xch, sys);
-}
-
-static void gcov_read(const char *fn, int reset)
-{
-    struct xen_sysctl sys;
-    uint32_t total_len;
-    DECLARE_HYPERCALL_BUFFER(uint8_t, p);
-    FILE *f;
-    int op = reset ? XEN_SYSCTL_COVERAGE_read_and_reset :
-                     XEN_SYSCTL_COVERAGE_read;
-
-    /* get total length */
-    if ( gcov_get_info(XEN_SYSCTL_COVERAGE_get_total_size, &sys, NULL) < 0 )
-        err(1, "getting total length");
-    total_len = sys.u.coverage_op.u.total_size;
-    fprintf(stderr, "returned %u bytes\n", (unsigned) total_len);
-
-    /* safe check */
-    if ( total_len > 16u * 1024u * 1024u )
-        errx(1, "coverage size too big %u bytes\n", total_len);
-
-    /* allocate */
-    p = xc_hypercall_buffer_alloc(gcov_xch, p, total_len);
-    if ( p == NULL )
-        err(1, "allocating memory for coverage");
-
-    /* get data */
-    memset(p, 0, total_len);
-    if ( gcov_get_info(op, &sys, HYPERCALL_BUFFER(p)) < 0 )
-        err(1, "getting coverage information");
-
-    /* write to a file */
-    if ( strcmp(fn, "-") == 0 )
-        f = stdout;
-    else
-        f = fopen(fn, "w");
-    if ( !f )
-        err(1, "opening output file");
-    if ( fwrite(p, 1, total_len, f) != total_len )
-        err(1, "writing coverage to file");
-    if (f != stdout)
-        fclose(f);
-    xc_hypercall_buffer_free(gcov_xch, p);
-}
-
-static void gcov_reset(void)
-{
-    struct xen_sysctl sys;
-
-    if ( gcov_get_info(XEN_SYSCTL_COVERAGE_reset, &sys, NULL) < 0 )
-        err(1, "resetting coverage information");
-}
-
-static void usage(int exit_code)
-{
-    FILE *out = exit_code ? stderr : stdout;
-
-    fprintf(out, "xencov {reset|read|read-reset} [<filename>]\n"
-        "\treset       reset information\n"
-        "\tread        read information from xen to filename\n"
-        "\tread-reset  read and reset information from xen to filename\n"
-        "\tfilename  optional filename (default output)\n"
-        );
-    exit(exit_code);
-}
-
-int main(int argc, char **argv)
-{
-    int opt;
-
-    while ((opt = getopt(argc, argv, "h")) != -1) {
-        switch (opt) {
-        case 'h':
-            usage(0);
-            break;
-        default:
-            usage(1);
-        }
-    }
-
-    argv += optind;
-    argc -= optind;
-    if (argc <= 0)
-        usage(1);
-
-    gcov_init();
-
-    if ( strcmp(argv[0], "reset") == 0 )
-        gcov_reset();
-    else if ( strcmp(argv[0], "read") == 0 )
-        gcov_read(argc > 1 ? argv[1] : "-", 0);
-    else if ( strcmp(argv[0], "read-reset") == 0 )
-        gcov_read(argc > 1 ? argv[1] : "-", 1);
-    else
-        usage(1);
-
-    return 0;
-}
-
diff --git a/tools/misc/xencov_split b/tools/misc/xencov_split
deleted file mode 100755
index b11f27c..0000000
--- a/tools/misc/xencov_split
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/usr/bin/perl
-
-# xencov_split - split coverage information from Xen
-#
-# Copyright (C) 2013  - Citrix Systems
-# -----
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; If not, see <http://www.gnu.org/licenses/>.
-
-use strict;
-use File::Path qw(mkpath);
-
-# some magic constants
-my $magic = 0x67636461;
-my $ctrBase = 0x01a10000;
-
-my $xenMagic = 0x58544346;     # file header
-my $xenTagFunc = 0x58544366;   # functions tag
-my $xenTagCount0 = 0x58544330; # counter 0 tag
-my $xenTagEnd = 0x5854432e;    # end file
-
-# open input file
-if ($ARGV[0]) {
-       my $fn = $ARGV[0];
-       open(IN, '<', $fn) or die "opening file \"$fn\"";
-} else {
-       open(IN, '<&STDIN') or die "redirecting input";
-}
-
-my $pos = 0;
-
-sub getRaw($)
-{
-    my $l = shift;
-    die 'got no data to read' if $l < 0;
-    my $res = '';
-    do {
-        my $data;
-        my $r = read(IN, $data, $l);
-        die "error $! reading data from input at position $pos" if 
!defined($r);
-        die "unexpected end of file at position $pos" if !$r;
-        $l -= $r;
-        $pos += $r;
-        $res .= $data;
-    } while ($l > 0);
-    return $res;
-}
-
-sub get32()
-{
-    return unpack('V', getRaw(4));
-}
-
-sub get64()
-{
-    # This is returned as raw data as some Perl version could not
-    # support 64 bit integer
-    # This is ok for little endian machines
-    return getRaw(8);
-}
-
-sub align()
-{
-    my $l = $pos & 7;
-    getRaw(8-$l) if $l;
-}
-
-# read a string prefixed by length
-sub getS()
-{
-    my $l = get32();
-    my $res = getRaw($l);
-    align();
-    return $res;
-}
-
-sub parseFunctions($)
-{
-    my $numCounters = shift;
-    my $num = get32();
-
-    my @funcs;
-    for my $n (1..$num) {
-        my @data;
-        my $ident = get32();
-        my $checksum = get32();
-        for my $n (1..$numCounters) {
-            push @data, get32(); # number of counters for a type
-        }
-        push @funcs, [$ident, $checksum, \@data];
-    }
-    align();
-    return @funcs;
-}
-
-sub parseCounters($)
-{
-    my $tag = shift;
-    die sprintf("wrong tag 0x%08x pos $pos (0x%08x)", $tag, $pos) if $tag < 
$xenTagCount0;
-    $tag -= $xenTagCount0;
-    die sprintf('wrong tag 0x%08x', $tag) if $tag > 5;
-    my $data = '';
-
-    my $num = get32();
-    for my $n (1..$num) {
-        $data .= get64();
-    }
-    align();
-    return [$tag, $data];
-}
-
-
-sub parseFile()
-{
-    my $ver = get32();
-    my $stamp = get32();
-    my $fn = getS();
-    align();
-
-    my $numCounters;
-
-    print "got file $fn\n";
-    die if $fn !~ m,^(/.*?)[^/]+\.gcda$,;
-    mkpath(".$1");
-    open(OUT, '>', ".$fn") or die;
-
-    print OUT pack('VVV', $magic, $ver, $stamp);
-
-    # read counters of file
-    my @ctrs;
-    my @funcs;
-    my $tag;
-    for (;;) {
-        $tag = get32();
-        last if ($tag == $xenMagic || $tag == $xenTagEnd);
-        if ($tag == $xenTagFunc) {
-            die if scalar(@funcs);
-            @funcs = parseFunctions(scalar(@ctrs));
-            next;
-        }
-
-        # must be a counter
-        push @ctrs, parseCounters($tag);
-        ++$numCounters;
-    }
-
-    # print all functions
-    for my $f (@funcs) {
-        # tag tag_len ident checksum
-        print OUT pack('VVVV', 0x01000000, 2, $f->[0], $f->[1]);
-        # all counts
-        my $n = 0;
-        for my $c (@{$f->[2]}) {
-            my ($type, $data) = @{$ctrs[$n]};
-            print OUT pack('VV', $ctrBase + 0x20000 * $type, $c*2);
-            die "--$c--$type--$data--" if length($data) < $c * 8;
-            print OUT substr($data, 0, $c * 8);
-            $ctrs[$n] = [$type, substr($data, $c * 8)];
-            ++$n;
-        }
-    }
-    close(OUT);
-
-    return $tag;
-}
-
-my $tag = get32();
-die 'no coverage or wrong file format' if $tag != $xenMagic;
-for (;;) {
-    if ($tag == $xenMagic) {
-        $tag = parseFile();
-    } elsif ($tag == $xenTagEnd) {
-        last;
-    } else {
-        die "wrong tag $tag";
-    }
-}
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 12a1193..056d5da 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -30,6 +30,7 @@ config FRAME_POINTER
 
 config GCOV
        bool "Gcov Support"
+       depends on BROKEN
        ---help---
          Enable gcov (a test coverage program in GCC) support.
 
diff --git a/xen/common/gcov/Makefile b/xen/common/gcov/Makefile
index c9efe6c..e69de29 100644
--- a/xen/common/gcov/Makefile
+++ b/xen/common/gcov/Makefile
@@ -1,2 +0,0 @@
-obj-y += gcov.o
-
diff --git a/xen/common/gcov/gcov.c b/xen/common/gcov/gcov.c
deleted file mode 100644
index b5717b9..0000000
--- a/xen/common/gcov/gcov.c
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- *  This code maintains a list of active profiling data structures.
- *
- *    Copyright IBM Corp. 2009
- *    Author(s): Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
- *
- *    Uses gcc-internal data definitions.
- *    Based on the gcov-kernel patch by:
- *       Hubertus Franke <frankeh@xxxxxxxxxx>
- *       Nigel Hinds <nhinds@xxxxxxxxxx>
- *       Rajan Ravindran <rajancr@xxxxxxxxxx>
- *       Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
- *       Paul Larson
- */
-
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/lib.h>
-#include <xen/hypercall.h>
-#include <xen/gcov.h>
-#include <xen/errno.h>
-#include <xen/guest_access.h>
-#include <public/xen.h>
-#include <public/gcov.h>
-
-static struct gcov_info *info_list;
-
-/*
- * __gcov_init is called by gcc-generated constructor code for each object
- * file compiled with -fprofile-arcs.
- *
- * Although this function is called only during initialization is called from
- * a .text section which is still present after initialization so not declare
- * as __init.
- */
-void __gcov_init(struct gcov_info *info)
-{
-    /* add new profiling data structure to list */
-    info->next = info_list;
-    info_list = info;
-}
-
-/*
- * These functions may be referenced by gcc-generated profiling code but serve
- * no function for Xen.
- */
-void __gcov_flush(void)
-{
-    /* Unused. */
-}
-
-void __gcov_merge_add(gcov_type *counters, unsigned int n_counters)
-{
-    /* Unused. */
-}
-
-void __gcov_merge_single(gcov_type *counters, unsigned int n_counters)
-{
-    /* Unused. */
-}
-
-void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters)
-{
-    /* Unused. */
-}
-
-static inline int counter_active(const struct gcov_info *info, unsigned int 
type)
-{
-    return (1 << type) & info->ctr_mask;
-}
-
-typedef struct write_iter_t
-{
-    XEN_GUEST_HANDLE(uint8) ptr;
-    int real;
-    uint32_t write_offset;
-} write_iter_t;
-
-static int write_raw(struct write_iter_t *iter, const void *data,
-                     size_t data_len)
-{
-    if ( iter->real &&
-        copy_to_guest_offset(iter->ptr, iter->write_offset,
-                             (const unsigned char *) data, data_len) )
-        return -EFAULT;
-
-    iter->write_offset += data_len;
-    return 0;
-}
-
-#define chk(v) do { ret=(v); if ( ret ) return ret; } while(0)
-
-static inline int write32(write_iter_t *iter, uint32_t val)
-{
-    return write_raw(iter, &val, sizeof(val));
-}
-
-static int write_string(write_iter_t *iter, const char *s)
-{
-    int ret;
-    size_t len = strlen(s);
-
-    chk(write32(iter, len));
-    return write_raw(iter, s, len);
-}
-
-static inline int next_type(const struct gcov_info *info, int *type)
-{
-    while ( ++*type < XENCOV_COUNTERS && !counter_active(info, *type) )
-        continue;
-    return *type;
-}
-
-static inline void align_iter(write_iter_t *iter)
-{
-    iter->write_offset =
-        (iter->write_offset + sizeof(uint64_t) - 1) & -sizeof(uint64_t);
-}
-
-static int write_gcov(write_iter_t *iter)
-{
-    struct gcov_info *info;
-    int ret;
-
-    /* reset offset */
-    iter->write_offset = 0;
-
-    /* dump all files */
-    for ( info = info_list ; info; info = info->next )
-    {
-        const struct gcov_ctr_info *ctr;
-        int type;
-        size_t size_fn = sizeof(struct gcov_fn_info);
-
-        align_iter(iter);
-        chk(write32(iter, XENCOV_TAG_FILE));
-        chk(write32(iter, info->version));
-        chk(write32(iter, info->stamp));
-        chk(write_string(iter, info->filename));
-
-        /* dump counters */
-        ctr = info->counts;
-        for ( type = -1; next_type(info, &type) < XENCOV_COUNTERS; ++ctr )
-        {
-            align_iter(iter);
-            chk(write32(iter, XENCOV_TAG_COUNTER(type)));
-            chk(write32(iter, ctr->num));
-            chk(write_raw(iter, ctr->values,
-                          ctr->num * sizeof(ctr->values[0])));
-
-            size_fn += sizeof(unsigned);
-        }
-
-        /* dump all functions together */
-        align_iter(iter);
-        chk(write32(iter, XENCOV_TAG_FUNC));
-        chk(write32(iter, info->n_functions));
-        chk(write_raw(iter, info->functions, info->n_functions * size_fn));
-    }
-
-    /* stop tag */
-    align_iter(iter);
-    chk(write32(iter, XENCOV_TAG_END));
-    return 0;
-}
-
-static int reset_counters(void)
-{
-    struct gcov_info *info;
-
-    for ( info = info_list ; info; info = info->next )
-    {
-        const struct gcov_ctr_info *ctr;
-        int type;
-
-        /* reset counters */
-        ctr = info->counts;
-        for ( type = -1; next_type(info, &type) < XENCOV_COUNTERS; ++ctr )
-            memset(ctr->values, 0, ctr->num * sizeof(ctr->values[0]));
-    }
-
-    return 0;
-}
-
-int sysctl_coverage_op(xen_sysctl_coverage_op_t *op)
-{
-    int ret = -EINVAL;
-    write_iter_t iter;
-
-    switch ( op->cmd )
-    {
-    case XEN_SYSCTL_COVERAGE_get_total_size:
-        iter.real = 0;
-
-        write_gcov(&iter);
-        op->u.total_size = iter.write_offset;
-        ret = 0;
-        break;
-
-    case XEN_SYSCTL_COVERAGE_read_and_reset:
-    case XEN_SYSCTL_COVERAGE_read:
-        iter.ptr = op->u.raw_info;
-        iter.real = 1;
-
-        ret = write_gcov(&iter);
-        if ( ret || op->cmd != XEN_SYSCTL_COVERAGE_read_and_reset )
-            break;
-
-        /* fall through */
-    case XEN_SYSCTL_COVERAGE_reset:
-        ret = reset_counters();
-        break;
-    }
-    return ret;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * tab-width: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 8aea6ef..2cac451 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -27,7 +27,6 @@
 #include <xen/nodemask.h>
 #include <xsm/xsm.h>
 #include <xen/pmstat.h>
-#include <xen/gcov.h>
 #include <xen/livepatch.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
@@ -396,12 +395,6 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) 
u_sysctl)
     }
     break;
 
-#ifdef CONFIG_GCOV
-    case XEN_SYSCTL_coverage_op:
-        ret = sysctl_coverage_op(&op->u.coverage_op);
-        break;
-#endif
-
 #ifdef CONFIG_HAS_PCI
     case XEN_SYSCTL_pcitopoinfo:
     {
diff --git a/xen/include/public/gcov.h b/xen/include/public/gcov.h
deleted file mode 100644
index 1b29b48..0000000
--- a/xen/include/public/gcov.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/******************************************************************************
- * gcov.h
- *
- * Coverage structures exported by Xen.
- * Structure is different from Gcc one.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Copyright (c) 2013, Citrix Systems R&D Ltd.
- */
-
-#ifndef __XEN_PUBLIC_GCOV_H__
-#define __XEN_PUBLIC_GCOV_H__ __XEN_PUBLIC_GCOV_H__
-
-#define XENCOV_COUNTERS         5
-#define XENCOV_TAG_BASE         0x58544300u
-#define XENCOV_TAG_FILE         (XENCOV_TAG_BASE+0x46u)
-#define XENCOV_TAG_FUNC         (XENCOV_TAG_BASE+0x66u)
-#define XENCOV_TAG_COUNTER(n)   (XENCOV_TAG_BASE+0x30u+((n)&0xfu))
-#define XENCOV_TAG_END          (XENCOV_TAG_BASE+0x2eu)
-#define XENCOV_IS_TAG_COUNTER(n) \
-    ((n) >= XENCOV_TAG_COUNTER(0) && (n) < XENCOV_TAG_COUNTER(XENCOV_COUNTERS))
-#define XENCOV_COUNTER_NUM(n) ((n)-XENCOV_TAG_COUNTER(0))
-
-/*
- * The main structure for the blob is
- * BLOB := FILE.. END
- * FILE := TAG_FILE VERSION STAMP FILENAME COUNTERS FUNCTIONS
- * FILENAME := LEN characters
- *   characters are padded to 32 bit
- * LEN := 32 bit value
- * COUNTERS := TAG_COUNTER(n) NUM COUNTER..
- * NUM := 32 bit valie
- * COUNTER := 64 bit value
- * FUNCTIONS := TAG_FUNC NUM FUNCTION..
- * FUNCTION := IDENT CHECKSUM NUM_COUNTERS
- *
- * All tagged structures are aligned to 8 bytes
- */
-
-/**
- * File information
- * Prefixed with XENCOV_TAG_FILE and a string with filename
- * Aligned to 8 bytes
- */
-struct xencov_file
-{
-    uint32_t tag; /* XENCOV_TAG_FILE */
-    uint32_t version;
-    uint32_t stamp;
-    uint32_t fn_len;
-    char filename[1];
-};
-
-
-/**
- * Counters information
- * Prefixed with XENCOV_TAG_COUNTER(n) where n is 0..(XENCOV_COUNTERS-1)
- * Aligned to 8 bytes
- */
-struct xencov_counter
-{
-    uint32_t tag; /* XENCOV_TAG_COUNTER(n) */
-    uint32_t num;
-    uint64_t values[1];
-};
-
-/**
- * Information for each function
- * Number of counter is equal to the number of counter structures got before
- */
-struct xencov_function
-{
-    uint32_t ident;
-    uint32_t checksum;
-    uint32_t num_counters[1];
-};
-
-/**
- * Information for all functions
- * Aligned to 8 bytes
- */
-struct xencov_functions
-{
-    uint32_t tag; /* XENCOV_TAG_FUNC */
-    uint32_t num;
-    struct xencov_function xencov_function[1];
-};
-
-/**
- * Terminator
- */
-struct xencov_end
-{
-    uint32_t tag; /* XENCOV_TAG_END */
-};
-
-#endif /* __XEN_PUBLIC_GCOV_H__ */
-
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 418f4bb..a939fa9 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -665,41 +665,6 @@ 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 */
-/*
- * 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 0
-
-/*
- * Read coverage information in a single run
- * You must use a tool to split them.
- */
-#define XEN_SYSCTL_COVERAGE_read           1
-
-/*
- * Reset all the coverage counters to 0
- * No parameters.
- */
-#define XEN_SYSCTL_COVERAGE_reset          2
-
-/*
- * Like XEN_SYSCTL_COVERAGE_read but reset also
- * counters to 0 in a single call.
- */
-#define XEN_SYSCTL_COVERAGE_read_and_reset 3
-
-struct xen_sysctl_coverage_op {
-    uint32_t cmd;        /* XEN_SYSCTL_COVERAGE_* */
-    union {
-        uint32_t total_size; /* OUT */
-        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);
-
 #define XEN_SYSCTL_PSR_CMT_get_total_rmid            0
 #define XEN_SYSCTL_PSR_CMT_get_l3_upscaling_factor   1
 /* The L3 cache size is returned in KB unit */
@@ -1108,7 +1073,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
+/* #define XEN_SYSCTL_coverage_op                   20 */
 #define XEN_SYSCTL_psr_cmt_op                    21
 #define XEN_SYSCTL_pcitopoinfo                   22
 #define XEN_SYSCTL_psr_cat_op                    23
@@ -1137,7 +1102,6 @@ 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;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
         struct xen_sysctl_psr_cat_op        psr_cat_op;
         struct xen_sysctl_tmem_op           tmem_op;
diff --git a/xen/include/xen/gcov.h b/xen/include/xen/gcov.h
deleted file mode 100644
index a7d4a35..0000000
--- a/xen/include/xen/gcov.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *  Profiling infrastructure declarations.
- *
- *  This file is based on gcc-internal definitions. Data structures are
- *  defined to be compatible with gcc counterparts. For a better
- *  understanding, refer to gcc source: gcc/gcov-io.h.
- *
- *    Copyright IBM Corp. 2009
- *    Author(s): Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
- *
- *    Uses gcc-internal data definitions.
- */
-
-#ifndef __XEN_GCOV_H__
-#define __XEN_GCOV_H__ __XEN_GCOV_H__
-
-#include <public/sysctl.h>
-
-/*
- * Profiling data types used for gcc 3.4 and above - these are defined by
- * gcc and need to be kept as close to the original definition as possible to
- * remain compatible.
- */
-
-typedef uint64_t gcov_type;
-
-/**
- * struct gcov_fn_info - profiling meta data per function
- * @ident: object file-unique function identifier
- * @checksum: function checksum
- * @n_ctrs: number of values per counter type belonging to this function
- *
- * This data is generated by gcc during compilation and doesn't change
- * at run-time.
- */
-struct gcov_fn_info
-{
-    unsigned int ident;
-    unsigned int checksum;
-    unsigned int n_ctrs[0];
-};
-
-/**
- * struct gcov_ctr_info - profiling data per counter type
- * @num: number of counter values for this type
- * @values: array of counter values for this type
- * @merge: merge function for counter values of this type (unused)
- *
- * This data is generated by gcc during compilation and doesn't change
- * at run-time with the exception of the values array.
- */
-struct gcov_ctr_info
-{
-    unsigned int num;
-    gcov_type *values;
-    void (*merge)(gcov_type *, unsigned int);
-};
-
-/**
- * struct gcov_info - profiling data per object file
- * @version: gcov version magic indicating the gcc version used for compilation
- * @next: list head for a singly-linked list
- * @stamp: time stamp
- * @filename: name of the associated gcov data file
- * @n_functions: number of instrumented functions
- * @functions: function data
- * @ctr_mask: mask specifying which counter types are active
- * @counts: counter data per counter type
- *
- * This data is generated by gcc during compilation and doesn't change
- * at run-time with the exception of the next pointer.
- */
-struct gcov_info
-{
-    unsigned int              version;
-    struct gcov_info          *next;
-    unsigned int              stamp;
-    const char                *filename;
-    unsigned int              n_functions;
-    const struct gcov_fn_info *functions;
-    unsigned int              ctr_mask;
-    struct gcov_ctr_info      counts[0];
-};
-
-
-/**
- * Sysctl operations for coverage
- */
-#ifdef CONFIG_GCOV
-int sysctl_coverage_op(xen_sysctl_coverage_op_t *op);
-#endif
-
-#endif /* __XEN_GCOV_H__ */
-- 
2.1.4


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

 


Rackspace

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