Add a test program for the membarrier() system call
[valgrind.git] / callgrind / costs.h
blobde88f5c0f2cb9eea02173df947b0291ac22aceda
1 /*--------------------------------------------------------------------*/
2 /*--- Callgrind cost array interface. costs.h ---*/
3 /*--------------------------------------------------------------------*/
5 /*
6 This file is part of Valgrind, a dynamic binary instrumentation
7 framework.
9 Copyright (C) 2004-2017 Josef Weidendorfer
10 josef.weidendorfer@gmx.de
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25 02111-1307, USA.
27 The GNU General Public License is contained in the file COPYING.
31 #ifndef CLG_COSTS
32 #define CLG_COSTS
34 #include "pub_tool_basics.h"
36 #define CLG_(str) VGAPPEND(vgCallgrind_,str)
38 extern UInt CLG_(costarray_entries);
39 extern UInt CLG_(costarray_chunks);
41 /* Array of 64bit costs. This is separated from other structs
42 * to support a dynamic number of costs for a cost item.
43 * Chunks are allocated on demand.
45 typedef struct _CostChunk CostChunk;
46 struct _CostChunk {
47 Int size;
48 Int used;
49 CostChunk *next, *prev;
50 ULong data[0];
53 /* Allocate a number of 64bit cost values.
54 * Typically used from ct_events.c */
55 ULong* CLG_(get_costarray)(Int size);
57 #endif /* CLG_COSTS */