mysql_debug
You are viewing an old version of this article. View
the current version here.
構文
void mysql_debug(const char * debug);
debug- デバッグ対象の文字列。詳細は下記。
Description
Fred Fishのデバッグライブラリを利用することで、開発のためのデバッグを可能にします。 この機能を利用するためには、mariadbのクライアントライブラリがデバッグ有効の状態でコンパイルされている必要があります。
戻り値はありません。
デバッグされる文字列は、以下のようにフィールドがコロンで分割されて出力されます。
フィールド1:フィールド2:フィールドn
それぞれのフィールドはフラグ文字を含みます。オプションでカンマおよびカンマ区切りのmodifierを出力できます。
フラグ[,modifier,modifier,...,modifier]
現在認識されるフラグ文字は下記です。
| オプション | 説明 |
|---|---|
| d | DEBUG_マクロからの出力を可能にします。DEBUG_マクロ専用の出力を選択するキーワード一覧に従う可能性があります。nullのキーワード一覧は全てのマクロに対する出力を示しています。 |
| D | 各デバッガによる出力を遅延させます。マシンの能力によりますが、基本引数は10秒単位で指定します。例 -D,20 とすると20秒出力を遅延させます。 |
| f | デバッグ、トレース、名前の付いた関数の一覧に対するプロファイリングを制限します。nullリストが表示される時は、全ての関数に対するデバッグを無効化するという意味です。適切なdやtフラグが指定される必要があります。fフラグは、dやtフラグが有効担っている場合、それらの機能性を制限するだけです。 |
The appropriate "d" or "t" flags must still be given, this flag only limits their actions if they are enabled. |
| F | デバッグもしくはトレースしたいソースコードのファイル名を指定します。 |
| i | デバッグもしくはトレースしたいプロセスのIDを指定します。 |
| g | プロファイリングが可能になります。生成されるdbugmon.outというファイルには、プログラムを分析するための情報が含まれています。実行時に関数のプロファイリング専用のキーワードリストが表示されます。nullリストが表示される場合は、全ての関数がプロファイリング対象になることを示唆しています。 |
May be followed by a list of keywords that select profiling only for the functions in that list. |
| L | デバッグやトレース出力の対象となるソースファイルの行番号を指定します。 |
| n | デバッグやトレース出力の対象となる各行に対して、その行が存在する関数のネストの深さを表示します。 |
| N | デバッグ出力される行数を指定します。 |
| o | デバッグの出力を特定のファイルにリダイレクトします。デフォルトの出力は標準エラー出力です。 |
| O | As O but the file is really flushed between each write. When needed the file is closed and reopened between each write. |
| p | Limit debugger actions to specified processes. A process must be identified with the DBUG_PROCESS macro and match one in the list for debugger actions to occur. |
| P | デバッグもしくはトレースで出力している際のプロセス名を出力します。 |
| r | When pushing a new state, do not inherit the previous state's function nesting level. Useful when the output is to start at the left margin. |
| S | Do function _sanity(_file_,_line_) at each debugged function until _sanity() returns something that differs from 0. (Mostly used with safemalloc) |
| t | Enable function call/exit trace lines. May be followed by a list (containing only one modifier) giving a numeric maximum trace level, beyond which no output will occur for either debugging or tracing macros. The default is a compile time option. |
mysql_debug()の機能を利用する代わりに、環境変数MYSQL_DEBUGを設定することでもデバッグが可能です。
デバッグを有効化すると、巨大なデバッグファイルを生成されるため、全体的なパフォーマンスが劣化します。特定のケースのみでデバッグ情報を必要とする場合、mysql_debug_end()を使ってデバッグ情報の生成を無効化できます。
合わせて読む
- mysql_debug_end()
- mysql_dump_debug_info()
Comments
Comments loading...
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.