Debian Codegraph @

docs/programmer_reference/program_perfmon.html

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <title>Performance Event Monitoring</title>
7 <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9 <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
10 <link rel="up" href="program.html" title="Chapter 15.  Programmer Notes" />
11 <link rel="prev" href="program_runtime.html" title="Run-time configuration" />
12 <link rel="next" href="program_faq.html" title="Programmer notes FAQ" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Performance Event Monitoring</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="program_runtime.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 15. 
26 Programmer Notes
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="program_faq.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="program_perfmon"></a>Performance Event Monitoring</h2>
38 </div>
39 </div>
40 </div>
41 <div class="toc">
42 <dl>
43 <dt>
44 <span class="sect2">
45 <a href="program_perfmon.html#program_perfmon_dtrace">Using the DTrace Provider</a>
46 </span>
47 </dt>
48 <dt>
49 <span class="sect2">
50 <a href="program_perfmon.html#program_perfmon_stap">Using SystemTap</a>
51 </span>
52 </dt>
53 <dt>
54 <span class="sect2">
55 <a href="program_perfmon.html#program_perfmon_examples">Example Scripts</a>
56 </span>
57 </dt>
58 <dt>
59 <span class="sect2">
60 <a href="program_perfmon.html#program_perfmon_probes">Performance Events Reference</a>
61 </span>
62 </dt>
63 </dl>
64 </div>
65 <p>
66 The Performance Event Monitoring feature uses Solaris DTrace or
67 Linux SystemTap to "publish" interesting events as they occur
68 inside of Berkeley DB.
69 The operating system utilities <span class="command"><strong>dtrace</strong></span> or
70 <span class="command"><strong>stap</strong></span> run scripts which select, analyze,
71 and display events. There is no need to modify the application.
72 Any application which uses that Berkeley DB library can be monitored.
73 For more information about these instrumentation tools refer to the
74 following pages:
75 </p>
76 <div class="variablelist">
77 <dl>
78 <dt>
79 <span class="term">DTrace</span>
80 </dt>
81 <dd>
82 <a class="ulink" href="http://www.oracle.com/technetwork/systems/dtrace/dtrace/index-jsp-137532.html" target="_top">http://www.oracle.com/technetwork/systems/dtrace/dtrace/index-jsp-137532.html</a>
83 </dd>
84 <dt>
85 <span class="term">SystemTap</span>
86 </dt>
87 <dd>
88 <a class="ulink" href="http://sourceware.org/systemtap/" target="_top">http://sourceware.org/systemtap/</a>
89 </dd>
90 </dl>
91 </div>
92 <p>
93 </p>
94 <p>
95 Performance Event Monitoring is available for operating systems where
96 DTrace or SystemTap supports static probe points in user applications,
97 such as Solaris 10 and OpenSolaris, some versions of Linux,
98 and Mac OS X 10.6 and later.
99 By including --enable-dtrace to the configuration options, the resulting
100 libraries will include probe points for these event categories:
101 </p>
102 <div class="itemizedlist">
103 <ul type="disc">
104 <li>
105 database operations: opening a database or
106 cursor, get, put, delete.
107 </li>
108 <li>
109 internal operations regarding disk allocation, transactions,
110 concurrency control, and caching.
111 </li>
112 <li>
113 the beginning and ending of waiting periods due to conflicting
114 transactional consistency locks (for example, page locks),
115 mutexes, or shared latches.
116 </li>
117 <li>
118 timing dependent code paths which are expected to be infrequent.
119 These could raise concerns if they were to happen too often.
120 </li>
121 </ul>
122 </div>
123 <p>
124 These probe points are implemented as user-level statically defined traces
125 (USDT's) for DTrace, and static userspace markers for SystemTap.
126 </p>
127 <p>
128 To monitor the statistics values as they are updated include
129 the --enable-perfmon-statistics configuration option.
130 This option generates probe points for updates to many of the counters
131 whose values are displayed by the db_stat utility
132 or returned by the various statistics functions.
133 The "cache" example script uses a few of these probe points.
134 </p>
135 <p>
136 Performance Event Monitoring is intended to be suitable for production
137 applications. Running Berkeley DB with DTrace or SystemTap support
138 built in has little effect on execution speed until probes are enabled
139 at runtime by the <span class="command"><strong>dtrace</strong></span>
140 or <span class="command"><strong>stap</strong></span> programs.
141 </p>
142 <p>
143 The list of available events may be displayed by running 'make listprobes'
144 after building the libdb-5.3 shared library.
145 </p>
146 <div class="sect2" lang="en" xml:lang="en">
147 <div class="titlepage">
148 <div>
149 <div>
150 <h3 class="title"><a id="program_perfmon_dtrace"></a>Using the DTrace Provider</h3>
151 </div>
152 </div>
153 </div>
154 <p>
155 The DTrace probe provider for Berkeley DB is named 'bdb'. A simple
156 dtrace command to monitor all dtrace-enabled Berkeley DB activity
157 in the system is:
158 </p>
159 <p>
160 <code class="code">
161 dtrace -Zn 'bdb*::: { printf("%s", probename); }'
162 </code>
163 </p>
164 <p>
165 DTrace requires elevated privileges in order to run. On Solaris you can
166 avoid running as root by giving any users who need to run
167 <span class="command"><strong>dtrace</strong></span> the dtrace_proc or dtrace_user
168 privilege in <span class="command"><strong>/etc/user_attr</strong></span>.
169 </p>
170 <p>
171 DTrace works on both 32 and 64 bit applications. However, when tracing
172 a 32-bit application on a 64-bit processor it might be necessary to pass
173 a "32 bit" option to <span class="command"><strong>dtrace</strong></span>. Without this option
174 the D language might use a pointer size of 8 bytes, which could cause
175 pointer values (and structures containing them) to be processed incorrectly.
176 Use the <code class="code">-32</code> option on Solaris; on Mac OS X use <code class="code">-arch i386</code>.
177 </p>
178 </div>
179 <div class="sect2" lang="en" xml:lang="en">
180 <div class="titlepage">
181 <div>
182 <div>
183 <h3 class="title"><a id="program_perfmon_stap"></a>Using SystemTap</h3>
184 </div>
185 </div>
186 </div>
187 <p>
188 SystemTap looks up its static userspace markers in the library name
189 specified in the <span class="command"><strong>stap</strong></span> script.
190 A simple <span class="command"><strong>stap</strong></span> command to list the probes
191 of the default Berkeley DB installation is:
192 </p>
193 <p>
194 <code class="code">
195 stap -l 'process("/usr/local/BerkeleyDB.5.3/lib/libdb-5.3.so").mark("*")'
196 </code>
197 </p>
198 <p>
199 Berkeley DB supports SystemTap version 1.1 or later. Building with
200 userspace marker support requires <code class="filename">sys/sdt.h</code>,
201 which is often available in the package <code class="filename">systemtap-sdt-devel</code>.
202 Running <span class="command"><strong>stap</strong></span> with userspace markers requires that the
203 kernel have "utrace" support; see
204 <a class="ulink" href="http://sourceware.org/systemtap/wiki/utrace" target="_top">http://sourceware.org/systemtap/wiki/utrace</a> for more information.
205 </p>
206 <p>
207 SystemTap needs elevated privileges in order to run. You can avoid running as
208 root by adding the users who need to run <span class="command"><strong>stap</strong></span>
209 to the group stapdev.
210 </p>
211 </div>
212 <div class="sect2" lang="en" xml:lang="en">
213 <div class="titlepage">
214 <div>
215 <div>
216 <h3 class="title"><a id="program_perfmon_examples"></a>Example Scripts</h3>
217 </div>
218 </div>
219 </div>
220 <p>
221 Berkeley DB includes several example scripts, in both DTrace and SystemTap versions.
222 The DTrace examples end with a <code class="filename">.d</code> suffix and are located in
223 <code class="filename">util/dtrace</code>. The SystemTap examples have a
224 <code class="filename">.stp</code> suffix and can found be in
225 <code class="filename">util/systemtap</code>. The Berkeley DB shared library name,
226 including any necessary path,
227 is expected as the first parameter to the SystemTap examples.
228 </p>
229 <div class="variablelist">
230 <dl>
231 <dt>
232 <span class="term">apicalls</span>
233 </dt>
234 <dd>
235 This script graphs the count of the main API calls. The result
236 is grouped by thread of the target process.
237 </dd>
238 <dt>
239 <span class="term">apitimes</span>
240 </dt>
241 <dd>
242 This script graphs the time spent in the main API calls,
243 grouped by thread.
244 </dd>
245 <dt>
246 <span class="term"> apitrace </span>
247 </dt>
248 <dd>
249 This script displays the entry to and return from each of the
250 main API calls.
251 </dd>
252 <dt>
253 <span class="term"> cache </span>
254 </dt>
255 <dd>
256 This script displays overall and per-file buffer cache statistics
257 every <span class="emphasis"><em>N</em></span> (default: 1) seconds for
258 <span class="emphasis"><em>M</em></span> (default: 60) intervals.
259 It prints the number of cache hits, misses, and evictions for
260 each file with any activity during the interval.
261 </dd>
262 <dt>
263 <span class="term"> dbdefs</span>
264 </dt>
265 <dd>
266 This contains DTrace-compatible declarations of Berkeley DB
267 data structures returned from probe points.
268 There is no Linux equivalent; SystemTap can obtain type
269 information directly from the debugging symbols compiled
270 into the libdb*-5.3.so shared library.
271 </dd>
272 <dt>
273 <span class="term"> locktimes </span>
274 </dt>
275 <dd>
276 This script graphs the time spent waiting for DB page locks.
277 The result times in nanoseconds are grouped by filename,
278 pgno, and lock_mode. The optional integer maxcount parameter
279 directs the script to exit once that many page lock waits
280 have been measured.
281 </dd>
282 <dt>
283 <span class="term"> locktimesid </span>
284 </dt>
285 <dd>
286 This is similar to the locktimes script above, except that it displays
287 the 20 byte file identifier rather than the file name. This can be
288 useful when there are several environments involved, or when database
289 files are recreated during the monitoring period.
290 </dd>
291 <dt>
292 <span class="term"> mutex </span>
293 </dt>
294 <dd>
295 This script measures mutex wait periods, summarizing the results two ways.
296 <div class="itemizedlist"><ul type="disc"><li>
297 The first grouping is by mutex, mode (exclusive or shared),
298 and thread id.
299 </li><li>
300 The second grouping is by the mutex category and
301 mode (exclusive or shared).
302 The mutex categories are the MTX_XXX definitions in
303 <code class="filename">dbinc/mutex.h</code>.
304 </li></ul></div></dd>
305 <dt>
306 <span class="term"> showerror </span>
307 </dt>
308 <dd>
309 This script displays the application stack when the basic error
310 routines are called. It provides additional information about
311 an error, beyond the string sent to the diagnostic output.
312 </dd>
313 </dl>
314 </div>
315 <p>
316 </p>
317 <p>
318 These examples are designed to trace a single process. They run until
319 interrupted, or the monitored process exits, or the limit as given
320 in an optional 'maximum count' argument has been reached.
321 </p>
322 </div>
323 <div class="sect2" lang="en" xml:lang="en">
324 <div class="titlepage">
325 <div>
326 <div>
327 <h3 class="title"><a id="program_perfmon_probes"></a>Performance Events Reference</h3>
328 </div>
329 </div>
330 </div>
331 <p>
332 The events are described below as if they were functions with ANSI C-style
333 signatures. The values each event provides to DTrace or SystemTap are
334 the arguments to the functions.
335 </p>
336 <p>
337
338 </p>
339 <div class="variablelist">
340 <dl>
341 <dt>
342 <span class="term">
343 alloc
344 </span>
345 </dt>
346 <dd>
347 <p>
348 The alloc class covers the allocation of "on disk" database pages.
349 </p>
350 <div class="variablelist">
351 <dl>
352 <dt>
353 <span class="term">alloc-new (char *file, char *db, unsigned pgno, unsigned type,
354 struct _db_page *pg, int ret);
355 </span>
356 </dt>
357 <dd>
358 An attempt to allocate a database page of type 'type' for database 'db'
359 returned 'ret'. If the allocation succeeded then ret is 0, pgno is the
360 location of the new page, and pg is the address of the new page.
361 Details of the page can be extracted from the pg pointer.
362 </dd>
363 <dt>
364 <span class="term">
365 alloc-free (char *file, char *db, unsigned pgno, unsigned ret);
366 </span>
367 </dt>
368 <dd>
369 An attempt to free the page 'pgno' of 'db' returned 'ret'.
370 When successful the page is returned to the free list
371 or the file is truncated.
372 </dd>
373 <dt>
374 <span class="term">alloc-btree_split (char *file, char *db, unsigned pgno, unsigned parent,
375 unsigned level);
376 </span>
377 </dt>
378 <dd>
379 A btree split of pgno in db is being attempted. The parent page number
380 and the level in the btree are also provided.
381 </dd>
382 </dl>
383 </div>
384 </dd>
385 <dt>
386 <span class="term">
387 db
388 </span>
389 </dt>
390 <dd>
391 <p>
392 These DB API calls provide the name of the file and database being accessed.
393 In-memory databases will have a NULL (0) file name address. The db name will
394 be null unless subdatabases are in use.
395 </p>
396 <div class="variablelist">
397 <dl>
398 <dt>
399 <span class="term">
400 db-open (char *file, char *db, unsigned flags, uint8_t *fileid);
401 </span>
402 </dt>
403 <dd>
404 The database or file name was opened. The 20 byte unique fileid can be
405 used to keep track of databases as they are created and destroyed.
406 </dd>
407 <dt>
408 <span class="term">
409 db-close (char *file, char *db, unsigned flags, uint8_t *fileid);
410 </span>
411 </dt>
412 <dd>
413 The database or file name was closed.
414 </dd>
415 <dt>
416 <span class="term">db-cursor (char *file, char *db, unsigned txnid, unsigned flags,
417 uint8_t *fileid);
418 </span>
419 </dt>
420 <dd>
421 An attempt is being made to open a cursor on the database or file.
422 </dd>
423 <dt>
424 <span class="term">db-get (char *file, char *db, unsigned txnid, DBT *key, DBT *data,
425 unsigned flags);
426 </span>
427 </dt>
428 <dd>
429 An attempt is being made to get data from a db.
430 </dd>
431 <dt>
432 <span class="term">db-put (char *file, char *db, unsigned txnid, DBT *key, DBT *data,
433 unsigned flags);
434 </span>
435 </dt>
436 <dd>
437 An attempt is being made to put data to a db.
438 </dd>
439 <dt>
440 <span class="term">
441 db-del (char *file, char *db, unsigned txnid, DBT *key, unsigned flags);
442 </span>
443 </dt>
444 <dd>
445 An attempt is being made to delete data from a db.
446 </dd>
447 </dl>
448 </div>
449 </dd>
450 <dt>
451 <span class="term">
452 lock
453 </span>
454 </dt>
455 <dd>
456 <p>
457 The lock class monitors the transactional consistency locks: page, record,
458 and database. It also monitors the non-transactional file handle locks.
459 </p>
460 <div class="variablelist">
461 <dl>
462 <dt>
463 <span class="term">
464 lock-suspend (DBT *lock, db_lockmode_t lock_mode);
465 </span>
466 </dt>
467 <dd>
468 The thread is about to suspend itself because another locker already has
469 a conflicting lock on object 'lock'. The lock DBT's data points to
470 a __db_ilock structure, except for the atypical program which uses
471 application specific locking.
472 </dd>
473 <dt>
474 <span class="term">
475 lock-resume (DBT *lock, db_lockmode_t lock_mode);
476 </span>
477 </dt>
478 <dd>
479 The thread is awakening from a suspend.
480 </dd>
481 <dt>
482 <span class="term">
483 lock-put (struct __sh_dbt *lock, unsigned flags);
484 </span>
485 </dt>
486 <dd>
487 The lock is being freed.
488 </dd>
489 <dt>
490 <span class="term">
491 lock-put_reduce_count (struct __sh_dbt *lock, unsigned flags);
492 </span>
493 </dt>
494 <dd>
495 The lock would have been freed except that its refcount was greater
496 than 1.
497 </dd>
498 </dl>
499 </div>
500 <p>
501 These lock counters are included by --enable-perfmon-statistics.
502 </p>
503 <div class="variablelist">
504 <dl>
505 <dt>
506 <span class="term">lock-deadlock (unsigned st_ndeadlocks, unsigned locker_id,
507 struct __sh_dbt *lock_obj);
508 </span>
509 </dt>
510 <dd>
511 The locker_id's lock request in lock_obj is about to be aborted in
512 order to resolve a deadlock. The lock region's st_ndeadlocks has
513 been incremented.
514 </dd>
515 <dt>
516 <span class="term">
517 lock-nowait_notgranted (unsigned count, DBT *lock, unsigned locker_id);
518 </span>
519 </dt>
520 <dd>
521 A DB_LOCK_NOWAIT lock request by locker_id would have had to wait.
522 The lock regions's st_lock_nowait has been incremented and
523 the request returns DB_LOCK_NOTGRANTED.
524 </dd>
525 <dt>
526 <span class="term">
527 lock-steal (unsigned st_locksteals, unsigned from, unsigned to);
528 </span>
529 </dt>
530 <dd>
531 A lock is being stolen from one partition for another one.
532 The 'from' lock partition's st_locksteals has been incremented.
533 </dd>
534 <dt>
535 <span class="term">
536 lock-object_steal (unsigned st_objectsteals, unsigned from, unsigned to);
537 </span>
538 </dt>
539 <dd>
540 A lock object is being stolen from one partition for another one.
541 The 'from' lock partition's st_objectsteals has been incremented.
542 </dd>
543 <dt>
544 <span class="term">
545 lock-locktimeout (unsigned st_nlocktimeouts, const DBT *lock);
546 </span>
547 </dt>
548 <dd>
549 A lock wait expired due to the lock request timeout.
550 </dd>
551 <dt>
552 <span class="term">
553 lock-txntimeout (unsigned st_ntxntimeouts, const DBT *lock);
554 </span>
555 </dt>
556 <dd>
557 A lock wait expired due to the transaction's timeout.
558 </dd>
559 <dt>
560 <span class="term">
561 lock-nlockers (unsigned active, unsigned locker_id);
562 </span>
563 </dt>
564 <dd>
565 The allocation or deallocation of the locker id changed the number
566 of active locker identifiers.
567 </dd>
568 <dt>
569 <span class="term">
570 lock-maxnlockers (unsigned new_max_active, unsigned locker_id);
571 </span>
572 </dt>
573 <dd>
574 The allocation of the locker id set a new maximum
575 number of active locker identifiers.
576 </dd>
577 </dl>
578 </div>
579 </dd>
580 <dt>
581 <span class="term">
582 mpool
583 </span>
584 </dt>
585 <dd>
586 <p>
587 The mpool class monitors the allocation and management of memory,
588 including the cache.
589 </p>
590 <div class="variablelist">
591 <dl>
592 <dt>
593 <span class="term">
594 mpool-read (char *file, unsigned pgno, struct __bh *buf);
595 </span>
596 </dt>
597 <dd>
598 Read a page from file into buf.
599 </dd>
600 <dt>
601 <span class="term">
602 mpool-write (char *file, unsigned pgno, struct __bh *buf);
603 </span>
604 </dt>
605 <dd>
606 Write a page from buf to file.
607 </dd>
608 <dt>
609 <span class="term">
610 mpool-env_alloc (unsigned size, unsigned region_id, unsigned reg_type);
611 </span>
612 </dt>
613 <dd>
614 This is an attempt to allocate size bytes from region_id.
615 The reg_type is one of the reg_type_t enum values.
616 </dd>
617 <dt>
618 <span class="term">
619 mpool-evict (char *file, unsigned pgno, struct __bh *buf);
620 </span>
621 </dt>
622 <dd>
623 The page is about to be removed from the cache.
624 </dd>
625 <dt>
626 <span class="term">mpool-alloc_wrap (unsigned alloc_len, int region_id, int wrap_count,
627 int put_counter);
628 </span>
629 </dt>
630 <dd>
631 The memory allocator has incremented wrap_count after searching through
632 the entire region without being able to fulfill the request for
633 alloc_len bytes. As wrap_count increases the library makes more effort
634 to allocate space.
635 </dd>
636 </dl>
637 </div>
638 <p>
639 These mpool counters are included by --enable-perfmon-statistics.
640 </p>
641 <div class="variablelist">
642 <dl>
643 <dt>
644 <span class="term">
645 mpool-clean_eviction (unsigned st_ro_evict, unsigned region_id);
646 </span>
647 </dt>
648 <dd>
649 The eviction of a clean page from a cache incremented st_ro_evict.
650 </dd>
651 <dt>
652 <span class="term">
653 mpool-dirty_eviction (unsigned st_rw_evict, unsigned region_id);
654 </span>
655 </dt>
656 <dd>
657 The eviction of a dirty page from a cache incremented st_rw_evict.
658 The page has already been written out.
659 </dd>
660 <dt>
661 <span class="term">
662 mpool-fail (unsigned failure_count, unsigned alloc_len, unsigned region_id);
663 </span>
664 </dt>
665 <dd>
666 An attempt to allocate memory from region_id failed.
667 </dd>
668 <dt>
669 <span class="term">
670 mpool-hash_search (unsigned st_hash_searches, char *file, unsigned pgno);
671 </span>
672 </dt>
673 <dd>
674 A search for pgno of file incremented st_hash_searches.
675 </dd>
676 <dt>
677 <span class="term">
678 mpool-hash_examined (unsigned st_hash_examined, char *file, unsigned pgno);
679 </span>
680 </dt>
681 <dd>
682 A search for pgno of file increased st_hash_examined by the number
683 of hash buckets examined.
684 </dd>
685 <dt>
686 <span class="term">
687 mpool-hash_longest (unsigned st_hash_longest, char *file, unsigned pgno);
688 </span>
689 </dt>
690 <dd>
691 A search for pgno of file set a new maximum st_hash_longest value.
692 </dd>
693 <dt>
694 <span class="term">
695 mpool-map (unsigned st_map, char *file, unsigned pgno);
696 </span>
697 </dt>
698 <dd>
699 A file's st_map count was incremented after a page was mapped into
700 memory. The mapping might have caused disk I/O.
701 </dd>
702 <dt>
703 <span class="term">
704 mpool-hit (unsigned st_cache_hit, char *file, unsigned pgno);
705 </span>
706 </dt>
707 <dd>
708 The hit count was incremented because pgno from file was found
709 in the cache.
710 </dd>
711 <dt>
712 <span class="term">
713 mpool-miss (unsigned st_cache_miss, char *file, unsigned pgno);
714 </span>
715 </dt>
716 <dd>
717 The miss count was incremented because pgno from file was
718 not already present in the cache.
719 </dd>
720 <dt>
721 <span class="term">
722 mpool-page_create (unsigned st_page_create, char *file, unsigned pgno);
723 </span>
724 </dt>
725 <dd>
726 The st_page_create field was incremented because
727 the pgno of file was created in the cache.
728 </dd>
729 <dt>
730 <span class="term">
731 mpool-page_in (unsigned st_page_in, char *file, unsigned pgno);
732 </span>
733 </dt>
734 <dd>
735 The st_page_in field was incremented because
736 the pgno from file was read into the cache.
737 </dd>
738 <dt>
739 <span class="term">
740 mpool-page_out (unsigned st_page_out, char *file, unsigned pgno);
741 </span>
742 </dt>
743 <dd>
744 The st_page_out field was incremented because
745 the pgno from file was written out.
746 </dd>
747 </dl>
748 </div>
749 </dd>
750 <dt>
751 <span class="term">
752 mutex
753 </span>
754 </dt>
755 <dd>
756 <p>
757 The mutex category monitors includes shared latches. The alloc_id value
758 is one of the MTX_XXX definitions from dbinc/mutex.h
759 </p>
760 <div class="variablelist">
761 <dl>
762 <dt>
763 <span class="term">mutex-suspend (unsigned mutex, unsigned excl, unsigned alloc_id,
764 struct __db_mutex_t *mutexp);
765 </span>
766 </dt>
767 <dd>
768 This thread is about to suspend itself because a thread has the
769 mutex or shared latch locked in a mode which conflicts with the
770 this request.
771 </dd>
772 <dt>
773 <span class="term">mutex-resume (unsigned mutex, unsigned excl, unsigned alloc_id,
774 struct __db_mutex_t *mutexp);
775 </span>
776 </dt>
777 <dd>
778 The thread is returning from a suspend and will attempt to obtain
779 the mutex or shared latch again. It might need to suspend again.
780 </dd>
781 </dl>
782 </div>
783 <p>
784 These mutex counters are included by --enable-perfmon-statistics.
785 </p>
786 <div class="variablelist">
787 <dl>
788 <dt>
789 <span class="term">
790 mutex-set_nowait (unsigned mutex_set_nowait, unsigned mutex);
791 </span>
792 </dt>
793 <dd>
794 Increment the count of times that the mutex was free when trying
795 to lock it.
796 </dd>
797 <dt>
798 <span class="term">
799 mutex-set_wait (unsigned mutex_set_wait, unsigned mutex);
800 </span>
801 </dt>
802 <dd>
803 Increment the count of times that the mutex was busy when trying
804 to lock it.
805 </dd>
806 <dt>
807 <span class="term">
808 mutex-set_rd_nowait (unsigned mutex_set_rd_nowait, unsigned mutex);
809 </span>
810 </dt>
811 <dd>
812 Increment the count of times that the shared latch was free
813 when trying to get a shared lock on it.
814 </dd>
815 <dt>
816 <span class="term">
817 mutex-set_rd_wait (unsigned mutex_set_rd_wait, unsigned mutex);
818 </span>
819 </dt>
820 <dd>
821 Increment the count of times that the shared latch was already
822 exclusively latched when trying to get a shared lock on it.
823 </dd>
824 <dt>
825 <span class="term">
826 mutex-hybrid_wait (unsigned hybrid_wait, unsigned mutex);
827 </span>
828 </dt>
829 <dd>
830 Increment the count of times that a hybrid mutex had to block
831 on its condition variable. n a busy system this might happen
832 several times before the corresponding hybrid_wakeup.
833 </dd>
834 <dt>
835 <span class="term">
836 mutex-hybrid_wakeup (unsigned hybrid_wakeup, unsigned mutex);
837 </span>
838 </dt>
839 <dd>
840 Increment the count of times that a hybrid mutex finished
841 one or more waits for its condition variable.
842 </dd>
843 </dl>
844 </div>
845 </dd>
846 <dt>
847 <span class="term">
848 txn
849 </span>
850 </dt>
851 <dd>
852 <p>
853 The txn category covers the basic transaction operations.
854 </p>
855 <div class="variablelist">
856 <dl>
857 <dt>
858 <span class="term">
859 txn-begin (unsigned txnid, unsigned flags);
860 </span>
861 </dt>
862 <dd>
863 A transaction was successfully begun.
864 </dd>
865 <dt>
866 <span class="term">
867 txn-commit (unsigned txnid, unsigned flags);
868 </span>
869 </dt>
870 <dd>
871 A transaction is starting to commit.
872 </dd>
873 <dt>
874 <span class="term">
875 txn-prepare (unsigned txnid, uint8_t *gid);
876 </span>
877 </dt>
878 <dd>
879 The transaction is starting to prepare, flushing the log
880 so that a future commit can be guaranteed to succeed.
881 The global identifier field is 128 bytes long.
882 </dd>
883 <dt>
884 <span class="term">
885 txn-abort (unsigned txnid);
886 </span>
887 </dt>
888 <dd>
889 The transaction is about to abort.
890 </dd>
891 </dl>
892 </div>
893 <p>
894 These txn counters are included by --enable-perfmon-statistics.
895 </p>
896 <div class="variablelist">
897 <dl>
898 <dt>
899 <span class="term">
900 txn-nbegins (unsigned st_nbegins, unsigned txnid);
901 </span>
902 </dt>
903 <dd>
904 Beginning the transaction incremented st_nbegins.
905 </dd>
906 <dt>
907 <span class="term">
908 txn-naborts (unsigned st_nbegins, unsigned txnid);
909 </span>
910 </dt>
911 <dd>
912 Aborting the transaction incremented st_naborts.
913 </dd>
914 <dt>
915 <span class="term">
916 txn-ncommits (unsigned st_ncommits, unsigned txnid);
917 </span>
918 </dt>
919 <dd>
920 Committing the transaction incremented st_ncommits.
921 </dd>
922 <dt>
923 <span class="term">
924 txn-nactive (unsigned st_nactive, unsigned txnid);
925 </span>
926 </dt>
927 <dd>
928 Beginning or ending the transaction updated the number of active
929 transactions.
930 </dd>
931 <dt>
932 <span class="term">
933 txn-maxnactive (unsigned st_maxnactive, unsigned txnid);
934 </span>
935 </dt>
936 <dd>
937 The creation of the transaction set a new maximum number
938 of active transactions.
939 </dd>
940 </dl>
941 </div>
942 </dd>
943 </dl>
944 </div>
945 <p>
946
947 </p>
948 </div>
949 </div>
950 <div class="navfooter">
951 <hr />
952 <table width="100%" summary="Navigation footer">
953 <tr>
954 <td width="40%" align="left"><a accesskey="p" href="program_runtime.html">Prev</a> </td>
955 <td width="20%" align="center">
956 <a accesskey="u" href="program.html">Up</a>
957 </td>
958 <td width="40%" align="right"> <a accesskey="n" href="program_faq.html">Next</a></td>
959 </tr>
960 <tr>
961 <td width="40%" align="left" valign="top">Run-time configuration </td>
962 <td width="20%" align="center">
963 <a accesskey="h" href="index.html">Home</a>
964 </td>
965 <td width="40%" align="right" valign="top"> Programmer notes FAQ</td>
966 </tr>
967 </table>
968 </div>
969 </body>
970 </html>