def generateProfileInfoFile(xpediteApp, probes): """ Generate profile information for a specific app to be compared to an expected result """ from xpedite.profiler.profileInfoGenerator import ProfileInfoGenerator profiler = os.path.join(DIR_PATH, SRC_DIR_PATH, PROFILER_PATH) generator = ProfileInfoGenerator(xpediteApp.executableName, LOCALHOST, XPEDITE_APP_INFO_PATH, probes, profiler) generator.generate() return generator.filePath
def generate(appInfoPath, hostname=None): """ Attaches to application and generates default profile info :param appInfoPath: Path to app info module :type appInfoPath: str :param hostname: Name of the host running the target process :type hostname: str """ hostname = hostname if hostname else 'localhost' app = XpediteApp('app', hostname, appInfoPath) probes = _loadProbes(app) if probes: from xpedite.profiler.profileInfoGenerator import ProfileInfoGenerator appInfoAbsolutePath = os.path.abspath(appInfoPath) profilerPath = os.path.abspath( os.path.join(__file__, '../../../../bin/xpedite')) return ProfileInfoGenerator(app.executableName, hostname, appInfoAbsolutePath, probes, profilerPath).generate() else: LOGGER.error( 'failed to generate profile_info.py. cannot locate probes in app. Have you instrumented any ?\n' ) return None
def generateProfileInfo(binary, profileInfo, remote): """ Use Xpedite's profile information generator to generate a new profileInfo.py file for an xpedite application and compare the new profile information to baseline profile information """ from xpedite.profiler.profileInfoGenerator import ProfileInfoGenerator with TargetLauncher(binary, profileInfo, remote) as app: probes = ProbeAdmin.loadProbes(app.xpediteApp) profiler = os.path.join(os.path.dirname(testDir), 'scripts/bin/xpedite') profileInfo.appInfo = os.path.join(app.tempDir, 'xpedite-appinfo.txt') generator = ProfileInfoGenerator(app.xpediteApp.getBinaryName(), profileInfo.appHost, os.path.basename(profileInfo.appInfo), probes, profiler) generator.generate() return generator.filePath