blob: 209ed160e4378a6469565779773313e96174c9e0 [file] [log] [blame]
sewardjaf44c822007-11-25 14:01:38 +00001/*
2 This file is part of drd, a data race detector.
3
4 Copyright (C) 2006-2007 Bart Van Assche
5 bart.vanassche@gmail.com
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307, USA.
21
22 The GNU General Public License is contained in the file COPYING.
23*/
24
25
26#ifndef __SEGMENT_H
27#define __SEGMENT_H
28
29
30// Segments and segment lists. A segment represents information about
31// a contiguous group of statements of a specific thread. There is a vector
32// clock associated with each segment.
33
34
35#include "drd_vc.h"
36#include "pub_drd_bitmap.h"
37#include "pub_tool_execontext.h" // ExeContext
38#include "pub_tool_stacktrace.h" // StackTrace
39
40
41typedef struct segment
42{
43 struct segment* next;
44 struct segment* prev;
45 ExeContext* stacktrace;
46 VectorClock vc;
47 struct bitmap* bm;
48} Segment;
49
50void sg_init(Segment* const sg,
51 ThreadId const creator,
52 ThreadId const created);
53void sg_cleanup(Segment* const sg);
54Segment* sg_new(ThreadId const creator, ThreadId const created);
55void sg_delete(Segment* const sg);
56void sg_print(const Segment* const sg);
57Bool sg_get_trace(void);
58void sg_set_trace(Bool const trace_segment);
59ULong sg_get_segments_created_count(void);
60ULong sg_get_max_segments_alive_count(void);
61
62
63#endif // __SEGMENT_H