support pidfd_getfd
[valgrind.git] / callgrind / costs.h
blob9b33da480c4dac9a574f80c8de4b95868ccb2eea
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, see <http://www.gnu.org/licenses/>.
25 The GNU General Public License is contained in the file COPYING.
29 #ifndef CLG_COSTS
30 #define CLG_COSTS
32 #include "pub_tool_basics.h"
34 #define CLG_(str) VGAPPEND(vgCallgrind_,str)
36 extern UInt CLG_(costarray_entries);
37 extern UInt CLG_(costarray_chunks);
39 /* Array of 64bit costs. This is separated from other structs
40 * to support a dynamic number of costs for a cost item.
41 * Chunks are allocated on demand.
43 typedef struct _CostChunk CostChunk;
44 struct _CostChunk {
45 Int size;
46 Int used;
47 CostChunk *next, *prev;
48 ULong data[0];
51 /* Allocate a number of 64bit cost values.
52 * Typically used from ct_events.c */
53 ULong* CLG_(get_costarray)(Int size);
55 #endif /* CLG_COSTS */