summaryrefslogtreecommitdiff
path: root/src/lwp-events.h
blob: ab11141a8898b2d6564789e8219c33c59803bcb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
   This file is part of odin, a memory profiler with fragmentation analysis.

   Copyright (C) 2007 Chris Wilson <chris@chris-wilson.co.uk>

   odin is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 3 of the
   License, or (at your option) any later version.

   odin is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with odin. If not, see <http://www.gnu.org/licenses/>/

   The GNU General Public License is contained in the file COPYING.
*/

#ifndef LWP_EVENTS_H
#define LWP_EVENTS_H

#include <glib.h>
#include <sys/types.h>

G_BEGIN_DECLS

typedef struct _lwp_allocator LWP_Allocator;

typedef enum {
    LWP_INIT,
    LWP_FINI,
    LWP_MALLOC,
    LWP_MEMALIGN,
    LWP_REALLOC,
    LWP_FREE,

    LWP_DLOPEN,
    LWP_DLCLOSE
} LWP_EventType;

typedef struct _lwp_event_init {
    /* dummy */
} LWP_EventInit;

typedef struct _lwp_event_fini {
    /* dummy */
} LWP_EventFini;

typedef struct _lwp_event_malloc {
    gsize size;
    gpointer addr;
} LWP_EventMalloc;

typedef struct _lwp_event_memalign {
    gsize align;
    gsize size;
    gpointer addr;
} LWP_EventMemalign;

typedef struct _lwp_event_realloc {
    gsize size;
    gpointer old_addr;
    gpointer new_addr;
} LWP_EventRealloc;

typedef struct _lwp_event_free {
    gpointer addr;
} LWP_EventFree;

typedef struct _lwp_event_dlopen {
} LWP_EventDlopen;

typedef struct _lwp_event_dlclose {
} LWP_EventDlclose;

typedef union _lwp_event {
    LWP_EventInit init;
    LWP_EventFini fini;
    LWP_EventMalloc malloc;
    LWP_EventMemalign memalign;
    LWP_EventRealloc realloc;
    LWP_EventFree free;

    LWP_EventDlopen dlopen;
    LWP_EventDlclose dlclose;
} LWP_Event;

typedef struct _lwp_event_record {
    LWP_EventType type;
    guint32 time;
    guint allocator;
    LWP_Event event;
} LWP_EventRecord;

G_END_DECLS

#endif /* LWP_EVENTS_H */