sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.instr/src/com/nokia/carbide/cpp/pi/instr/DecidedPool.java
changeset 5 844b047e260d
parent 2 b9ab3b238396
equal deleted inserted replaced
4:615035072f7e 5:844b047e260d
   131 			}
   131 			}
   132 		}
   132 		}
   133 		if (winner != null)
   133 		if (winner != null)
   134 		{
   134 		{
   135 			ProcessedBinary pb = this.amm.getBinaryReader().
   135 			ProcessedBinary pb = this.amm.getBinaryReader().
   136 									getProcessedBinaryForName(winner.binaryName);
   136 									getProcessedBinaryForName(winner.getBinaryName());
   137 			
   137 			
   138 			
   138 			
   139 			String fName = pb.getFunctionNameForOffset(
   139 			String fName = pb.getFunctionNameForOffset(
   140 							address-(winner.startAddress+winner.offsetToCodeStart));
   140 							address-(winner.getStartAddress()+winner.getOffsetToCodeStart()));
   141 			
   141 			
   142 			String bName = winner.binaryName;
   142 			String bName = winner.getBinaryName();
   143 			long fOffset = pb.getOffsetFromBinaryStartForFunction(fName);
   143 			long fOffset = pb.getOffsetFromBinaryStartForFunction(fName);
   144 			Long fStart = new Long(winner.startAddress+winner.offsetToCodeStart+fOffset);
   144 			Long fStart = Long.valueOf(winner.getStartAddress()+winner.getOffsetToCodeStart()+fOffset);
   145 			
   145 			
   146 			Function f = new Function(fName,fStart,bName);
   146 			Function f = new Function(fName,fStart,bName);
   147 			f.length = pb.getFunctionLengthForOffset(fOffset);
   147 			f.setLength(pb.getFunctionLengthForOffset(fOffset));
   148 			
   148 			
   149 			return f;
   149 			return f;
   150 
   150 
   151 		}
   151 		}
   152 		
   152 		
   185 		}
   185 		}
   186 	}
   186 	}
   187 	
   187 	
   188 	public void insertDecidedBinary(Binary binary,Vector samples)
   188 	public void insertDecidedBinary(Binary binary,Vector samples)
   189 	{		
   189 	{		
   190 		Vector currentBins = this.memLayout.isOccupiedBy(binary.startAddress,binary.length);
   190 		Vector currentBins = this.memLayout.isOccupiedBy(binary.getStartAddress(),binary.getLength());
   191 		
   191 		
   192 		if (currentBins.size() == 0)
   192 		if (currentBins.size() == 0)
   193 		{
   193 		{
   194 			if (debug) System.out.println(Messages.getString("DecidedPool.analysisResolved1")+binary.binaryName+Messages.getString("DecidedPool.analysisResolved2")+Long.toHexString(binary.startAddress+binary.offsetToCodeStart)+ //$NON-NLS-1$ //$NON-NLS-2$
   194 			if (debug) System.out.println(Messages.getString("DecidedPool.analysisResolved1")+binary.getBinaryName()+Messages.getString("DecidedPool.analysisResolved2")+Long.toHexString(binary.getStartAddress()+binary.getOffsetToCodeStart())+ //$NON-NLS-1$ //$NON-NLS-2$
   195 					Messages.getString("DecidedPool.analysisResolved3")+Long.toHexString(binary.startAddress+binary.offsetToCodeStart+binary.length)); //$NON-NLS-1$
   195 					Messages.getString("DecidedPool.analysisResolved3")+Long.toHexString(binary.getStartAddress()+binary.getOffsetToCodeStart()+binary.getLength())); //$NON-NLS-1$
   196 			
   196 			
   197 			DecidedLocation dl = new DecidedLocation(binary);
   197 			DecidedLocation dl = new DecidedLocation(binary);
   198 			dl.insertSupportingSamples(samples);
   198 			dl.insertSupportingSamples(samples);
   199 			
   199 			
   200 			this.memLayout.insertArea(dl);
   200 			this.memLayout.insertArea(dl);
   212 				
   212 				
   213 				while (sampEnum.hasMoreElements())
   213 				while (sampEnum.hasMoreElements())
   214 				{
   214 				{
   215 					IttSample is = (IttSample)sampEnum.nextElement();
   215 					IttSample is = (IttSample)sampEnum.nextElement();
   216 
   216 
   217 					if (is.programCounter >= b.startAddress && is.programCounter <= b.startAddress+b.length)
   217 					if (is.programCounter >= b.getStartAddress() && is.programCounter <= b.getStartAddress()+b.getLength())
   218 					{
   218 					{
   219 						if (this.trySampleWithBinary(is,b,4) == false) 
   219 						if (this.trySampleWithBinary(is,b,4) == false) 
   220 							okForThis=false;
   220 							okForThis=false;
   221 						else
   221 						else
   222 							okCount++;
   222 							okCount++;
   453 			
   453 			
   454 			Enumeration enumer = this.decidedLocations.keys();
   454 			Enumeration enumer = this.decidedLocations.keys();
   455 			while (enumer.hasMoreElements())
   455 			while (enumer.hasMoreElements())
   456 			{
   456 			{
   457 				Binary b = (Binary)enumer.nextElement();
   457 				Binary b = (Binary)enumer.nextElement();
   458 				long bStart = b.startAddress;
   458 				long bStart = b.getStartAddress();
   459 				long bEnd = b.startAddress+b.length;
   459 				long bEnd = b.getStartAddress()+b.getLength();
   460 				long end = start+length;
   460 				long end = start+length;
   461 				
   461 				
   462 				// starts within the area
   462 				// starts within the area
   463 				if (start <= bEnd && start >= bStart)
   463 				if (start <= bEnd && start >= bStart)
   464 				{
   464 				{
   499 			Vector binaries = new Vector();
   499 			Vector binaries = new Vector();
   500 			
   500 			
   501 			while (enumer.hasMoreElements())
   501 			while (enumer.hasMoreElements())
   502 			{
   502 			{
   503 				Binary b = (Binary)enumer.nextElement();
   503 				Binary b = (Binary)enumer.nextElement();
   504 				long bStart = b.startAddress;
   504 				long bStart = b.getStartAddress();
   505 				long bEnd = b.startAddress+b.length;
   505 				long bEnd = b.getStartAddress()+b.getLength();
   506 				
   506 				
   507 				if (address >= bStart && address <= bEnd)
   507 				if (address >= bStart && address <= bEnd)
   508 				{
   508 				{
   509 					binaries.add(b);
   509 					binaries.add(b);
   510 				}
   510 				}
   517 		{
   517 		{
   518 			Enumeration dls = this.decidedLocations.keys();
   518 			Enumeration dls = this.decidedLocations.keys();
   519 			while (dls.hasMoreElements())
   519 			while (dls.hasMoreElements())
   520 			{
   520 			{
   521 				Binary b = (Binary)dls.nextElement();
   521 				Binary b = (Binary)dls.nextElement();
   522 				if (b.binaryName.toLowerCase().equals(binaryName.toLowerCase())) return b;
   522 				if (b.getBinaryName().toLowerCase().equals(binaryName.toLowerCase())) return b;
   523 			}
   523 			}
   524 			return null;
   524 			return null;
   525 		}
   525 		}
   526 		
   526 		
   527 	}
   527 	}