vgdb: Handle EAGAIN in read_buf
[valgrind.git] / dhat / dhat.h
blob653ed417b2e97daf17a95a1117dd7cf92e7c6504
2 /*
3 ----------------------------------------------------------------
5 Notice that the following BSD-style license applies to this one
6 file (dhat.h) only. The rest of Valgrind is licensed under the
7 terms of the GNU General Public License, version 2, unless
8 otherwise indicated. See the COPYING file in the source
9 distribution for details.
11 ----------------------------------------------------------------
13 This file is part of DHAT, a Valgrind tool for profiling the
14 heap usage of programs.
16 Copyright (C) 2020 Nicholas Nethercote. All rights reserved.
18 Redistribution and use in source and binary forms, with or without
19 modification, are permitted provided that the following conditions
20 are met:
22 1. Redistributions of source code must retain the above copyright
23 notice, this list of conditions and the following disclaimer.
25 2. The origin of this software must not be misrepresented; you must
26 not claim that you wrote the original software. If you use this
27 software in a product, an acknowledgment in the product
28 documentation would be appreciated but is not required.
30 3. Altered source versions must be plainly marked as such, and must
31 not be misrepresented as being the original software.
33 4. The name of the author may not be used to endorse or promote
34 products derived from this software without specific prior written
35 permission.
37 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
38 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
39 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
40 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
41 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
42 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
43 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
44 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
45 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
46 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
47 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 ----------------------------------------------------------------
51 Notice that the above BSD-style license applies to this one file
52 (memcheck.h) only. The entire rest of Valgrind is licensed under
53 the terms of the GNU General Public License, version 2. See the
54 COPYING file in the source distribution for details.
56 ----------------------------------------------------------------
59 #include "valgrind.h"
61 typedef
62 enum {
63 VG_USERREQ__DHAT_AD_HOC_EVENT = VG_USERREQ_TOOL_BASE('D', 'H'),
65 // This is just for DHAT's internal use. Don't use it.
66 _VG_USERREQ__DHAT_COPY = VG_USERREQ_TOOL_BASE('D','H') + 256
67 } Vg_DHATClientRequest;
69 // Record an ad hoc event. The meaning of the weight argument will depend on
70 // what the event represents, which is up to the user. If no meaningful weight
71 // argument exists, just use 1.
72 #define DHAT_AD_HOC_EVENT(_qzz_weight) \
73 VALGRIND_DO_CLIENT_REQUEST_STMT(VG_USERREQ__DHAT_AD_HOC_EVENT, \
74 (_qzz_weight), 0, 0, 0, 0)