anchor.diff:  
   
   %% @private
  -ensure_started([App|R]) ->
  -    case application:start(App) of
  -        ok -> ensure_started(R);
  -        {error, {already_started, App}} -> ensure_started(R)
  -    end;
  -ensure_started([]) ->
  -    ok.
  -   
  -
  -%% @private
   -spec profile_output() -> 
       ok.
   
  
positive.code: 
  -include("nksip.hrl").
  
  
  
  %% ===================================================================
  %% Private
  
negative.code:     eprof:analyze(total).
  
  
  %% @doc Ensure that an application and all of its transitive
  %% dependencies are started.
  ensure_all_started(Application, Type) ->
      case ensure_all_started(Application, Type, []) of
          {ok, Started} ->
              {ok, lists:reverse(Started)};
          {error, Reason, Started} ->
              [ application:stop(App) || App <- Started ],
              {error, Reason}
      end.
  
  ensure_all_started(Application, Type, Started) ->
      case application:start(Application, Type) of
          ok ->
              {ok, [Application | Started]};
          {error, {already_started, Application}} ->
              {ok, Started};
          {error, {not_started, Dependency}} ->
              case ensure_all_started(Dependency, Type, Started) of
                  {ok, NewStarted} ->
                      ensure_all_started(Application, Type, NewStarted);
                  Error ->
                      Error
              end;
          {error, Reason} ->
              {error, Reason, Started}
      end.
  