Method trace()
- Method
trace
inttrace(intlevel,void|stringfacility,void|intall_threads)- Description
This function changes the trace level for the subsystem identified by
facilitytolevel. Iffacilityis zero or left out, it changes the global trace level which affects all subsystems.Enabling tracing causes messages to be printed to stderr. A higher trace level includes the output from all lower levels. The lowest level is zero which disables all trace messages.
See the -t command-line option for more information.
- Parameter
level If
facilityis specified then there is typically only one trace level for it, i.e. it's an on-or-off toggle. The global trace levels, whenfacilityisn't specified, are:1Trace calls to Pike functions and garbage collector runs.
2Trace calls to builtin functions.
3Trace every interpreted opcode.
4Also trace the opcode arguments.
- Parameter
facility Valid facilities are:
"gc"Trace the doings of the garbage collector. The setting is never thread local.
levelhas two different meanings:- 1..2
Trace the start and end of each gc run.
- 3..
Additionally show info about the collected garbage, to aid hunting down garbage problems. This currently shows gc'd trampolines. Note that the output can be very bulky and is somewhat low-level technical. Also note that pike currently has to be configured with
--with-rtldebugto enable this.
- Parameter
all_threads Trace levels are normally thread local, so changes affect only the current thread. To change the level in all threads, pass a nonzero value in this argument.
- Returns
The old trace level in the current thread is returned.