source: trunk/server/lib/tdb/docs/tracing.txt

Last change on this file was 414, checked in by Herwig Bauernfeind, 16 years ago

Samba 3.5.0: Initial import

File size: 1.9 KB
Line 
1How And Why To Use TDB Tracing
2==============================
3
4You can trace all TDB operations, using TDB_TRACE. It is not complete
5(error conditions which expect to the logged will not always be traced
6correctly, so you should set up a logging function too), but is designed
7to collect benchmark-style traces to allow us to optimize TDB.
8
9Note: tracing is not efficient, and the trace files are huge: a
10traverse of the database is particularly large! But they compress very
11well with rzip (http://rzip.samba.org)
12
13How to gather trace files:
14--------------------------
151) Uncomment /* #define TDB_TRACE 1 */ in tdb_private.h.
162) Rebuild TDB, and everything that uses it.
173) Run something.
18
19Your trace files will be called <tdbname>.trace.<pid>. These files
20will not be overwritten: if the same process reopens the same TDB, an
21error will be logged and tracing will be disabled.
22
23How to replay trace files:
24--------------------------
251) For benchmarking, remember to rebuild tdb with #define TDB_TRACE commented
26 out again!
272) Grab the latest "replace_trace.c" from CCAN's tdb module (tools/ dir):
28 http://ccan.ozlabs.org/tarballs/tdb.tar.bz2
293) Compile up replay_trace, munging as necessary.
304) Run replay_trace <scratch-tdb-name> <tracefiles>...
31
32If given more than one trace file (presumably from the same tdb)
33replay_trace will try to figure out the dependencies between the operations
34and fire off a child to run each trace. Occasionally it gets stuck, in
35which case it will add another dependency and retry. Eventually it will
36give a speed value.
37
38replay_trace can intuit the existence of previous data in the tdb (ie.
39activity prior to the trace(s) supplied) and will prepopulate as
40neccessary.
41
42You can run --quiet for straight benchmark results, and -n to run multiple
43times (this saves time, since it need only calculate dependencies once).
44
45Good luck!
46Rusty Russell <rusty@rustcorp.com.au>
Note: See TracBrowser for help on using the repository browser.