anchor.diff:  -include("ns_common.hrl").
   
   -include("ns_stats.hrl").
  -
  --define(MAIN_BEAM_NAME, <<"(main)beam.smp">>).
   
   -define(ETS_LOG_INTVL, 180).
   
  
positive.code:                          LocalDiff = CPULocalMS - OldCPULocal,
                           IdleDiff = CPUIdleMS - OldCPUIdle,
  
                           MajorFaults = beam_stat(major_faults, NowSamplesProcs, 0),
                           MinorFaults = beam_stat(minor_faults, NowSamplesProcs, 0),
                           PageFaults = beam_stat(page_faults, NowSamplesProcs, 0),
  
                           RV1 = misc:update_proplist(RawStatsGlobal,
                                                      [{cpu_local_ms, LocalDiff},
                                                       {cpu_idle_ms, IdleDiff}]),
  
                           [{mem_free, MemActualFree},
                            {cpu_utilization_rate, try 100 * (LocalDiff - IdleDiff) / LocalDiff
                                                   catch error:badarith -> 0 end},
                            {major_faults, MajorFaults},
                            {minor_faults, MinorFaults},
                            {page_faults, PageFaults}
                            | RV1 ++ NowSamplesProcs]
                   end,
  
      {NowSamples, {RawStatsGlobal, PrevSampleProcs1}}.
  
  unpack_processes_v2(Bin, PrevSamples) ->
      BeamPid = list_to_integer(os:getpid()),
      do_unpack_processes_v2(Bin, BeamPid, {[], PrevSamples}).
  
  do_unpack_processes_v2(Bin, _, Acc) when size(Bin) =:= 0 ->
      Acc;
  do_unpack_processes_v2(Bin, BeamPid, {NewSampleAcc, PrevSampleAcc} = Acc) ->
      <<Name0:12/binary,
        CpuUtilization:32/native,
        Pid:64/native,
  
negative.code:       PageFaults:64/native,
        Rest/binary>> = Bin,
  
      Name = extract_string(Name0),
      case Name of
          <<>> ->
              Acc;
          _ ->
              NewSample0 =
                  [{proc_stat_name(Name, mem_size), MemSize},
                   {proc_stat_name(Name, mem_resident), MemResident},
  