weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 1 | /*--------------------------------------------------------------------*/ |
weidendo | f247f49 | 2014-08-22 08:38:40 +0000 | [diff] [blame] | 2 | /*--- Callgrind cost array interface. costs.h ---*/ |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 3 | /*--------------------------------------------------------------------*/ |
| 4 | |
weidendo | f247f49 | 2014-08-22 08:38:40 +0000 | [diff] [blame] | 5 | /* |
| 6 | This file is part of Valgrind, a dynamic binary instrumentation |
| 7 | framework. |
| 8 | |
sewardj | b3a1e4b | 2015-08-21 11:32:26 +0000 | [diff] [blame] | 9 | Copyright (C) 2004-2015 Josef Weidendorfer |
weidendo | f247f49 | 2014-08-22 08:38:40 +0000 | [diff] [blame] | 10 | josef.weidendorfer@gmx.de |
| 11 | |
| 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. |
| 16 | |
| 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. |
| 21 | |
| 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. |
| 26 | |
| 27 | The GNU General Public License is contained in the file COPYING. |
| 28 | */ |
| 29 | |
| 30 | |
| 31 | #ifndef CLG_COSTS |
| 32 | #define CLG_COSTS |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 33 | |
| 34 | #include "pub_tool_basics.h" |
| 35 | |
| 36 | #define CLG_(str) VGAPPEND(vgCallgrind_,str) |
| 37 | |
| 38 | extern UInt CLG_(costarray_entries); |
| 39 | extern UInt CLG_(costarray_chunks); |
| 40 | |
| 41 | /* Array of 64bit costs. This is separated from other structs |
| 42 | * to support a dynamic number of costs for a cost item. |
weidendo | bb951f9 | 2014-08-22 17:36:05 +0000 | [diff] [blame] | 43 | * Chunks are allocated on demand. |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 44 | */ |
| 45 | typedef struct _CostChunk CostChunk; |
| 46 | struct _CostChunk { |
| 47 | Int size; |
| 48 | Int used; |
| 49 | CostChunk *next, *prev; |
| 50 | ULong data[0]; |
| 51 | }; |
| 52 | |
| 53 | /* Allocate a number of 64bit cost values. |
| 54 | * Typically used from ct_events.c */ |
| 55 | ULong* CLG_(get_costarray)(Int size); |
weidendo | a17f2a3 | 2006-03-20 10:27:30 +0000 | [diff] [blame] | 56 | |
weidendo | f247f49 | 2014-08-22 08:38:40 +0000 | [diff] [blame] | 57 | #endif /* CLG_COSTS */ |