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 \
* 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
*/
*/
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;
+++ /dev/null
-/*
- * 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 */
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;
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);
#include <obd_class.h>
#include <obd_support.h>
#include <lprocfs_status.h>
-#include <lu_time.h>
#include <libcfs/libcfs_string.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;
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:
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;
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)
{
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;
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);
#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>
-enum {
- LPROC_MDT_NR
-};
-static const char *mdt_proc_names[LPROC_MDT_NR] = {
-};
-
/**
* The rename stats output would be YAML formats, like
* rename_stats:
}
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)
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);
}
-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)
{
#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)
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
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)
#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 <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 <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 <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);
if (lu_site_shrinker == NULL)
return -ENOMEM;
- result = lu_time_global_init();
- if (result)
- GOTO(out, result);
-
#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();
-out:
return result;
}
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;
}
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.
*/
+++ /dev/null
-/*
- * 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);
/**
* 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)
{
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
#define DEBUG_SUBSYSTEM S_CLASS
#include <lprocfs_status.h>
-#include <lu_time.h>
-
#include <lustre/lustre_idl.h>
#include "osd_internal.h"
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;
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;
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);
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)
{
#include <obd.h>
#include <obd_class.h>
#include <lprocfs_status.h>
-#include <lu_time.h>
-
#include <lustre/lustre_idl.h>
#include "udmu.h"