Module pulse

A User Level Scheduler of Erlang resulting from the ProTest project.

Version: 1.36.1

Description

A User Level Scheduler of Erlang resulting from the ProTest project. Copyright Developer Team, see licence conditions

Function Index

format/1Equivalent to format(Fmt, []).
format/2Syncronized io:format.
get_events/0Obtain the events that pulse has used for scheduling processes.
get_schedule/0Obtain the schedule that pulse has used for scheduling processes.
get_seed/0Obtain the seed that the scheduler uses for scheduling processes.
import_process/1When executed by a process not managed by PULSE, this function makes PULSE adopt the process as one of its own.
import_process/2
rerun/0Run the same function as before scheduled by pulse.
rerun_counterexample/2Re-run the last counterexample found by QuickCheck (counterexample returned by eqc:counterexample/0) with verbosity as specified in first argument.
rerun_counterexample/3Re-run the counterexample for the property with verbosity as specified in first argument.
rerun_verbose/1Run the same function as before scheduled by pulse with verbosity set as in the function verbose.
run/1Equivalent to run(Fun, []).
run/2Run a function scheduled by pulse.
run_with_schedule/2(Deprecated.)
run_with_seed/2(Deprecated.)
seed/0Seed generator to be used in combination with for example the seed option in run/2.
set_schedule/1(Deprecated.)
set_seed/1(Deprecated.)
start/0Start pulse as an application, it consists of a supervisor tree with an event manager and the pulse process.
stop/0Stop pulse application.
verbose/1Set verbose mode of all attached event handlers to items given as arguments.

Function Details

format/1

format(Fmt) -> any()

Equivalent to format(Fmt, []).

format/2

format(Fmt, Args) -> any()

Syncronized io:format. The normal io:format/2 function is a side-effect function and using it for printing debug statements does not work particularly well. When using print commands for debugging in a PULSE context, one should use this format function instead. Note that the printed commands only become visible when the format option is passed to the verbose/1 function.

get_events/0

get_events() -> events()

Obtain the events that pulse has used for scheduling processes

get_schedule/0

get_schedule() -> schedule()

Obtain the schedule that pulse has used for scheduling processes

get_seed/0

get_seed() -> {nat(), nat(), nat()}

Obtain the seed that the scheduler uses for scheduling processes

import_process/1

import_process(NameHint) -> any()

When executed by a process not managed by PULSE, this function makes PULSE adopt the process as one of its own. The typical use case is when you have control over (and can instrument) the code executed by a process, but not the code that is spawning the process.

import_process/2

import_process(NameHint, Pid) -> any()

rerun/0

rerun() -> term()

Run the same function as before scheduled by pulse. The result of the scheduled run is one of the possible outcomes of running the function without the scheduler. In this way one need not copy the function to the scheduling process each time.

rerun_counterexample/2

rerun_counterexample(FlagList::[atom()], Property::property()) -> any()

Re-run the last counterexample found by QuickCheck (counterexample returned by eqc:counterexample/0) with verbosity as specified in first argument. Uses eqc:check/2 to re-evaluate the property.

rerun_counterexample/3

rerun_counterexample(FlagList::[atom()], Property::property(), Example::counterexample()) -> any()

Re-run the counterexample for the property with verbosity as specified in first argument. Uses eqc:check/2 to re-evaluate the property.

rerun_verbose/1

rerun_verbose(FlagList::[atom()]) -> term()

Run the same function as before scheduled by pulse with verbosity set as in the function verbose. The verbosity is only changed during the rerun. The result of the scheduled run is one of the possible outcomes of running the function without the scheduler. In this way one need not copy the function to the scheduling process each time.

run/1

run(Fun::function()) -> term()

Equivalent to run(Fun, []).

run/2

run(Fun::function(), Options::proplist()) -> term()

Run a function scheduled by pulse. The result of the scheduled run is one of the possible outcomes of running the function without the scheduler. The following options can be provided:

seed
Specify the seed to generate the random schedule with. If not provided, pulse uses a random seed
schedule
One can save a schedule and run the code with that schedule.
run_timeout
Deadlock is detected after a certain period of non-activity in the scheduling process. This period is default set to 30 seconds, but can be increased or decreased with this option.

run_with_schedule/2

run_with_schedule(Fun::function(), Schedule::schedule()) -> term()

This function is deprecated: use schedule options in run/2 instead.

run_with_seed/2

run_with_seed(Fun::function(), Seed::seed()) -> term()

This function is deprecated: use seed options in run/2 instead.

seed/0

seed() -> gen(seed())

Seed generator to be used in combination with for example the seed option in run/2. The idea is to have QuickCheck generate a seed with this generator and pass this on to pulse.

set_schedule/1

set_schedule(Schedule::schedule()) -> schedule()

This function is deprecated: use schedule options in run/2 instead.

set_seed/1

set_seed(X1) -> any()

This function is deprecated: use seed options in run/2 instead.

start/0

start() -> {ok, Pid} | error

Start pulse as an application, it consists of a supervisor tree with an event manager and the pulse process. One can add event handlers dynamically

stop/0

stop() -> ok

Stop pulse application.

verbose/1

verbose(FlagList::[atom()]) -> [atom()]

Set verbose mode of all attached event handlers to items given as arguments. We support flags similar to those in erlang:trace/3.

all
Set all pulse flags and therewith show all pulse events.
send
Show sending of messages.
'receive'
Show receiving and delivery of messages.
procs
Show process related events: spawn, exit, register, unregister, link, unlink.
side_effect
Show side effects. Specify which function calls are side effects when instrumenting the code (see pulse_instrument).
format
Visualize the calls to format/2 in the verbose output.

The function returns the verbosity settings as they were before changing them (in order to be able to change them back).


Generated by EDoc, Sep 11 2015, 13:38:08.