summaryrefslogtreecommitdiff
path: root/dist/events.in
blob: f6e28f77fa871fd9bb39c74e240882c29b39d43c (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
#
# dist/events.in - This description of Oracle Berkeley DB's internal
# events hierarchy is processed by 'dist/s_include' to generate the
# platform-independant file dist/db_provider.d. The 'configure' step on the
# target operating system generate platform-specific include file.
#
#	s_include	->	dist/db_provider.d
#	configure	->	<build_directory>/db_provider.h
#
# There are two kinds of entries in events.in, describing either an event class
# or an individual event. The entries starting in the first column are class
# names, consisting of a single word. The class's individual events follow,
# described as if they were an ANSI C function signature;
#
# Events are listed grouped by their relation to one another, rather than
# alphabetically. For instance allocation and free events are adjacent.
# New, unrelated events are placed at the end of their event class.
#
# Copyright (c) 2011, 2015 Oracle and/or its affiliates.  All rights reserved.
#

# The alloc class covers the allocation of "on disk" database pages.
alloc
    # An attempt to allocate a database page of type 'type' for database 'db'
    # returned 'ret'. If the allocation succeeded then ret is 0, pgno is the
    # location of the new page, and pg is the address of the new page.
    # Details of the page can be extracted from the pg pointer.
    new(char *file, char *db, unsigned pgno, unsigned type,
    	struct _db_page *pg, int ret);
    # An attempt to free the page 'pgno' of 'db' returned 'ret'.
    # When successful the page is returned to the free list
    # or the file is truncated.
    free(char *file, char *db, unsigned pgno, unsigned ret);
    # A btree split of pgno in db is being attempted. The parent page number
    # and the level in the btree are also provided.
    btree_split(char *file, char *db, unsigned pgno, unsigned parent,
    	unsigned level);

# These DB API calls provide the name of the file and database being accessed.
# In-memory databases will have a NULL (0) file name address. The db name will
# be null unless subdatabases are in use.
db
    # The database or file name was opened. The 20 byte unique fileid can be
    # used to keep track of databases as they are created and destroyed.
    open(char *file, char *db, unsigned flags, uint8_t *fileid);
    # The database or file name was closed.
    close(char *file, char *db, unsigned flags, uint8_t *fileid);
    # An attempt is being made to open a cursor on the database or file.
    cursor(char *file, char *db, unsigned txnid, unsigned flags,
    	uint8_t *fileid);
    # An attempt is being made to get data from a db.
    get(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
    	unsigned flags);
    # An attempt is being made to put data to a db.
    put(char *file, char *db, unsigned txnid, DBT *key, DBT *data,
    	unsigned flags);
    # An attempt is being made to delete data from a db.
    del(char *file, char *db, unsigned txnid, DBT *key, unsigned flags);

# The lock class monitors the transactional consistency locks: page, record,
# and database. It also monitors the non-transactional file handle locks.
lock
    # The thread is about to suspend itself because another locker already has
    # a conflicting lock on object 'lock'.  The lock DBT's data points to
    # a __db_ilock structure, except for the atypical program which uses
    # application specific locking.
    suspend(DBT *lock, db_lockmode_t lock_mode);
    # The thread is awakening from a suspend.
    resume(DBT *lock, db_lockmode_t lock_mode);
    # The lock is being freed.
    put(struct __sh_dbt *lock, unsigned flags);
    # The lock would have been freed except that its refcount was greater
    # than 1.
    put_reduce_count(struct __sh_dbt *lock, unsigned flags);

    # These lock counters are included by --enable-perfmon-statistics.

    # The locker_id's lock request in lock_obj is about to be aborted in
    # order to resolve a deadlock. The lock region's st_ndeadlocks has
    # been incremented.
    deadlock(unsigned st_ndeadlocks, unsigned locker_id,
        struct __sh_dbt *lock_obj);
    # A DB_LOCK_NOWAIT lock request by locker_id would have had to wait.
    # The lock regions's st_lock_nowait has been incremented and
    # the request returns DB_LOCK_NOTGRANTED.
    nowait_notgranted(unsigned count, DBT *lock, unsigned locker_id);
    request(unsigned request_count, DBT *lock, unsigned locker_id);
    upgrade(unsigned upgrade_count, DBT *lock, unsigned locker_id);
    # A lock is being stolen from one partition for another one
    # The 'from' lock partition's st_locksteals has been incremented.
    steal(unsigned st_locksteals, unsigned from, unsigned to);
    # A lock object is being stolen from one partition for another one.
    # The 'from' lock partition's st_objectsteals has been incremented.
    object_steal(unsigned st_objectsteals, unsigned from, unsigned to);
    # A lock wait expired due to the lock request timeout.
    locktimeout(unsigned st_nlocktimeouts, const DBT *lock);
    # A lock wait expired due to the transaction's timeout.
    txntimeout(unsigned st_ntxntimeouts, const DBT *lock);
    # The allocation or deallocation of the locker id changed the number
    # of active locker identifiers.
    nlockers(unsigned active, unsigned locker_id);
    # The allocation of the locker id set a new maximum
    # number of active locker identifiers.
    maxnlockers(unsigned new_max_active, unsigned locker_id);

# Log - Transaction log 
log
    read(unsigned read_count, unsigned logfile);

# The mpool class monitors the allocation and management of memory,
# including the cache.
mpool
    # Read a page from file into buf.
    read(char *file, unsigned pgno, struct __bh *buf);
    # Write a page from buf to file.
    write(char *file, unsigned pgno, struct __bh *buf);
    # This is an attempt to allocate size bytes from region_id.
    # The reg_type is one of the reg_type_t enum values.
    env_alloc(unsigned size, unsigned region_id, unsigned reg_type);
    # The page is about to be removed from the cache.
    evict(char *file, unsigned pgno, struct __bh *buf);
    # The memory allocator has incremented wrap_count after searching through
    # the entire region without being able to fulfill the request for
    # alloc_len bytes. As wrap_count increases the library makes more effort
    # to allocate space.
    alloc_wrap(unsigned alloc_len, int region_id, int wrap_count,
    	int put_counter);

    # These mpool counters are included by --enable-perfmon-statistics.

    # The eviction of a clean page from a cache incremented st_ro_evict.
    clean_eviction(unsigned st_ro_evict, unsigned region_id);
    # The eviction of a dirty page from a cache incremented st_rw_evict.
    # The page has already been written out.
    dirty_eviction(unsigned st_rw_evict, unsigned region_id);
    # An attempt to allocate memory from region_id failed.
    fail(unsigned failure_count, unsigned alloc_len, unsigned region_id);
    free(unsigned freed_count, unsigned alloc_len, unsigned region_id);
    longest_search(unsigned count, unsigned alloc_len, unsigned region_id);
    free_frozen(unsigned count, char *file, unsigned pgno);
    freeze(unsigned hash_frozen, unsigned pgno);
    # A search for pgno of file incremented st_hash_searches.
    hash_search(unsigned st_hash_searches, char *file, unsigned pgno);
    # A search for pgno of file increased st_hash_examined by the number
    # of hash buckets examined.
    hash_examined(unsigned st_hash_examined, char *file, unsigned pgno);
    # A search for pgno of file set a new maximum st_hash_longest value.
    hash_longest(unsigned st_hash_longest, char *file, unsigned pgno);
    # A file's st_map count was incremented after a page was mapped into
    # memory.  The mapping might have caused disk I/O.
    map(unsigned st_map, char *file, unsigned pgno);
    # The hit count was incremented because pgno from file was found
    # in the cache.
    hit(unsigned st_cache_hit, char *file, unsigned pgno);
    # The miss count was incremented because pgno from file was
    # not already present in the cache.
    miss(unsigned st_cache_miss, char *file, unsigned pgno);
    # The st_page_create field was incremented because
    # the pgno of file was created in the cache.
    page_create(unsigned st_page_create, char *file, unsigned pgno);
    # The st_page_in field was incremented because
    # the pgno from file was read into the cache.
    page_in(unsigned st_page_in, char *file, unsigned pgno);
    # The st_page_out field was incremented because
    # the pgno from file was written out.
    page_out(unsigned st_page_out, char *file, unsigned pgno);
    thaw(unsigned count, char *file, unsigned pgno);
    alloc(unsigned success_count, unsigned len, unsigned region_id);
    nallocs(unsigned st_alloc, unsigned alloc_len);
    alloc_buckets(unsigned st_alloc_buckets, unsigned region_id);
    alloc_max_buckets(unsigned max, unsigned region_id);
    alloc_max_pages(unsigned max, unsigned region_id);
    alloc_pages(unsigned count, unsigned region_id);

    backup_spins(unsigned spins, char *file, unsigned pgno);`

    # The aggressiveness of a buffer cache allocation increases as more
    # involved methods are needed in order to free up the requested space
    # in the cache with the indicated region_id.
    # aggressive: the agressiveness of an allocation request was increased.
    # max_aggressive: the agressiveness of an allocation request was increased
    # to a new maximum.
    aggressive(unsigned st_alloc_aggressive, unsigned region_id);
    max_aggressive(unsigned st_alloc_max_aggr, unsigned region_id);

# The mutex category monitors includes shared latches.  The alloc_id value
# is one of the MTX_XXX definitions from dbinc/mutex.h
mutex
    # This thread is about to suspend itself because a thread has the
    # mutex or shared latch locked in a mode which conflicts with the
    # this request.
    suspend(unsigned mutex, unsigned excl, unsigned alloc_id,
    	struct __db_mutex_t *mutexp);
    # The thread is returning from a suspend and will attempt to obtain
    # the mutex or shared latch again. It might need to suspend again.
    resume(unsigned mutex, unsigned excl, unsigned alloc_id,
    	struct __db_mutex_t *mutexp);

    # These mutex counters are included by --enable-perfmon-statistics.

    # Increment the count of times that the mutex was free when trying
    # to lock it.
    set_nowait(unsigned mutex_set_nowait, unsigned mutex);
    # Increment the count of times that the mutex was busy when trying
    # to lock it.
    set_wait(unsigned mutex_set_wait, unsigned mutex);
    # Increment the count of times that the shared latch was free
    # when trying to get a shared lock on it.
    set_rd_nowait(unsigned mutex_set_rd_nowait, unsigned mutex);
    # Increment the count of times that the shared latch was already
    # exclusively latched when trying to get a shared lock on it.
    set_rd_wait(unsigned mutex_set_rd_wait, unsigned mutex);
    # Increment the count of times that a hybrid mutex had to block
    # on its condition variable.  n a busy system this might happen
    # several times before the corresponding hybrid_wakeup.
    hybrid_wait(unsigned hybrid_wait, unsigned mutex);
    # Increment the count of times that a hybrid mutex finished
    # one or more waits for its condition variable.
    hybrid_wakeup(unsigned hybrid_wakeup, unsigned mutex);

# The race events are triggered when the interactions between two threads
# causes a rarely executed code path to be taken. They are used primarily
# to help test and diagnose race conditions, though if they are being
# triggered too frequently it could result in performance degradation.
# They are intended for use by Berkeley DB engineers.
race
    # A Btree search needs to wait for a page lock and retry from the top.
    bam_search(char *file, char *db, int errcode, struct _db_page *pg,
    	struct _db_page *parent, unsigned flags);
    # A record was not found searching an off-page duplicate tree.
    # Retry the search.
    dbc_get(char *file, char *db, int errcode, unsigned flags, DBT *key);
    # The thread could not immediately open and lock the file handle
    # without waiting. The thread will close, wait, and retry.
    fop_file_setup(char *file, int errcode, unsigned flags);
    # A get next or previous in a recno db had to retry.
    ramc_get(char *file, char *db, struct _db_page *pg, unsigned flags);

# The statistics counters for replication are for internal use.
rep
    log_queued(unsigned count, DB_LSN *lsn);
    pg_duplicated(unsigned eid, unsigned pgno, unsigned file, unsigned count);
    pg_record(unsigned count, unsigned eid);
    pg_request(unsigned count, unsigned eid);
    election_won(unsigned count, unsigned generation);
    election(unsigned count, unsigned generation);
    log_request(unsigned count, unsigned eid);
    master_change(unsigned count, unsigned eid);

# The txn category covers the basic transaction operations.
txn
    # A transaction was successfully begun.
    begin(unsigned txnid, unsigned flags);
    # A transaction is starting to commit.
    commit(unsigned txnid, unsigned flags);
    # The transaction is starting to prepare, flushing the log
    # so that a future commit can be guaranteed to succeed.
    # The global identifier field is 128 bytes long.
    prepare(unsigned txnid, uint8_t *gid);
    # The transaction is about to abort.
    abort(unsigned txnid);

    # These txn counters are included by --enable-perfmon-statistics.

    # Beginning the transaction incremented st_nbegins.
    nbegins(unsigned st_nbegins, unsigned txnid);
    # Aborting the transaction incremented st_naborts.
    naborts(unsigned st_naborts, unsigned txnid);
    # Committing the transaction incremented st_ncommits.
    ncommits(unsigned st_ncommits, unsigned txnid);
    # Beginning or ending the transaction updated the number of active
    # transactions.
    nactive(unsigned st_nactive, unsigned txnid);
    # The creation of the transaction set a new maximum number
    # of active transactions.
    maxnactive(unsigned st_maxnactive, unsigned txnid);
    nsnapshot(unsigned st_nsnapshot, unsigned txnid);
    maxnsnapshot(unsigned st_maxnsnapshot, unsigned txnid);