WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 02/15] xen/multicalls: remove debugfs stats

To: Xen Devel <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 02/15] xen/multicalls: remove debugfs stats
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Mon, 20 Jun 2011 15:14:58 -0700
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Mon, 20 Jun 2011 15:25:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <cover.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
In-reply-to: <cover.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <cover.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
References: <cover.1308607697.git.jeremy.fitzhardinge@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>

Remove debugfs stats to make way for tracing.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
 arch/x86/xen/multicalls.c |  109 +--------------------------------------------
 arch/x86/xen/multicalls.h |    3 +
 2 files changed, 4 insertions(+), 108 deletions(-)

diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c
index 8bff7e7..d4be3fd 100644
--- a/arch/x86/xen/multicalls.c
+++ b/arch/x86/xen/multicalls.c
@@ -52,76 +52,6 @@ struct mc_buffer {
 static DEFINE_PER_CPU(struct mc_buffer, mc_buffer);
 DEFINE_PER_CPU(unsigned long, xen_mc_irq_flags);
 
-/* flush reasons 0- slots, 1- args, 2- callbacks */
-enum flush_reasons
-{
-       FL_SLOTS,
-       FL_ARGS,
-       FL_CALLBACKS,
-
-       FL_N_REASONS
-};
-
-#ifdef CONFIG_XEN_DEBUG_FS
-#define NHYPERCALLS    40              /* not really */
-
-static struct {
-       unsigned histo[MC_BATCH+1];
-
-       unsigned issued;
-       unsigned arg_total;
-       unsigned hypercalls;
-       unsigned histo_hypercalls[NHYPERCALLS];
-
-       unsigned flush[FL_N_REASONS];
-} mc_stats;
-
-static u8 zero_stats;
-
-static inline void check_zero(void)
-{
-       if (unlikely(zero_stats)) {
-               memset(&mc_stats, 0, sizeof(mc_stats));
-               zero_stats = 0;
-       }
-}
-
-static void mc_add_stats(const struct mc_buffer *mc)
-{
-       int i;
-
-       check_zero();
-
-       mc_stats.issued++;
-       mc_stats.hypercalls += mc->mcidx;
-       mc_stats.arg_total += mc->argidx;
-
-       mc_stats.histo[mc->mcidx]++;
-       for(i = 0; i < mc->mcidx; i++) {
-               unsigned op = mc->entries[i].op;
-               if (op < NHYPERCALLS)
-                       mc_stats.histo_hypercalls[op]++;
-       }
-}
-
-static void mc_stats_flush(enum flush_reasons idx)
-{
-       check_zero();
-
-       mc_stats.flush[idx]++;
-}
-
-#else  /* !CONFIG_XEN_DEBUG_FS */
-
-static inline void mc_add_stats(const struct mc_buffer *mc)
-{
-}
-
-static inline void mc_stats_flush(enum flush_reasons idx)
-{
-}
-#endif /* CONFIG_XEN_DEBUG_FS */
-
 void xen_mc_flush(void)
 {
        struct mc_buffer *b = &__get_cpu_var(mc_buffer);
@@ -135,8 +65,6 @@ void xen_mc_flush(void)
           something in the middle */
        local_irq_save(flags);
 
-       mc_add_stats(b);
-
        if (b->mcidx) {
 #if MC_DEBUG
                memcpy(b->debug, b->entries,
@@ -193,7 +121,6 @@ struct multicall_space __xen_mc_entry(size_t args)
 
        if (b->mcidx == MC_BATCH ||
            (argidx + args) > MC_ARGS) {
-               mc_stats_flush(b->mcidx == MC_BATCH ? FL_SLOTS : FL_ARGS);
                xen_mc_flush();
                argidx = roundup(b->argidx, sizeof(u64));
        }
@@ -240,44 +167,10 @@ void xen_mc_callback(void (*fn)(void *), void *data)
        struct mc_buffer *b = &__get_cpu_var(mc_buffer);
        struct callback *cb;
 
-       if (b->cbidx == MC_BATCH) {
-               mc_stats_flush(FL_CALLBACKS);
+       if (b->cbidx == MC_BATCH)
                xen_mc_flush();
-       }
 
        cb = &b->callbacks[b->cbidx++];
        cb->fn = fn;
        cb->data = data;
 }
-
-#ifdef CONFIG_XEN_DEBUG_FS
-
-static struct dentry *d_mc_debug;
-
-static int __init xen_mc_debugfs(void)
-{
-       struct dentry *d_xen = xen_init_debugfs();
-
-       if (d_xen == NULL)
-               return -ENOMEM;
-
-       d_mc_debug = debugfs_create_dir("multicalls", d_xen);
-
-       debugfs_create_u8("zero_stats", 0644, d_mc_debug, &zero_stats);
-
-       debugfs_create_u32("batches", 0444, d_mc_debug, &mc_stats.issued);
-       debugfs_create_u32("hypercalls", 0444, d_mc_debug, 
&mc_stats.hypercalls);
-       debugfs_create_u32("arg_total", 0444, d_mc_debug, &mc_stats.arg_total);
-
-       xen_debugfs_create_u32_array("batch_histo", 0444, d_mc_debug,
-                                    mc_stats.histo, MC_BATCH);
-       xen_debugfs_create_u32_array("hypercall_histo", 0444, d_mc_debug,
-                                    mc_stats.histo_hypercalls, NHYPERCALLS);
-       xen_debugfs_create_u32_array("flush_reasons", 0444, d_mc_debug,
-                                    mc_stats.flush, FL_N_REASONS);
-
-       return 0;
-}
-fs_initcall(xen_mc_debugfs);
-
-#endif /* CONFIG_XEN_DEBUG_FS */
diff --git a/arch/x86/xen/multicalls.h b/arch/x86/xen/multicalls.h
index 4ec8035..fa7b8af 100644
--- a/arch/x86/xen/multicalls.h
+++ b/arch/x86/xen/multicalls.h
@@ -1,6 +1,8 @@
 #ifndef _XEN_MULTICALLS_H
 #define _XEN_MULTICALLS_H
 
+#include <trace/events/xen.h>
+
 #include "xen-ops.h"
 
 /* Multicalls */
@@ -20,6 +22,7 @@ DECLARE_PER_CPU(unsigned long, xen_mc_irq_flags);
 static inline void xen_mc_batch(void)
 {
        unsigned long flags;
+
        /* need to disable interrupts until this entry is complete */
        local_irq_save(flags);
        __this_cpu_write(xen_mc_irq_flags, flags);
-- 
1.7.5.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>