# pmadeltaindom

## NAME



           **pmaDeltaInDom** - generate a ``delta indom'' if two observations of
           an instance domain are different
    


## C SYNOPSIS



           **#include <pcp/pmapi.h>**
           **#include <pcp/libpcp.h>**
           **#include <pcp/archive.h>**
    
           **int pmaDeltaInDom(__pmLogInDom ***_old_**, __pmLogInDom ***_new_**,**
                              **__pmLogInDom ***_new_delta_**);**
    
           **cc ... -lpcp_archive -lpcp**
    


## CAVEAT



           This  documentation  is intended for internal Performance Co-Pilot
           (PCP) developer use.
    
           These interfaces are not part of the PCP APIs that are  guaranteed
           to  remain  fixed  across  releases, and they may not work, or may
           provide different semantics at some point in the future.
    


## DESCRIPTION



           Checks if two observations of the same instance domain are identi‐
           cal, and if they are **not** , tries to generate a ``delta  indom''  to
           describe the differences.
    
           The code assumes (a) _old_ ->_indom_ == _new_ ->_indom_ and (b) both the in‐
           stance domains are sorted in ascending internal instance identifi‐
           er  sequence;  see  pmaSortInDom(3)  to see how to make the second
           condition true.
    
           The ``delta  indom''  format  is  only  supported  for  Version  3
           archives  and  it  is  the caller's responsibility to determine if
           calling  **pmaDeltaInDom** is  appropriate,   rather   than   calling
           pmaSameInDom(3) which is the preferred method for V2 archives.
    
           **pmaDeltaInDom** returns  0  if the _old_ and _new_ instance domains are
           the same.
    
           A return value of 1 indicates that the instance domains  are  dif‐
           ferent  and  the  ``delta indom'' format is **not** more efficient; in
           this case _new_delta_ is not modified.
    
           A return value of 2 indicates that the instance domains  are  dif‐
           ferent  and  _new_delta_ has been set up to describe the ``delta in‐
           dom'' encoding of the differences;  in this case the caller is re‐
           sponsible for freeing _new_delta_ ->_instlist_ and _new_delta_ ->_namelist._
    
           The instance domains are considered different if any of  the  fol‐
           lowing hold:
    
           1.  _old_ ->_numinst_ != _new_ ->_numinst_
    
           2.  For some i, _old_ ->_instlist_[_i_] _!=_ new _- >_instlist _[_ i _]_
    
           3.  For some i, the strings pointed to by _old_ ->_namelist_[_i_] and
               _new_ ->_instlist_[_i_] are not identical
    


## DELTA INDOM FORMAT



           As for a regular instance domain, _new_delta_ ->_numinst_ defines the
           number of instance specifications.
    
           If _new_delta_ ->_namelist_[_i_] == NULL then the instance identified by
           _new_delta_ ->_instlist_[_i_] has been **deleted** from the instance domain.
    
           If _new_delta_ ->_namelist_[_i_] != NULL then the instance identified by
           _new_delta_ ->_instlist_[_i_] has been **added** to the instance domain.
    
           Because the ``delta indom'' is only likely to have short-term rel‐
           evance to the caller, the _new_delta_ ->_namelist_[_i_] entries that are
           not NULL will point back into _old_ ->_namelist_[_j_] or _new_ ->_namelist_[_k_]
           and so _old_ and _new_ should not be freed until the caller has fin‐
           ished with _new_delta_.
    


* * *