source: gpfs_3.1_ker2.6.20/lpp/mmfs/src/gpl-linux/Logger-gpl.h @ 152

Last change on this file since 152 was 16, checked in by rock, 17 years ago
File size: 3.6 KB
Line 
1/***************************************************************************
2 *
3 * Copyright (C) 2001 International Business Machines
4 * All rights reserved.
5 *
6 * This file is part of the GPFS mmfslinux kernel module.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 *  1. Redistributions of source code must retain the above copyright notice,
13 *     this list of conditions and the following disclaimer.
14 *  2. Redistributions in binary form must reproduce the above copyright
15 *     notice, this list of conditions and the following disclaimer in the
16 *     documentation and/or other materials provided with the distribution.
17 *  3. The name of the author may not be used to endorse or promote products
18 *     derived from this software without specific prior written
19 *     permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *************************************************************************** */
33/* @(#)67       1.7  src/avs/fs/mmfs/ts/kernext/gpl-linux/Logger-gpl.h, mmfs, avs_rgpfs24, rgpfs240610b 2/14/05 16:16:27 */
34/*
35 * Subset of logging stuff in Linux layer
36 *
37 */
38
39#ifndef _h_logger_gpl
40#define _h_logger_gpl
41
42
43#include <Shark-gpl.h>
44
45#ifdef NDEBUG
46#define LOGASSERT(_ex)  NOOP
47#define LOGASSERTRC(_ex, _rc, _rea, _tag)  NOOP
48#else
49#define LOGASSERT(_ex)                                           \
50  if (!(_ex)) {                                                  \
51    logAssertFailed (2, __FILE__, __LINE__, 0, 0, 0, 0, # _ex);  \
52  } else NOOP
53#define LOGASSERTRC(_ex, _rc, _rea, _tag)                        \
54  if (!(_ex)) {                                                  \
55    logAssertFailed (2, __FILE__, __LINE__,                      \
56                     _rc, _rea, _tag, 0, # _ex);                 \
57  } else NOOP
58#endif
59
60#ifdef DBGASSERTS
61#define DBGASSERT(_ex)  LOGASSERT(_ex)
62#define DBGASSERTRC(_ex, _rc, _rea, _tag)  LOGASSERTRC(_ex, _rc, _rea, _tag)
63#else  /* not DBGASSERTS */
64#define DBGASSERT(_ex)  NOOP
65#define DBGASSERTRC(_ex, _rc, _rea, _tag)  NOOP
66#endif  /* DBGASSERTS */
67
68/* predeclare logAssertFailed; instantiated in cxiSystem.C */
69EXTERNC void logAssertFailed(
70               UInt32 flags,         /* LOG_FATAL_ERROR or LOG_NONFATAL_ERROR */
71               char  *srcFileName,   /* __FILE__ */
72               UInt32 srcLineNumber, /* __LINE__ */
73               Int32  retCode,       /* return code value */
74               Int32  reasonCode,    /* normally errno */
75               UInt32 logRecTag,     /* tag if have associated error log rec */
76               char  *dataStr,       /* assert data string */
77               char  *failingExpr);  /* expression that evaluated to false */
78
79#ifdef MALLOC_DEBUG
80void MallocDebugStart();
81void MallocDebugEnd();
82
83void MallocDebugNew(void *ptr, unsigned short size, unsigned short type);
84void MallocDebugDelete(void *ptr);
85#endif /* MALLOC_DEBUG */
86#endif /* _h_logger_gpl */
Note: See TracBrowser for help on using the repository browser.