Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:32:56

0001 
0002 /*
0003    ----------------------------------------------------------------
0004 
0005    Notice that the following BSD-style license applies to this one
0006    file (dhat.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 DHAT, a Valgrind tool for profiling the
0014    heap usage of programs.
0015 
0016    Copyright (C) 2020 Nicholas Nethercote.  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    (memcheck.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 #if !defined(VALGRIND_DHAT_H)
0060 #define VALGRIND_DHAT_H
0061 
0062 #include "valgrind.h"
0063 
0064 typedef
0065    enum {
0066       VG_USERREQ__DHAT_AD_HOC_EVENT = VG_USERREQ_TOOL_BASE('D', 'H'),
0067       VG_USERREQ__DHAT_HISTOGRAM_MEMORY,
0068 
0069       // This is just for DHAT's internal use. Don't use it.
0070       _VG_USERREQ__DHAT_COPY = VG_USERREQ_TOOL_BASE('D','H') + 256
0071    } Vg_DHATClientRequest;
0072 
0073 // Record an ad hoc event. The meaning of the weight argument will depend on
0074 // what the event represents, which is up to the user. If no meaningful weight
0075 // argument exists, just use 1.
0076 #define DHAT_AD_HOC_EVENT(_qzz_weight) \
0077     VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DHAT_AD_HOC_EVENT, \
0078                                     (_qzz_weight), 0, 0, 0, 0)
0079 
0080 // for access count histograms of memory larger than 1k
0081 #define DHAT_HISTOGRAM_MEMORY(_qzz_address) \
0082     VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DHAT_HISTOGRAM_MEMORY, \
0083                                     (_qzz_address), 0, 0, 0, 0)
0084 
0085 #endif
0086