xref: /netbsd-src/sys/uvm/uvm_stat.h (revision d914a3c1b942947a8b1fa87645678df29ac8e6ab)
1*d914a3c1Smrg /*	$NetBSD: uvm_stat.h,v 1.56 2021/12/11 19:24:22 mrg Exp $	*/
2f2caacc7Smrg 
3f2caacc7Smrg /*
48169e469Smrg  * Copyright (c) 2011 Matthew R. Green
5f2caacc7Smrg  * All rights reserved.
6f2caacc7Smrg  *
7f2caacc7Smrg  * Redistribution and use in source and binary forms, with or without
8f2caacc7Smrg  * modification, are permitted provided that the following conditions
9f2caacc7Smrg  * are met:
10f2caacc7Smrg  * 1. Redistributions of source code must retain the above copyright
11f2caacc7Smrg  *    notice, this list of conditions and the following disclaimer.
12f2caacc7Smrg  * 2. Redistributions in binary form must reproduce the above copyright
13f2caacc7Smrg  *    notice, this list of conditions and the following disclaimer in the
14f2caacc7Smrg  *    documentation and/or other materials provided with the distribution.
15f2caacc7Smrg  *
16f2caacc7Smrg  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17f2caacc7Smrg  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18f2caacc7Smrg  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19f2caacc7Smrg  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
208169e469Smrg  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
218169e469Smrg  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
228169e469Smrg  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
238169e469Smrg  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
248169e469Smrg  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
258169e469Smrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
268169e469Smrg  * SUCH DAMAGE.
278169e469Smrg  */
288169e469Smrg 
298169e469Smrg /*
308169e469Smrg  * Backwards compat for UVMHIST, in the new KERNHIST form.
31f2caacc7Smrg  */
32021fdb64Sperry 
33021fdb64Sperry #ifndef _UVM_UVM_STAT_H_
34021fdb64Sperry #define _UVM_UVM_STAT_H_
35021fdb64Sperry 
3667afbd62Smrg #if defined(_KERNEL_OPT)
37d9048520Smrg #include "opt_uvmhist.h"
388169e469Smrg #include "opt_kernhist.h"
39872181c2Sthorpej #endif
40872181c2Sthorpej 
418169e469Smrg /*
428169e469Smrg  * Make UVMHIST_PRINT force on KERNHIST_PRINT for at least UVMHIST_* usage.
438169e469Smrg  */
448169e469Smrg #if defined(UVMHIST_PRINT) && !defined(KERNHIST_PRINT)
458169e469Smrg #define KERNHIST_PRINT 1
468169e469Smrg #endif
478169e469Smrg 
488169e469Smrg #include <sys/kernhist.h>
498169e469Smrg 
50a5e92dacSchs #ifdef UVMHIST
51d9048520Smrg 
528169e469Smrg #define UVMHIST_DECL(NAME)			KERNHIST_DECL(NAME)
53fd236653Smatt #define UVMHIST_DEFINE(NAME)			KERNHIST_DEFINE(NAME)
548169e469Smrg #define UVMHIST_INIT(NAME,N)			KERNHIST_INIT(NAME,N)
551a23213bSmatt #define UVMHIST_INITIALIZER(NAME,BUF)		KERNHIST_INITIALIZER(NAME,BUF)
561a23213bSmatt #define UVMHIST_LINK_STATIC(NAME)		KERNHIST_LINK_STATIC(NAME)
578169e469Smrg #define UVMHIST_LOG(NAME,FMT,A,B,C,D)		KERNHIST_LOG(NAME,FMT,A,B,C,D)
588169e469Smrg #define UVMHIST_CALLED(NAME)			KERNHIST_CALLED(NAME)
591d725ebbSskrll #define UVMHIST_CALLARGS(NAME,FMT,A,B,C,D)	KERNHIST_CALLARGS(NAME,FMT,A,B,C,D)
608169e469Smrg #define UVMHIST_FUNC(FNAME)			KERNHIST_FUNC(FNAME)
61f2caacc7Smrg 
628169e469Smrg #else
63f2caacc7Smrg 
64f2caacc7Smrg #define UVMHIST_DECL(NAME)
65fd236653Smatt #define UVMHIST_DEFINE(NAME)
66f2caacc7Smrg #define UVMHIST_INIT(NAME,N)
671a23213bSmatt #define UVMHIST_INITIALIZER(NAME,BUF)
681a23213bSmatt #define UVMHIST_LINK_STATIC(NAME)
69f2caacc7Smrg #define UVMHIST_LOG(NAME,FMT,A,B,C,D)
70f2caacc7Smrg #define UVMHIST_CALLED(NAME)
71fe8087d6Sskrll #define UVMHIST_CALLARGS(NAME,FMT,A,B,C,D)
72f2caacc7Smrg #define UVMHIST_FUNC(FNAME)
73c7339f89Ssimonb 
74f2caacc7Smrg #endif
75f2caacc7Smrg 
76021fdb64Sperry #endif /* _UVM_UVM_STAT_H_ */
77