anchor.diff:                  PrevSample
           end,
   
  -    {NowSamplesProcs0, PrevSampleProcs1} = unpack_processes_v2(Rest, PrevSampleProcs),
  +    {NowSamplesProcs0, PrevSampleProcs1} = unpack_processes(Rest, PrevSampleProcs),
       NowSamplesProcs =
           case NowSamplesProcs0 of
               [] ->
  
positive.code:             end
      end.
  
  unpack_data_v0(Bin, PrevSample) ->
      <<Version:32/native,
        StructSize:32/native,
        CPULocalMS:64/native,
        CPUIdleMS:64/native,
        SwapTotal:64/native,
        SwapUsed:64/native,
        _SwapPageIn:64/native,
        _SwapPageOut:64/native,
        MemTotal:64/native,
        MemUsed:64/native,
        MemActualUsed:64/native,
        MemActualFree:64/native>> = Bin,
      StructSize = erlang:size(Bin),
      Version = 0,
      RawStats = [{cpu_local_ms, CPULocalMS},
                  {cpu_idle_ms, CPUIdleMS},
                  {swap_total, SwapTotal},
                  {swap_used, SwapUsed},
                  %% {swap_page_in, SwapPageIn},
                  %% {swap_page_out, SwapPageOut},
                  {mem_total, MemTotal},
                  {mem_used_sys, MemUsed},
                  {mem_actual_used, MemActualUsed},
                  {mem_actual_free, MemActualFree},
                  {minor_faults, 0},
                  {major_faults, 0},
                  {page_faults, 0}],
      NowSamples = case PrevSample of
                       undefined -> undefined;
                       _ -> {_, OldCPULocal} = lists:keyfind(cpu_local_ms, 1, PrevSample),
                            {_, OldCPUIdle} = lists:keyfind(cpu_idle_ms, 1, PrevSample),
                            LocalDiff = CPULocalMS - OldCPULocal,
                            IdleDiff = CPUIdleMS - OldCPUIdle,
                            RV1 = lists:keyreplace(cpu_local_ms, 1, RawStats, {cpu_local_ms, LocalDiff}),
                            RV2 = lists:keyreplace(cpu_idle_ms, 1, RV1, {cpu_idle_ms, IdleDiff}),
                            [{mem_free, MemTotal - MemUsed},
                             {cpu_utilization_rate, try 100 * (LocalDiff - IdleDiff) / LocalDiff
                                                    catch error:badarith -> 0 end}
                             | RV2]
                   end,
      {{NowSamples, undefined}, RawStats}.
  
  
  unpack_data_v1(Bin, PrevSample) ->
      <<Version:32/native,
        StructSize:32/native,
        CPULocalMS:64/native,
        CPUIdleMS:64/native,
        SwapTotal:64/native,
        SwapUsed:64/native,
        _SwapPageIn:64/native,
        _SwapPageOut:64/native,
        MemTotal:64/native,
        MemUsed:64/native,
        MemActualUsed:64/native,
        MemActualFree:64/native,
        MinorFaults:64/native,
        MajorFaults:64/native,
        PageFaults:64/native>> = Bin,
      StructSize = erlang:size(Bin),
      Version = 1,
      RawStats = [{cpu_local_ms, CPULocalMS},
                  {cpu_idle_ms, CPUIdleMS},
                  {swap_total, SwapTotal},
                  {swap_used, SwapUsed},
                  %% {swap_page_in, SwapPageIn},
                  %% {swap_page_out, SwapPageOut},
                  {mem_total, MemTotal},
                  {mem_used_sys, MemUsed},
                  {mem_actual_used, MemActualUsed},
                  {mem_actual_free, MemActualFree},
                  {minor_faults, MinorFaults},
                  {major_faults, MajorFaults},
                  {page_faults, PageFaults}],
      NowSamples = case PrevSample of
                       undefined -> undefined;
                       _ -> {_, OldCPULocal} = lists:keyfind(cpu_local_ms, 1, PrevSample),
                            {_, OldCPUIdle} = lists:keyfind(cpu_idle_ms, 1, PrevSample),
                            {_, OldMinorFaults} = lists:keyfind(minor_faults, 1, PrevSample),
                            {_, OldMajorFaults} = lists:keyfind(major_faults, 1, PrevSample),
                            {_, OldPageFaults} = lists:keyfind(page_faults, 1, PrevSample),
                            LocalDiff = CPULocalMS - OldCPULocal,
                            IdleDiff = CPUIdleMS - OldCPUIdle,
                            MinorFaultsDiff = MinorFaults - OldMinorFaults,
                            MajorFaultsDiff = MajorFaults - OldMajorFaults,
                            PageFaultsDiff = PageFaults - OldPageFaults,
                            RV1 = misc:update_proplist(RawStats,
                                                       [{cpu_local_ms, LocalDiff},
                                                        {cpu_idle_ms, IdleDiff},
                                                        {minor_faults, MinorFaultsDiff},
                                                        {major_faults, MajorFaultsDiff},
                                                        {page_faults, PageFaultsDiff}]),
                            [{mem_free, MemActualFree},
                             {cpu_utilization_rate, try 100 * (LocalDiff - IdleDiff) / LocalDiff
                                                    catch error:badarith -> 0 end}
                             | RV1]
                   end,
      {{NowSamples, undefined}, RawStats}.
  
  unpack_data_v2(Bin, PrevSample) ->
      <<Version:32/native,
        StructSize:32/native,
        CPULocalMS:64/native,
  
negative.code: 
      {{NowSamplesGlobal, NowSamplesProcs}, {RawStatsGlobal, PrevSampleProcs1}}.
  
  unpack_processes(Bin, PrevSamples) ->
      do_unpack_processes(Bin, {[], PrevSamples}).
  
  do_unpack_processes(Bin, Acc) when size(Bin) =:= 0 ->
      Acc;
  do_unpack_processes(Bin, {NewSampleAcc, PrevSampleAcc} = Acc) ->
      <<Name0:12/binary,
        CpuUtilization:32/native,
        Pid:64/native,
  