X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fobdclass%2Flu_time.c;h=0da2c1c7cdeddcd684e40220a9b0aaca9dae7cbe;hb=da63bbc723dacac308ab9351d0537a521c7ef3c3;hp=3883c779b6935ac5e765ec8a4b5c62be1a716d9f;hpb=98a2ab6915c16fd8745437bfed71889588880e12;p=fs%2Flustre-release.git diff --git a/lustre/obdclass/lu_time.c b/lustre/obdclass/lu_time.c index 3883c77..0da2c1c 100644 --- a/lustre/obdclass/lu_time.c +++ b/lustre/obdclass/lu_time.c @@ -1,31 +1,45 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Lustre Time Tracking. + * GPL HEADER START * - * Copyright (C) 2006 Cluster File Systems, Inc. - * Author: Nikita Danilov + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * This file is part of the Lustre file system, http://www.lustre.org - * Lustre is a trademark of Cluster File Systems, Inc. + * 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. * - * You may have signed or agreed to another license before downloading - * this software. If so, you are bound by the terms and conditions - * of that agreement, and the following does not apply to you. See the - * LICENSE file included with this distribution for more information. + * 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). * - * If you did not agree to a different license, then this copy of Lustre - * is open source software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. + * 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 * - * In either case, Lustre 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 - * license text for more details. + * 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 + * infrastructure for managing object devices. + * + * Author: Nikita Danilov */ #define DEBUG_SUBSYSTEM S_CLASS @@ -33,6 +47,7 @@ # define EXPORT_SYMTAB #endif +#include /* OBD_{ALLOC,FREE}_PTR() */ #include #include @@ -48,6 +63,7 @@ struct lu_time_data { 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, @@ -115,7 +131,7 @@ 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, "stats", entry, names, nr); + return lu_time_named_init(stats, "lu_stats", entry, names, nr); } EXPORT_SYMBOL(lu_time_init); @@ -145,13 +161,12 @@ unsigned long long lu_time_stamp_get(void) /* * Return timestamp with microsecond precision. This has to be cheap. */ -//#ifdef CONFIG_X86 +//#ifdef CONFIG_X86 #if defined(CONFIG_X86) && !defined(CONFIG_X86_64) /* * do_gettimeofday() goes backwards sometimes :(. Usethe TSC */ unsigned long long ret; - extern unsigned long cpu_khz; rdtscll(ret); do_div(ret, cpu_khz / 1000); @@ -160,7 +175,7 @@ unsigned long long lu_time_stamp_get(void) struct timeval now; unsigned long long ret; - do_gettimeofday(&now); + cfs_gettimeofday(&now); ret = now.tv_sec; ret *= 1000000; ret += now.tv_usec;