Whamcloud - gitweb
LU-2470 procfs: Remove unused lu_time code.
authorJohn L. Hammond <jhammond@tacc.utexas.edu>
Tue, 11 Dec 2012 19:47:00 +0000 (13:47 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 18 Jan 2013 16:58:57 +0000 (11:58 -0500)
Remove lu_time.{c,h}, the unused wrappers for the functions defined
therein, and the stats file /proc/fs/lustre/mdt/*/site_time.

Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Change-Id: Id45b12efd06134048a96f4b0ba92eaa4fce0b55d
Reviewed-on: http://review.whamcloud.com/4802
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
19 files changed:
lustre/include/Makefile.am
lustre/include/lu_object.h
lustre/include/lu_time.h [deleted file]
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_lproc.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/mdt/mdt_reint.c
lustre/obdclass/Makefile.in
lustre/obdclass/autoMakefile.am
lustre/obdclass/cl_io.c
lustre/obdclass/cl_lock.c
lustre/obdclass/cl_object.c
lustre/obdclass/lu_object.c
lustre/obdclass/lu_time.c [deleted file]
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c

index 7b5aa5c..6a6c792 100644 (file)
@@ -46,7 +46,7 @@ EXTRA_DIST = ioctl.h liblustre.h lprocfs_status.h lustre_cfg.h        \
              lustre_lib.h lustre_sec.h lustre_lite.h lustre_log.h lustre_mds.h \
              lustre_mdc.h lustre_net.h lustre_quota.h lvfs.h \
              obd_cache.h obd_class.h obd.h obd_lov.h \
              lustre_lib.h lustre_sec.h lustre_lite.h lustre_log.h lustre_mds.h \
              lustre_mdc.h lustre_net.h lustre_quota.h lvfs.h \
              obd_cache.h obd_class.h obd.h obd_lov.h \
-            obd_ost.h obd_support.h lustre_ver.h lu_object.h lu_time.h  \
+            obd_ost.h obd_support.h lustre_ver.h lu_object.h \
              md_object.h dt_object.h lustre_param.h lustre_mdt.h \
              lustre_fid.h lustre_fld.h lustre_req_layout.h lustre_capa.h \
              lustre_idmap.h lustre_eacl.h interval_tree.h obd_cksum.h \
              md_object.h dt_object.h lustre_param.h lustre_mdt.h \
              lustre_fid.h lustre_fld.h lustre_req_layout.h lustre_capa.h \
              lustre_idmap.h lustre_eacl.h interval_tree.h obd_cksum.h \
index 2405771..4bc6359 100644 (file)
@@ -647,7 +647,6 @@ struct lu_site {
         * lu_site stats
         */
        struct lprocfs_stats    *ls_stats;
         * lu_site stats
         */
        struct lprocfs_stats    *ls_stats;
-       struct lprocfs_stats    *ls_time_stats;
        /**
         * XXX: a hack! fld has to find md_site via site, remove when possible
         */
        /**
         * XXX: a hack! fld has to find md_site via site, remove when possible
         */
@@ -1343,15 +1342,6 @@ int lu_global_init(void);
  */
 void lu_global_fini(void);
 
  */
 void lu_global_fini(void);
 
-enum {
-        LU_TIME_FIND_LOOKUP,
-        LU_TIME_FIND_ALLOC,
-        LU_TIME_FIND_INSERT,
-        LU_TIME_NR
-};
-
-extern const char *lu_time_names[LU_TIME_NR];
-
 struct lu_kmem_descr {
         cfs_mem_cache_t **ckd_cache;
         const char       *ckd_name;
 struct lu_kmem_descr {
         cfs_mem_cache_t **ckd_cache;
         const char       *ckd_name;
diff --git a/lustre/include/lu_time.h b/lustre/include/lu_time.h
deleted file mode 100644 (file)
index de91073..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * 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 version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/include/lu_time.h
- *
- * Author: Nikita Danilov <nikita@clusterfs.com>
- */
-
-#ifndef __LUSTRE_LU_TIME_H
-#define __LUSTRE_LU_TIME_H
-
-struct lprocfs_stats;
-struct lu_env;
-
-int  lu_time_global_init(void);
-void lu_time_global_fini(void);
-
-int  lu_time_named_init(struct lprocfs_stats **stats, const char *name,
-                        cfs_proc_dir_entry_t *entry,
-                        const char **names, int nr);
-int  lu_time_init(struct lprocfs_stats **stats,
-                  cfs_proc_dir_entry_t *entry,
-                  const char **names, int nr);
-void lu_time_fini(struct lprocfs_stats **stats);
-
-void lu_lprocfs_time_start(const struct lu_env *env);
-void lu_lprocfs_time_end(const struct lu_env *env,
-                         struct lprocfs_stats *stats, int idx);
-
-int lu_time_is_clean(const struct lu_env *env);
-
-#endif /* __LUSTRE_LU_TIME_H */
index a434bed..bb4f5c4 100644 (file)
@@ -125,7 +125,6 @@ struct mdd_device {
         struct dt_object                *mdd_orphans; /* PENDING directory */
         struct dt_object                *mdd_capa;
         cfs_proc_dir_entry_t            *mdd_proc_entry;
         struct dt_object                *mdd_orphans; /* PENDING directory */
         struct dt_object                *mdd_capa;
         cfs_proc_dir_entry_t            *mdd_proc_entry;
-        struct lprocfs_stats            *mdd_stats;
         struct mdd_changelog             mdd_cl;
         unsigned long                    mdd_atime_diff;
         struct mdd_object               *mdd_dot_lustre;
         struct mdd_changelog             mdd_cl;
         unsigned long                    mdd_atime_diff;
         struct mdd_object               *mdd_dot_lustre;
@@ -370,9 +369,6 @@ int orph_declare_index_delete(const struct lu_env *, struct mdd_object *,
 void lprocfs_mdd_init_vars(struct lprocfs_static_vars *lvars);
 int mdd_procfs_init(struct mdd_device *mdd, const char *name);
 int mdd_procfs_fini(struct mdd_device *mdd);
 void lprocfs_mdd_init_vars(struct lprocfs_static_vars *lvars);
 int mdd_procfs_init(struct mdd_device *mdd, const char *name);
 int mdd_procfs_fini(struct mdd_device *mdd);
-void mdd_lprocfs_time_start(const struct lu_env *env);
-void mdd_lprocfs_time_end(const struct lu_env *env,
-                          struct mdd_device *mdd, int op);
 
 /* mdd_object.c */
 int mdd_get_flags(const struct lu_env *env, struct mdd_object *obj);
 
 /* mdd_object.c */
 int mdd_get_flags(const struct lu_env *env, struct mdd_object *obj);
index 9c9619a..b921bc5 100644 (file)
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lprocfs_status.h>
 #include <obd_class.h>
 #include <obd_support.h>
 #include <lprocfs_status.h>
-#include <lu_time.h>
 #include <libcfs/libcfs_string.h>
 #include <libcfs/libcfs_string.h>
-
 #include "mdd_internal.h"
 
 #include "mdd_internal.h"
 
-static const char *mdd_counter_names[LPROC_MDD_NR] = {
-};
-
 int mdd_procfs_init(struct mdd_device *mdd, const char *name)
 {
         struct lprocfs_static_vars lvars;
 int mdd_procfs_init(struct mdd_device *mdd, const char *name)
 {
         struct lprocfs_static_vars lvars;
@@ -80,9 +75,7 @@ int mdd_procfs_init(struct mdd_device *mdd, const char *name)
                 GOTO(out, rc);
         }
 
                 GOTO(out, rc);
         }
 
-        rc = lu_time_init(&mdd->mdd_stats,
-                          mdd->mdd_proc_entry,
-                          mdd_counter_names, ARRAY_SIZE(mdd_counter_names));
+       rc = 0;
 
         EXIT;
 out:
 
         EXIT;
 out:
@@ -93,9 +86,6 @@ out:
 
 int mdd_procfs_fini(struct mdd_device *mdd)
 {
 
 int mdd_procfs_fini(struct mdd_device *mdd)
 {
-        if (mdd->mdd_stats)
-                lu_time_fini(&mdd->mdd_stats);
-
         if (mdd->mdd_proc_entry) {
                  lprocfs_remove(&mdd->mdd_proc_entry);
                  mdd->mdd_proc_entry = NULL;
         if (mdd->mdd_proc_entry) {
                  lprocfs_remove(&mdd->mdd_proc_entry);
                  mdd->mdd_proc_entry = NULL;
@@ -103,17 +93,6 @@ int mdd_procfs_fini(struct mdd_device *mdd)
         RETURN(0);
 }
 
         RETURN(0);
 }
 
-void mdd_lprocfs_time_start(const struct lu_env *env)
-{
-        lu_lprocfs_time_start(env);
-}
-
-void mdd_lprocfs_time_end(const struct lu_env *env, struct mdd_device *mdd,
-                          int idx)
-{
-        lu_lprocfs_time_end(env, mdd->mdd_stats, idx);
-}
-
 static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
                                  unsigned long count, void *data)
 {
 static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
                                  unsigned long count, void *data)
 {
index 1f6f78d..210eac4 100644 (file)
@@ -175,8 +175,6 @@ struct mdt_device {
         int                        mdt_nosquash_strlen;
        struct rw_semaphore        mdt_squash_sem;
 
         int                        mdt_nosquash_strlen;
        struct rw_semaphore        mdt_squash_sem;
 
-        cfs_proc_dir_entry_t      *mdt_proc_entry;
-        struct lprocfs_stats      *mdt_stats;
         int                        mdt_sec_level;
         struct rename_stats        mdt_rename_stats;
        struct lu_fid              mdt_md_root_fid;
         int                        mdt_sec_level;
         struct rename_stats        mdt_rename_stats;
        struct lu_fid              mdt_md_root_fid;
@@ -931,9 +929,6 @@ void mdt_rename_counter_tally(struct mdt_thread_info *info,
                              struct ptlrpc_request *req,
                              struct mdt_object *src, struct mdt_object *tgt);
 
                              struct ptlrpc_request *req,
                              struct mdt_object *src, struct mdt_object *tgt);
 
-void mdt_time_start(const struct mdt_thread_info *info);
-void mdt_time_end(const struct mdt_thread_info *info, int idx);
-
 /* Capability */
 int mdt_ck_thread_start(struct mdt_device *mdt);
 void mdt_ck_thread_stop(struct mdt_device *mdt);
 /* Capability */
 int mdt_ck_thread_start(struct mdt_device *mdt);
 void mdt_ck_thread_stop(struct mdt_device *mdt);
index 7f281a6..613bcfd 100644 (file)
 #include <lustre_mds.h>
 #include <lustre_mdt.h>
 #include <lprocfs_status.h>
 #include <lustre_mds.h>
 #include <lustre_mdt.h>
 #include <lprocfs_status.h>
-#include <lu_time.h>
 #include "mdt_internal.h"
 #include <lnet/lib-lnet.h>
 
 #include "mdt_internal.h"
 #include <lnet/lib-lnet.h>
 
-enum {
-        LPROC_MDT_NR
-};
-static const char *mdt_proc_names[LPROC_MDT_NR] = {
-};
-
 /**
  * The rename stats output would be YAML formats, like
  * rename_stats:
 /**
  * The rename stats output would be YAML formats, like
  * rename_stats:
@@ -243,19 +236,6 @@ int mdt_procfs_init(struct mdt_device *mdt, const char *name)
         }
         ptlrpc_lprocfs_register_obd(obd);
 
         }
         ptlrpc_lprocfs_register_obd(obd);
 
-        mdt->mdt_proc_entry = obd->obd_proc_entry;
-        LASSERT(mdt->mdt_proc_entry != NULL);
-
-        rc = lu_time_init(&mdt->mdt_stats, mdt->mdt_proc_entry,
-                          mdt_proc_names, ARRAY_SIZE(mdt_proc_names));
-        if (rc == 0)
-                rc = lu_time_named_init(&ld->ld_site->ls_time_stats,
-                                        "site_time", mdt->mdt_proc_entry,
-                                         lu_time_names,
-                                         ARRAY_SIZE(lu_time_names));
-        if (rc)
-                return rc;
-
         obd->obd_proc_exports_entry = proc_mkdir("exports",
                                                  obd->obd_proc_entry);
         if (obd->obd_proc_exports_entry)
         obd->obd_proc_exports_entry = proc_mkdir("exports",
                                                  obd->obd_proc_entry);
         if (obd->obd_proc_exports_entry)
@@ -292,27 +272,12 @@ int mdt_procfs_fini(struct mdt_device *mdt)
         lprocfs_free_per_client_stats(obd);
         lprocfs_obd_cleanup(obd);
         ptlrpc_lprocfs_unregister_obd(obd);
         lprocfs_free_per_client_stats(obd);
         lprocfs_obd_cleanup(obd);
         ptlrpc_lprocfs_unregister_obd(obd);
-        if (mdt->mdt_proc_entry) {
-                lu_time_fini(&ld->ld_site->ls_time_stats);
-                lu_time_fini(&mdt->mdt_stats);
-                mdt->mdt_proc_entry = NULL;
-        }
         lprocfs_free_md_stats(obd);
         lprocfs_free_obd_stats(obd);
 
         RETURN(0);
 }
 
         lprocfs_free_md_stats(obd);
         lprocfs_free_obd_stats(obd);
 
         RETURN(0);
 }
 
-void mdt_time_start(const struct mdt_thread_info *info)
-{
-        lu_lprocfs_time_start(info->mti_env);
-}
-
-void mdt_time_end(const struct mdt_thread_info *info, int idx)
-{
-        lu_lprocfs_time_end(info->mti_env, info->mti_mdt->mdt_stats, idx);
-}
-
 static int lprocfs_rd_identity_expire(char *page, char **start, off_t off,
                                       int count, int *eof, void *data)
 {
 static int lprocfs_rd_identity_expire(char *page, char **start, off_t off,
                                       int count, int *eof, void *data)
 {
index f334dd6..5aa043b 100644 (file)
@@ -47,7 +47,6 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include "mdt_internal.h"
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include "mdt_internal.h"
-#include "lu_time.h"
 
 static inline void mdt_reint_init_ma(struct mdt_thread_info *info,
                                      struct md_attr *ma)
 
 static inline void mdt_reint_init_ma(struct mdt_thread_info *info,
                                      struct md_attr *ma)
index b090861..6209e41 100644 (file)
@@ -13,7 +13,7 @@ obdclass-all-objs += class_obd.o debug.o genops.o uuid.o llog_ioctl.o
 obdclass-all-objs += lprocfs_status.o lprocfs_jobstats.o lustre_handles.o lustre_peer.o
 obdclass-all-objs += llog_osd.o local_storage.o
 obdclass-all-objs += statfs_pack.o obdo.o obd_config.o obd_mount.o mea.o
 obdclass-all-objs += lprocfs_status.o lprocfs_jobstats.o lustre_handles.o lustre_peer.o
 obdclass-all-objs += llog_osd.o local_storage.o
 obdclass-all-objs += statfs_pack.o obdo.o obd_config.o obd_mount.o mea.o
-obdclass-all-objs += lu_object.o dt_object.o capa.o lu_time.o
+obdclass-all-objs += lu_object.o dt_object.o capa.o
 obdclass-all-objs += cl_object.o cl_page.o cl_lock.o cl_io.o lu_ref.o
 obdclass-all-objs += acl.o idmap.o
 obdclass-all-objs += md_local_object.o md_attrs.o
 obdclass-all-objs += cl_object.o cl_page.o cl_lock.o cl_io.o lu_ref.o
 obdclass-all-objs += acl.o idmap.o
 obdclass-all-objs += md_local_object.o md_attrs.o
index 7b01cfb..c40f2b9 100644 (file)
@@ -11,7 +11,7 @@ liblustreclass_a_SOURCES = class_obd.c debug.c genops.c statfs_pack.c mea.c uuid
 liblustreclass_a_SOURCES += lustre_handles.c lustre_peer.c lprocfs_status.c
 liblustreclass_a_SOURCES += obdo.c obd_config.c llog.c llog_obd.c llog_cat.c 
 liblustreclass_a_SOURCES += llog_lvfs.c llog_swab.c capa.c
 liblustreclass_a_SOURCES += lustre_handles.c lustre_peer.c lprocfs_status.c
 liblustreclass_a_SOURCES += obdo.c obd_config.c llog.c llog_obd.c llog_cat.c 
 liblustreclass_a_SOURCES += llog_lvfs.c llog_swab.c capa.c
-liblustreclass_a_SOURCES += lu_object.c cl_object.c lu_time.c lu_ref.c
+liblustreclass_a_SOURCES += lu_object.c cl_object.c lu_ref.c
 liblustreclass_a_SOURCES += cl_page.c cl_lock.c cl_io.c lprocfs_jobstats.c
 liblustreclass_a_SOURCES += #llog_ioctl.c rbtree.c
 liblustreclass_a_CPPFLAGS = $(LLCPPFLAGS)
 liblustreclass_a_SOURCES += cl_page.c cl_lock.c cl_io.c lprocfs_jobstats.c
 liblustreclass_a_SOURCES += #llog_ioctl.c rbtree.c
 liblustreclass_a_CPPFLAGS = $(LLCPPFLAGS)
index f3d18fa..aed5f5e 100644 (file)
@@ -44,9 +44,6 @@
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <libcfs/list.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <libcfs/list.h>
-/* lu_time_global_{init,fini}() */
-#include <lu_time.h>
-
 #include <cl_object.h>
 #include "cl_internal.h"
 
 #include <cl_object.h>
 #include "cl_internal.h"
 
index 2bc231d..a3f15b7 100644 (file)
@@ -44,9 +44,6 @@
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <libcfs/list.h>
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <libcfs/list.h>
-/* lu_time_global_{init,fini}() */
-#include <lu_time.h>
-
 #include <cl_object.h>
 #include "cl_internal.h"
 
 #include <cl_object.h>
 #include "cl_internal.h"
 
index a13bf5c..8f47a14 100644 (file)
@@ -58,9 +58,6 @@
 #include <lustre_fid.h>
 #include <libcfs/list.h>
 #include <libcfs/libcfs_hash.h> /* for cfs_hash stuff */
 #include <lustre_fid.h>
 #include <libcfs/list.h>
 #include <libcfs/libcfs_hash.h> /* for cfs_hash stuff */
-/* lu_time_global_{init,fini}() */
-#include <lu_time.h>
-
 #include <cl_object.h>
 #include "cl_internal.h"
 
 #include <cl_object.h>
 #include "cl_internal.h"
 
index 67311f5..28988c5 100644 (file)
@@ -58,8 +58,6 @@
 #include <lustre_fid.h>
 #include <lu_object.h>
 #include <libcfs/list.h>
 #include <lustre_fid.h>
 #include <lu_object.h>
 #include <libcfs/list.h>
-/* lu_time_global_{init,fini}() */
-#include <lu_time.h>
 
 static void lu_object_free(const struct lu_env *env, struct lu_object *o);
 
 
 static void lu_object_free(const struct lu_env *env, struct lu_object *o);
 
@@ -2027,21 +2025,16 @@ int lu_global_init(void)
         if (lu_site_shrinker == NULL)
                 return -ENOMEM;
 
         if (lu_site_shrinker == NULL)
                 return -ENOMEM;
 
-        result = lu_time_global_init();
-        if (result)
-                GOTO(out, result);
-
 #ifdef __KERNEL__
 #ifdef __KERNEL__
-        result = dt_global_init();
-        if (result)
-                GOTO(out, result);
+       result = dt_global_init();
+       if (result != 0)
+               return result;
 
 
-        result = llo_global_init();
-        if (result)
-                GOTO(out, result);
+       result = llo_global_init();
+       if (result != 0)
+               return result;
 #endif
         result = cl_global_init();
 #endif
         result = cl_global_init();
-out:
 
         return result;
 }
 
         return result;
 }
@@ -2056,7 +2049,6 @@ void lu_global_fini(void)
         llo_global_fini();
         dt_global_fini();
 #endif
         llo_global_fini();
         dt_global_fini();
 #endif
-        lu_time_global_fini();
         if (lu_site_shrinker != NULL) {
                 cfs_remove_shrinker(lu_site_shrinker);
                 lu_site_shrinker = NULL;
         if (lu_site_shrinker != NULL) {
                 cfs_remove_shrinker(lu_site_shrinker);
                 lu_site_shrinker = NULL;
@@ -2120,13 +2112,6 @@ int lu_site_stats_print(const struct lu_site *s, char *page, int count)
 }
 EXPORT_SYMBOL(lu_site_stats_print);
 
 }
 EXPORT_SYMBOL(lu_site_stats_print);
 
-const char *lu_time_names[LU_TIME_NR] = {
-        [LU_TIME_FIND_LOOKUP] = "find_lookup",
-        [LU_TIME_FIND_ALLOC]  = "find_alloc",
-        [LU_TIME_FIND_INSERT] = "find_insert"
-};
-EXPORT_SYMBOL(lu_time_names);
-
 /**
  * Helper function to initialize a number of kmem slab caches at once.
  */
 /**
  * Helper function to initialize a number of kmem slab caches at once.
  */
diff --git a/lustre/obdclass/lu_time.c b/lustre/obdclass/lu_time.c
deleted file mode 100644 (file)
index 8b1310a..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * 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 version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/obdclass/lu_time.c
- *
- * Lustre Time Tracking.
- * These are the only exported functions, they provide some generic
- * infrastructure for managing object devices.
- *
- * Author: Nikita Danilov <nikita@clusterfs.com>
- */
-
-#define DEBUG_SUBSYSTEM S_CLASS
-
-#include <obd_class.h>
-/* OBD_{ALLOC,FREE}_PTR() */
-#include <obd_support.h>
-#include <lprocfs_status.h>
-#include <lu_object.h>
-#include <lu_time.h>
-
-enum {
-        LU_TIME_DEPTH_MAX = 16
-};
-
-struct lu_time_data {
-        int                ltd_tos; /* top of the stack */
-        unsigned long long ltd_timestamp[LU_TIME_DEPTH_MAX];
-};
-
-/* context key constructor/destructor: lu_time_key_init, lu_time_key_fini */
-LU_KEY_INIT_FINI(lu_time, struct lu_time_data);
-
-void lu_time_key_exit(const struct lu_context *ctx,
-                      struct lu_context_key *key, void *data)
-{
-        struct lu_time_data *value = data;
-        LASSERT(value->ltd_tos == 0);
-}
-
-/*
- * Key, holding temporary buffer. This key is registered very early by
- * lu_global_init().
- */
-static struct lu_context_key lu_time_key = {
-        .lct_tags = LCT_MD_THREAD|LCT_DT_THREAD|LCT_CL_THREAD,
-        .lct_init = lu_time_key_init,
-        .lct_fini = lu_time_key_fini,
-        .lct_exit = lu_time_key_exit
-};
-
-int lu_time_global_init(void)
-{
-        LU_CONTEXT_KEY_INIT(&lu_time_key);
-        return lu_context_key_register(&lu_time_key);
-}
-
-void lu_time_global_fini(void)
-{
-        lu_context_key_degister(&lu_time_key);
-}
-
-int lu_time_named_init(struct lprocfs_stats **stats, const char *name,
-                       cfs_proc_dir_entry_t *entry,
-                       const char **names, int nr)
-{
-        int result;
-        int i;
-
-        ENTRY;
-
-        *stats = NULL;
-        if (nr == 0)
-                RETURN(0);
-
-        *stats = lprocfs_alloc_stats(nr, 0);
-        if (*stats != NULL) {
-                result = lprocfs_register_stats(entry, name, *stats);
-                if (result == 0) {
-                        for (i = 0; i < nr; ++i) {
-                                lprocfs_counter_init(*stats, i,
-                                                     LPROCFS_CNTR_AVGMINMAX,
-                                                     names[i], "usec");
-                        }
-                }
-        } else
-                result = -ENOMEM;
-
-        if (result != 0)
-                lu_time_fini(stats);
-
-        RETURN(result);
-}
-EXPORT_SYMBOL(lu_time_named_init);
-
-int lu_time_init(struct lprocfs_stats **stats, cfs_proc_dir_entry_t *entry,
-                 const char **names, int nr)
-{
-        return lu_time_named_init(stats, "lu_stats", entry, names, nr);
-}
-EXPORT_SYMBOL(lu_time_init);
-
-void lu_time_fini(struct lprocfs_stats **stats)
-{
-        if (*stats != NULL) {
-                lprocfs_free_stats(stats);
-                *stats = NULL;
-        }
-}
-EXPORT_SYMBOL(lu_time_fini);
-
-static inline struct lu_time_data *lu_time_data_get(const struct lu_env *env)
-{
-        return lu_context_key_get(&env->le_ctx, &lu_time_key);
-}
-
-int lu_time_is_clean(const struct lu_env *env)
-{
-        return lu_time_data_get(env)->ltd_tos == 0;
-}
-EXPORT_SYMBOL(lu_time_is_clean);
-
-/* from sleepometer by Andrew Morton */
-unsigned long long lu_time_stamp_get(void)
-{
-        /*
-         * Return timestamp with microsecond precision. This has to be cheap.
-         */
-//#ifdef CONFIG_X86
-#if defined(CONFIG_X86) && !defined(CONFIG_X86_64)
-       /*
-        * do_gettimeofday() goes backwards sometimes :(.  Usethe TSC
-        */
-       unsigned long long ret;
-
-       rdtscll(ret);
-       do_div(ret, cpu_khz / 1000);
-       return ret;
-#else
-       struct timeval now;
-       unsigned long long ret;
-
-       cfs_gettimeofday(&now);
-       ret = now.tv_sec;
-       ret *= 1000000;
-       ret += now.tv_usec;
-       return ret;
-#endif
-}
-/*
- * Export it, but do not advertise in headers. This is limited use only.
- */
-EXPORT_SYMBOL(lu_time_stamp_get);
-
-void lu_lprocfs_time_start(const struct lu_env *env)
-{
-        struct lu_time_data *ltd = lu_time_data_get(env);
-
-        LASSERT(0 <= ltd->ltd_tos);
-        LASSERT(ltd->ltd_tos < ARRAY_SIZE(ltd->ltd_timestamp));
-        ltd->ltd_timestamp[ltd->ltd_tos++] = lu_time_stamp_get();
-}
-EXPORT_SYMBOL(lu_lprocfs_time_start);
-
-void lu_lprocfs_time_end(const struct lu_env *env,
-                         struct lprocfs_stats *stats, int idx)
-{
-        struct lu_time_data *ltd = lu_time_data_get(env);
-        long long diff;
-
-        --ltd->ltd_tos;
-        LASSERT(0 <= ltd->ltd_tos);
-        LASSERT(ltd->ltd_tos < ARRAY_SIZE(ltd->ltd_timestamp));
-        diff = lu_time_stamp_get() - ltd->ltd_timestamp[ltd->ltd_tos];
-        if (diff >= 0 && stats != NULL)
-                lprocfs_counter_add(stats, idx, diff);
-}
-EXPORT_SYMBOL(lu_lprocfs_time_end);
index 35f8768..c07b928 100644 (file)
@@ -533,8 +533,7 @@ static void osd_th_started(struct osd_thandle *oth)
 
 /**
  * Helper function to convert time interval to microseconds packed in
 
 /**
  * Helper function to convert time interval to microseconds packed in
- * long int (default time units for the counter in "stats" initialized
- * by lu_time_init() )
+ * long int.
  */
 static long interval_to_usec(cfs_time_t start, cfs_time_t end)
 {
  */
 static long interval_to_usec(cfs_time_t start, cfs_time_t end)
 {
index c839eb9..e972142 100644 (file)
@@ -650,9 +650,6 @@ extern int ldiskfs_pdo;
 void lprocfs_osd_init_vars(struct lprocfs_static_vars *lvars);
 int osd_procfs_init(struct osd_device *osd, const char *name);
 int osd_procfs_fini(struct osd_device *osd);
 void lprocfs_osd_init_vars(struct lprocfs_static_vars *lvars);
 int osd_procfs_init(struct osd_device *osd, const char *name);
 int osd_procfs_fini(struct osd_device *osd);
-void osd_lprocfs_time_start(const struct lu_env *env);
-void osd_lprocfs_time_end(const struct lu_env *env,
-                          struct osd_device *osd, int op);
 void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf);
 
 #endif
 void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf);
 
 #endif
index 380b634..045060e 100644 (file)
@@ -41,8 +41,6 @@
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <lprocfs_status.h>
 #define DEBUG_SUBSYSTEM S_CLASS
 
 #include <lprocfs_status.h>
-#include <lu_time.h>
-
 #include <lustre/lustre_idl.h>
 
 #include "osd_internal.h"
 #include <lustre/lustre_idl.h>
 
 #include "osd_internal.h"
@@ -239,14 +237,6 @@ out:
         RETURN(result);
 }
 
         RETURN(result);
 }
 
-static const char *osd_counter_names[] = {
-#if OSD_THANDLE_STATS
-        [LPROC_OSD_THANDLE_STARTING] = "thandle starting",
-        [LPROC_OSD_THANDLE_OPEN]     = "thandle open",
-        [LPROC_OSD_THANDLE_CLOSING]  = "thandle closing"
-#endif
-};
-
 int osd_procfs_init(struct osd_device *osd, const char *name)
 {
         struct lprocfs_static_vars lvars;
 int osd_procfs_init(struct osd_device *osd, const char *name)
 {
         struct lprocfs_static_vars lvars;
@@ -273,10 +263,6 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
                 GOTO(out, rc);
         }
 
                 GOTO(out, rc);
         }
 
-        rc = lu_time_init(&osd->od_stats,
-                          osd->od_proc_entry,
-                          osd_counter_names, ARRAY_SIZE(osd_counter_names));
-
         rc = osd_stats_init(osd);
 
         EXIT;
         rc = osd_stats_init(osd);
 
         EXIT;
@@ -288,8 +274,8 @@ out:
 
 int osd_procfs_fini(struct osd_device *osd)
 {
 
 int osd_procfs_fini(struct osd_device *osd)
 {
-        if (osd->od_stats)
-                lu_time_fini(&osd->od_stats);
+       if (osd->od_stats)
+               lprocfs_free_stats(&osd->od_stats);
 
         if (osd->od_proc_entry) {
                  lprocfs_remove(&osd->od_proc_entry);
 
         if (osd->od_proc_entry) {
                  lprocfs_remove(&osd->od_proc_entry);
@@ -298,19 +284,6 @@ int osd_procfs_fini(struct osd_device *osd)
         RETURN(0);
 }
 
         RETURN(0);
 }
 
-void osd_lprocfs_time_start(const struct lu_env *env)
-{
-        lu_lprocfs_time_start(env);
-}
-
-void osd_lprocfs_time_end(const struct lu_env *env, struct osd_device *osd,
-                          int idx)
-{
-        lu_lprocfs_time_end(env, osd->od_stats, idx);
-}
-
-
-
 static int lprocfs_osd_rd_fstype(char *page, char **start, off_t off, int count,
                                 int *eof, void *data)
 {
 static int lprocfs_osd_rd_fstype(char *page, char **start, off_t off, int count,
                                 int *eof, void *data)
 {
index 8fdd42c..7befd14 100644 (file)
@@ -46,8 +46,6 @@
 #include <obd.h>
 #include <obd_class.h>
 #include <lprocfs_status.h>
 #include <obd.h>
 #include <obd_class.h>
 #include <lprocfs_status.h>
-#include <lu_time.h>
-
 #include <lustre/lustre_idl.h>
 
 #include "udmu.h"
 #include <lustre/lustre_idl.h>
 
 #include "udmu.h"