src/tool/hpcrun/sample-sources/watchpoint_clients.c
// getting all false sharing memory regions
getting all false sharing memory regions
getting all false sharing memory regions
static inline void GetAllFalseSharingLocations(size_t va, int accessLen, size_t baseAddr, int maxFSLength, int * wpSizes, int curWPSizeIdx, int totalWPSizes, FalseSharingLocs * fsl, int * numFSLocs){
  int curWPSize = wpSizes[curWPSizeIdx];
  for(int i = 0; i < maxFSLength/curWPSize; i ++) {
    size_t curAddr = baseAddr + i * curWPSize;
    int overlapLen = GET_OVERLAP_BYTES(curAddr, curWPSize, va, accessLen);
    if(0 >= overlapLen) {
      fsl[*numFSLocs].va = curAddr;
      fsl[*numFSLocs].wpLen = curWPSize;
      (*numFSLocs)++;
    }else if (curWPSize != overlapLen) {
      if(curWPSizeIdx+1 < totalWPSizes) {
        GetAllFalseSharingLocations(va, accessLen, curAddr, curWPSize, wpSizes, curWPSizeIdx+1, totalWPSizes, fsl, numFSLocs);
      }
    } else {
    }
  }
}
static inline void GetAllFalseSharingLocations ( size_t va , int accessLen , size_t baseAddr , int maxFSLength , int * wpSizes , int curWPSizeIdx , int totalWPSizes , FalseSharingLocs * fsl , int * numFSLocs ) { int curWPSize = wpSizes [ curWPSizeIdx ] ; for ( int i = 0 ; i < maxFSLength / curWPSize ; i ++ ) { size_t curAddr = baseAddr + i * curWPSize ; int overlapLen = GET_OVERLAP_BYTES ( curAddr , curWPSize , va , accessLen ) ; if ( 0 >= overlapLen ) { fsl [ * numFSLocs ] . va = curAddr ; fsl [ * numFSLocs ] . wpLen = curWPSize ; ( * numFSLocs ) ++ ; } else if ( curWPSize != overlapLen ) { if ( curWPSizeIdx + 1 < totalWPSizes ) { GetAllFalseSharingLocations ( va , accessLen , curAddr , curWPSize , wpSizes , curWPSizeIdx + 1 , totalWPSizes , fsl , numFSLocs ) ; } } else { } } }
getting all false sharing memory regions
getting all false sharing memory regions
// Nop