00001 /* -*- mode:C++; c-basic-offset:4 -*- 00002 Shore-MT -- Multi-threaded port of the SHORE storage manager 00003 00004 Copyright (c) 2007-2009 00005 Data Intensive Applications and Systems Labaratory (DIAS) 00006 Ecole Polytechnique Federale de Lausanne 00007 00008 All Rights Reserved. 00009 00010 Permission to use, copy, modify and distribute this software and 00011 its documentation is hereby granted, provided that both the 00012 copyright notice and this permission notice appear in all copies of 00013 the software, derivative works or modified versions, and any 00014 portions thereof, and that both notices appear in supporting 00015 documentation. 00016 00017 This code is distributed in the hope that it will be useful, but 00018 WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS 00020 DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER 00021 RESULTING FROM THE USE OF THIS SOFTWARE. 00022 */ 00023 00024 /*<std-header orig-src='shore' incl-file-exclusion='STHREAD_STATS_H'> 00025 00026 $Id: sthread_stats.h,v 1.22 2010/12/08 17:37:50 nhall Exp $ 00027 00028 SHORE -- Scalable Heterogeneous Object REpository 00029 00030 Copyright (c) 1994-99 Computer Sciences Department, University of 00031 Wisconsin -- Madison 00032 All Rights Reserved. 00033 00034 Permission to use, copy, modify and distribute this software and its 00035 documentation is hereby granted, provided that both the copyright 00036 notice and this permission notice appear in all copies of the 00037 software, derivative works or modified versions, and any portions 00038 thereof, and that both notices appear in supporting documentation. 00039 00040 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY 00041 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS 00042 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND 00043 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 00044 00045 This software was developed with support by the Advanced Research 00046 Project Agency, ARPA order number 018 (formerly 8230), monitored by 00047 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518. 00048 Further funding for this work was provided by DARPA through 00049 Rome Research Laboratory Contract No. F30602-97-2-0247. 00050 00051 */ 00052 00053 #ifndef STHREAD_STATS_H 00054 #define STHREAD_STATS_H 00055 00056 #include "w_defines.h" 00057 00058 /* -- do not edit anything above this line -- </std-header>*/ 00059 00060 #include <w_stat.h> 00061 00062 /**\file sthread_stats.h 00063 * \ingroup MACROS 00064 */ 00065 00066 /**\brief A class to hold all the Perl-generated statistics for sthread_t 00067 * 00068 * This class just clears itself on construction and 00069 * when a client calls its method 00070 * \code 00071 * void clear(); 00072 * \endcode 00073 * 00074 * See \ref STATS. 00075 */ 00076 class sthread_stats { 00077 public: 00078 #include "sthread_stats_struct_gen.h" 00079 00080 sthread_stats() { 00081 // easier than remembering to add the inits 00082 // since we're changing the stats a lot 00083 // during development 00084 memset(this,'\0', sizeof(*this)); 00085 } 00086 ~sthread_stats(){ } 00087 00088 void clear() { 00089 memset((void *)this, '\0', sizeof(*this)); 00090 } 00091 }; 00092 00093 extern ostream &operator<<(ostream &, const sthread_stats &stats); 00094 00095 00096 # define INC_STH_STATS(x) sthread_t::me()->SthreadStats.x++; 00097 # define GET_STH_STATS(x) sthread_t::me()->SthreadStats.x 00098 00099 00100 /*<std-footer incl-file-exclusion='STHREAD_STATS_H'> -- do not edit anything below this line -- */ 00101 00102 #endif /*</std-footer>*/