Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:13:28

0001 
0002 /*
0003    ----------------------------------------------------------------
0004 
0005    Notice that the following BSD-style license applies to this one
0006    file (callgrind.h) only.  The rest of Valgrind is licensed under the
0007    terms of the GNU General Public License, version 2, unless
0008    otherwise indicated.  See the COPYING file in the source
0009    distribution for details.
0010 
0011    ----------------------------------------------------------------
0012 
0013    This file is part of callgrind, a valgrind tool for cache simulation
0014    and call tree tracing.
0015 
0016    Copyright (C) 2003-2017 Josef Weidendorfer.  All rights reserved.
0017 
0018    Redistribution and use in source and binary forms, with or without
0019    modification, are permitted provided that the following conditions
0020    are met:
0021 
0022    1. Redistributions of source code must retain the above copyright
0023       notice, this list of conditions and the following disclaimer.
0024 
0025    2. The origin of this software must not be misrepresented; you must
0026       not claim that you wrote the original software.  If you use this
0027       software in a product, an acknowledgment in the product
0028       documentation would be appreciated but is not required.
0029 
0030    3. Altered source versions must be plainly marked as such, and must
0031       not be misrepresented as being the original software.
0032 
0033    4. The name of the author may not be used to endorse or promote
0034       products derived from this software without specific prior written
0035       permission.
0036 
0037    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
0038    OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0039    WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0040    ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
0041    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0042    DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0043    GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0044    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0045    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0046    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0047    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0048 
0049    ----------------------------------------------------------------
0050 
0051    Notice that the above BSD-style license applies to this one file
0052    (callgrind.h) only.  The entire rest of Valgrind is licensed under
0053    the terms of the GNU General Public License, version 2.  See the
0054    COPYING file in the source distribution for details.
0055 
0056    ----------------------------------------------------------------
0057 */
0058 
0059 #ifndef __CALLGRIND_H
0060 #define __CALLGRIND_H
0061 
0062 #include "valgrind.h"
0063 
0064 /* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !!
0065    This enum comprises an ABI exported by Valgrind to programs
0066    which use client requests.  DO NOT CHANGE THE ORDER OF THESE
0067    ENTRIES, NOR DELETE ANY -- add new ones at the end.
0068 
0069    The identification ('C','T') for Callgrind has historical
0070    reasons: it was called "Calltree" before. Besides, ('C','G') would
0071    clash with cachegrind.
0072  */
0073 
0074 typedef
0075    enum {
0076       VG_USERREQ__DUMP_STATS = VG_USERREQ_TOOL_BASE('C','T'),
0077       VG_USERREQ__ZERO_STATS,
0078       VG_USERREQ__TOGGLE_COLLECT,
0079       VG_USERREQ__DUMP_STATS_AT,
0080       VG_USERREQ__START_INSTRUMENTATION,
0081       VG_USERREQ__STOP_INSTRUMENTATION
0082    } Vg_CallgrindClientRequest;
0083 
0084 /* Dump current state of cost centers, and zero them afterwards */
0085 #define CALLGRIND_DUMP_STATS                                    \
0086   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS,       \
0087                                   0, 0, 0, 0, 0)
0088 
0089 /* Dump current state of cost centers, and zero them afterwards.
0090    The argument is appended to a string stating the reason which triggered
0091    the dump. This string is written as a description field into the
0092    profile data dump. */
0093 #define CALLGRIND_DUMP_STATS_AT(pos_str)                        \
0094   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DUMP_STATS_AT,    \
0095                                   pos_str, 0, 0, 0, 0)
0096 
0097 /* Zero cost centers */
0098 #define CALLGRIND_ZERO_STATS                                    \
0099   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__ZERO_STATS,       \
0100                                   0, 0, 0, 0, 0)
0101 
0102 /* Toggles collection state.
0103    The collection state specifies whether the happening of events
0104    should be noted or if they are to be ignored. Events are noted
0105    by increment of counters in a cost center */
0106 #define CALLGRIND_TOGGLE_COLLECT                                \
0107   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__TOGGLE_COLLECT,   \
0108                                   0, 0, 0, 0, 0)
0109 
0110 /* Start full callgrind instrumentation if not already switched on.
0111    When cache simulation is done, it will flush the simulated cache;
0112    this will lead to an artificial cache warmup phase afterwards with
0113    cache misses which would not have happened in reality. */
0114 #define CALLGRIND_START_INSTRUMENTATION                              \
0115   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__START_INSTRUMENTATION, \
0116                                   0, 0, 0, 0, 0)
0117 
0118 /* Stop full callgrind instrumentation if not already switched off.
0119    This flushes Valgrinds translation cache, and does no additional
0120    instrumentation afterwards, which effectivly will run at the same
0121    speed as the "none" tool (ie. at minimal slowdown).
0122    Use this to bypass Callgrind aggregation for uninteresting code parts.
0123    To start Callgrind in this mode to ignore the setup phase, use
0124    the option "--instr-atstart=no". */
0125 #define CALLGRIND_STOP_INSTRUMENTATION                               \
0126   VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__STOP_INSTRUMENTATION,  \
0127                                   0, 0, 0, 0, 0)
0128 
0129 #endif /* __CALLGRIND_H */