Branch data Line data Source code
1 : : /*
2 : : * Copyright (c) 2016, Citrix Systems, Inc.
3 : : *
4 : : * All rights reserved.
5 : : *
6 : : * Redistribution and use in source and binary forms, with or without
7 : : * modification, are permitted provided that the following conditions are met:
8 : : *
9 : : * 1. Redistributions of source code must retain the above copyright
10 : : * notice, this list of conditions and the following disclaimer.
11 : : * 2. Redistributions in binary form must reproduce the above copyright
12 : : * notice, this list of conditions and the following disclaimer in the
13 : : * documentation and/or other materials provided with the distribution.
14 : : * 3. Neither the name of the copyright holder nor the names of its
15 : : * contributors may be used to endorse or promote products derived from
16 : : * this software without specific prior written permission.
17 : : *
18 : : * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 : : * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 : : * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 : : * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
22 : : * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 : : * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 : : * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25 : : * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26 : : * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27 : : * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28 : : * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 : : */
30 : :
31 : : #include <stdlib.h>
32 : :
33 : : #include "debug.h"
34 : : #include "tapdisk-log.h"
35 : : #include "td-stats.h"
36 : : #include "td-ctx.h"
37 : :
38 : : void
39 : 0 : tapdisk_xenblkif_stats(struct td_xenblkif * blkif, td_stats_t * st)
40 : : {
41 [ # # ]: 0 : ASSERT(blkif);
42 [ # # ]: 0 : ASSERT(st);
43 [ # # ]: 0 : ASSERT(blkif->ctx);
44 : :
45 : 0 : tapdisk_stats_field(st, "pool", "s", blkif->ctx->pool);
46 : 0 : tapdisk_stats_field(st, "domid", "d", blkif->domid);
47 : 0 : tapdisk_stats_field(st, "devid", "d", blkif->devid);
48 : :
49 : 0 : tapdisk_stats_field(st, "reqs", "[");
50 : 0 : tapdisk_stats_val(st, "llu", blkif->stats.reqs.in);
51 : 0 : tapdisk_stats_val(st, "llu", blkif->stats.reqs.out);
52 : 0 : tapdisk_stats_leave(st, ']');
53 : :
54 : 0 : tapdisk_stats_field(st, "kicks", "[");
55 : 0 : tapdisk_stats_val(st, "llu", blkif->stats.kicks.in);
56 : 0 : tapdisk_stats_val(st, "llu", blkif->stats.kicks.out);
57 : 0 : tapdisk_stats_leave(st, ']');
58 : :
59 : 0 : tapdisk_stats_field(st, "errors", "{");
60 : 0 : tapdisk_stats_field(st, "msg", "llu", blkif->stats.errors.msg);
61 : 0 : tapdisk_stats_field(st, "map", "llu", blkif->stats.errors.map);
62 : 0 : tapdisk_stats_field(st, "vbd", "llu", blkif->stats.errors.vbd);
63 : 0 : tapdisk_stats_field(st, "img", "llu", blkif->stats.errors.img);
64 : 0 : tapdisk_stats_leave(st, '}');
65 : 0 : }
|