anchor.diff:  	colls = lists:duplicate(1 + length(Header#print.colls), 45),
   	cr    = lists:duplicate(1 + length(Header#print.cr),    45),
   	time  = lists:duplicate(1 + length(Header#print.time),  45),
  -	dtr   = lists:duplicate(1 + length(Header#print.dtr),   45)
  +	dtr   = lists:duplicate(1 + length(Header#print.dtr),   45),
  +	hist  = lists:duplicate(1 + length(Header#print.hist),  45)
       },
       print_lock(Header, Opts),
       print_lock(Divider, Opts),
       ok.
   
   
  -print_lock(L, Opts) -> print_lock(L, Opts, []).
  -print_lock(_, [],  Formats) -> print(strings(lists:reverse(Formats)));
  -print_lock(L, [Opt|Opts], Formats) ->
  +print_lock(L, Opts) ->
  +    print(strings(format_lock(L, Opts))).
  +
  +format_lock(_, []) -> [];
  +format_lock(L, [Opt|Opts]) ->
       case Opt of
  -	id            -> print_lock(L, Opts, [{space, 25, s(L#print.id)   } | Formats]);
  -	{id, W}       -> print_lock(L, Opts, [{space,  W, s(L#print.id)   } | Formats]);
  -	type          -> print_lock(L, Opts, [{space, 18, s(L#print.type) } | Formats]);
  -	{type, W}     -> print_lock(L, Opts, [{space,  W, s(L#print.type) } | Formats]);
  -	entry         -> print_lock(L, Opts, [{space, 30, s(L#print.entry)} | Formats]);
  -	{entry, W}    -> print_lock(L, Opts, [{space,  W, s(L#print.entry)} | Formats]);
  -	name          -> print_lock(L, Opts, [{space, 22, s(L#print.name) } | Formats]);
  -	{name, W}     -> print_lock(L, Opts, [{space,  W, s(L#print.name) } | Formats]);
  -	tries         -> print_lock(L, Opts, [{space, 12, s(L#print.tries)} | Formats]);
  -	{tries, W}    -> print_lock(L, Opts, [{space,  W, s(L#print.tries)} | Formats]);
  -	colls         -> print_lock(L, Opts, [{space, 14, s(L#print.colls)} | Formats]);
  -	{colls, W}    -> print_lock(L, Opts, [{space,  W, s(L#print.colls)} | Formats]);
  -	ratio         -> print_lock(L, Opts, [{space, 20, s(L#print.cr)   } | Formats]);
  -	{ratio, W}    -> print_lock(L, Opts, [{space,  W, s(L#print.cr)   } | Formats]);
  -	time          -> print_lock(L, Opts, [{space, 15, s(L#print.time) } | Formats]);
  -	{time, W}     -> print_lock(L, Opts, [{space,  W, s(L#print.time) } | Formats]);
  -	duration      -> print_lock(L, Opts, [{space, 20, s(L#print.dtr)  } | Formats]);
  -	{duration, W} -> print_lock(L, Opts, [{space,  W, s(L#print.dtr)  } | Formats]);
  -	_             -> print_lock(L, Opts, Formats)
  +	id             -> [{space, 25, s(L#print.id)   } | format_lock(L, Opts)];
  +	{id, W}        -> [{space,  W, s(L#print.id)   } | format_lock(L, Opts)];
  +	type           -> [{space, 18, s(L#print.type) } | format_lock(L, Opts)];
  +	{type, W}      -> [{space,  W, s(L#print.type) } | format_lock(L, Opts)];
  +	entry          -> [{space, 30, s(L#print.entry)} | format_lock(L, Opts)];
  +	{entry, W}     -> [{space,  W, s(L#print.entry)} | format_lock(L, Opts)];
  +	name           -> [{space, 22, s(L#print.name) } | format_lock(L, Opts)];
  +	{name, W}      -> [{space,  W, s(L#print.name) } | format_lock(L, Opts)];
  +	tries          -> [{space, 12, s(L#print.tries)} | format_lock(L, Opts)];
  +	{tries, W}     -> [{space,  W, s(L#print.tries)} | format_lock(L, Opts)];
  +	colls          -> [{space, 14, s(L#print.colls)} | format_lock(L, Opts)];
  +	{colls, W}     -> [{space,  W, s(L#print.colls)} | format_lock(L, Opts)];
  +	ratio          -> [{space, 20, s(L#print.cr)   } | format_lock(L, Opts)];
  +	{ratio, W}     -> [{space,  W, s(L#print.cr)   } | format_lock(L, Opts)];
  +	time           -> [{space, 15, s(L#print.time) } | format_lock(L, Opts)];
  +	{time, W}      -> [{space,  W, s(L#print.time) } | format_lock(L, Opts)];
  +	duration       -> [{space, 20, s(L#print.dtr)  } | format_lock(L, Opts)];
  +	{duration, W}  -> [{space,  W, s(L#print.dtr)  } | format_lock(L, Opts)];
  +	histogram      -> [{space,  0, s(L#print.hist) } | format_lock(L, Opts)];
  +	{histogram, W} -> [{space,  W, s(L#print.hist) } | format_lock(L, Opts)];
  +	_              ->                                  format_lock(L, Opts)
       end.
   
  -print_state_information(#state{ locks = Locks} = State) ->
  +print_state_information(#state{locks = Locks} = State) ->
       Stats = summate_locks(Locks),
       print("information:"),
       print(kv("#locks",          s(length(Locks)))),
  
positive.code: locks_ids([], Out) -> Out;
  locks_ids([#lock{ name = Key } = L|Ls], Out) ->
      case proplists:get_value(Key, Out) of
  	undefined ->
  	    locks_ids(Ls, [{Key, [L#lock.id] } | Out]);
  	Ids ->
  	    locks_ids(Ls, [{Key, [L#lock.id | Ids] } | proplists:delete(Key,Out)])
      end.
  
  stats2print(Stats, Duration) ->
      lists:map(fun
  	(S) ->
  	    #print{
  		entry = term2string("~tp:~p", [S#stats.file, S#stats.line]),
  		colls = S#stats.colls,
  		tries = S#stats.tries,
  		cr    = percent(S#stats.colls, S#stats.tries),
  		time  = S#stats.time,
  		dtr   = percent(S#stats.time,  Duration)
  	    }
  	end, Stats).
  
  locks2print(Locks, Duration) ->
      lists:map( fun
  	(L) ->
  	    Tries = lists:sum([T || #stats{ tries = T} <- L#lock.stats]),
  	    Colls = lists:sum([C || #stats{ colls = C} <- L#lock.stats]),
  	    Time  = lists:sum([T || #stats{ time  = T} <- L#lock.stats]),
  	    Cr    = percent(Colls, Tries),
  	    Dtr   = percent(Time,  Duration),
  	    #print{
  		name  = L#lock.name,
  		id    = L#lock.id,
  		type  = L#lock.type,
  		tries = Tries,
  		colls = Colls,
  		cr    = Cr,
  		time  = Time,
  		dtr   = Dtr
  	    }
  	end, Locks).
  
  %% state making
  
  
negative.code:     TLs = threshold_locks(PLs, proplists:get_value(thresholds, Opts, [])),
      SLs =      sort_locks(TLs, proplists:get_value(sort,       Opts, time)),
      CLs =       cut_locks(SLs, proplists:get_value(max_locks,  Opts, none)),
  	    reverse_locks(CLs, not proplists:get_value(reverse,Opts, false)).
  
  sort_locks(Locks, name)  -> lists:keysort(#print.name, Locks);
  sort_locks(Locks, id)    -> lists:keysort(#print.id, Locks);
  sort_locks(Locks, type)  -> lists:keysort(#print.type, Locks);
  sort_locks(Locks, tries) -> lists:keysort(#print.tries, Locks);
  sort_locks(Locks, colls) -> lists:keysort(#print.colls, Locks);
  sort_locks(Locks, ratio) -> lists:keysort(#print.cr, Locks);
  sort_locks(Locks, time)  -> lists:keysort(#print.time, Locks);
  sort_locks(Locks, _)     -> sort_locks(Locks, time).
  
  % cut locks not above certain thresholds
  threshold_locks(Locks, Thresholds) ->
  