anchor.diff:  runnable_ports(doc) ->
       ["Tests system_profiling with runnable_port."];
   runnable_ports(Config) when is_list(Config) ->
  -    ?line Pid = start_profiler_process(),
  -    ?line undefined = erlang:system_profile(Pid, [runnable_ports]),
  -    ?line EchoPid = echo(Config),
  +    Pid = start_profiler_process(),
  +    undefined = erlang:system_profile(Pid, [runnable_ports]),
  +    EchoPid = echo(Config),
       % FIXME: Set config to number_of_echos
       Laps = 10,
       put(laps, Laps),
  -    ?line ok = echo_message(EchoPid, Laps, message),
  -    ?line Events = get_profiler_events(),
  -    ?line kill_em_all = kill_echo(EchoPid),
  -    ?line erlang:system_profile(undefined, []),
  -    ?line true = has_runnable_event(Events),
  +    ok = echo_message(EchoPid, Laps, message),
  +    Events = get_profiler_events(),
  +    kill_em_all = kill_echo(EchoPid),
  +    erlang:system_profile(undefined, []),
  +    true = has_runnable_event(Events),
       Pids = sort_events_by_pid(Events),
  -    ?line ok = check_events(Pids),
  +    ok = check_events(Pids),
       erase(),
  -    ?line exit(Pid,kill),
  +    exit(Pid,kill),
       ok.
   
   scheduler(suite) ->
  
positive.code:     Laps = get(laps),
      CheckPids = get(pids),
      {Events, N} = get_pid_events(Pid),
      ?line ok = check_event_flow(Events),
      ?line ok = check_event_ts(Events),
      IsMember = lists:member(Pid, CheckPids),
      case Pid of
      	Master ->
  	    io:format("Expected ~p and got ~p profile events from ~p: ok~n", [Laps*2+2, N, Pid]),
  	    ?line N = Laps*2 + 2,
      	    check_events(Pids);
  	Pid when IsMember == true ->
  	    io:format("Expected ~p and got ~p profile events from ~p: ok~n", [Laps*2, N, Pid]),
  	    ?line N = Laps*2,
      	    check_events(Pids);
  	Pid ->
  	    check_events(Pids)
  
negative.code:     ["Tests system_profiling with scheduler."];
  scheduler(Config) when is_list(Config) ->
      case {erlang:system_info(smp_support), erlang:system_info(schedulers_online)} of
  	{false,_} -> {skipped, "No need for scheduler test when smp support is disabled."};
  	{_,    1} -> {skipped, "No need for scheduler test when only one scheduler online."};
  	_ ->
  	    Nodes = 10,
  	    ok = check_block_system(Nodes),
  	    ok = check_multi_scheduling_block(Nodes)
      end.
  
  %%% Check scheduler profiling
  
  check_multi_scheduling_block(Nodes) ->
      Pid = start_profiler_process(),
      undefined = erlang:system_profile(Pid, [scheduler]),
      {ok, Supervisor} = start_load(Nodes),
      erlang:system_flag(multi_scheduling, block),
      erlang:system_flag(multi_scheduling, unblock),
      {Pid, [scheduler]} = erlang:system_profile(undefined, []),
      Events = get_profiler_events(),
      true = has_scheduler_event(Events),
      stop_load(Supervisor),
      exit(Pid,kill),
      erase(),
      ok.
  
  check_block_system(Nodes) ->
      Dummy = spawn(?MODULE, profiler_process, [[]]),
      Pid = start_profiler_process(),
      undefined = erlang:system_profile(Pid, [scheduler]),
      {ok, Supervisor} = start_load(Nodes),
      % FIXME: remove wait !!
      wait(300),
      undefined = erlang:system_monitor(Dummy, [busy_port]),
      {Dummy, [busy_port]} = erlang:system_monitor(undefined, []),
      {Pid, [scheduler]} = erlang:system_profile(undefined, []),
      Events = get_profiler_events(),
      true = has_scheduler_event(Events),
      stop_load(Supervisor),
      exit(Pid,kill),
      exit(Dummy,kill),
      erase(),
      ok.
  
  