MaxDB:kernel trace

From Wiki
Jump to: navigation, search
- start the slow kernel (dbmcli ... db_online -s)
- C++ Debug Output: SQL command "DIAGNOSE VTRACE TOPIC '* 10' ON"
  Instead of *, you can use one of the topics in Kernel_TraceTopics.cpp,
  e.g. ALLOCATOR, CATALOG
  Instead of 10, you can use values between 1 and 10, higher
  numbers result in more output
  You can execute several of these commands
- Pascal Debug Output: SQL command "DIAGNOSE SWITCH LAYER 'ak kb bd'
DEBUG 'ks kb bi'"
  ak kb bd means that entrance into Pascal routines in these layers
(sys/src/ak) are traced
  'ks kb bi' activates some debug output useful to understand INSERTs,
the full list can be seen
  in vut05, procedure ut05help_switch
  Each command overwrites the previous one
  

To view the trace output
- execute some SQL
- Flush the trace: dbmcli -d <dbname> -u <dbm,dbm> trace_flush  
- Create the text representation: dbmcli -d <dbname> -u <dbm,dbm>
trace_prot akbx
- Copy the text representation to a local file: dbmgetf -d <dbname> -u
<dbm,dbm> -k KNLTRCPRT -f <local file name>
  or look at <dbname>.prt in the rundirectory of the database

Because the file reserved for traces is rather small, you should extend
it by changing the kernel parameter TRACE_PAGES_US.

DanielD

Daniel has also created a python script to automate this:

http://colliertech.org/svn/mysql/maxdb/trace/

Personal tools