def _get_memory_usage(self, platform): """ Determines memory usage for analytics Parameters: -------------------------------------------------------------------- args: the args passed to the run() method appInfo: the applications appInfo """ cmd_name = 'arm-none-eabi-size' cmd_args = [os.path.join("build", platform, "pebble-app.elf")] try: output = sh.arm_none_eabi_size(*cmd_args, _tty_out=False) text_size, data_size, bss_size = [int(x) for x in output.stdout.splitlines()[1].split()[:3]] return {'text': text_size, 'data': data_size, 'bss': bss_size} except sh.ErrorReturnCode as e: logging.error("command %s %s failed. stdout: %s, stderr: %s" % (cmd_name, ' '.join(cmd_args), e.stdout, e.stderr)) except sh.CommandNotFound as e: logging.error("The command %s could not be found. Could not " "collect memory usage analytics." % (e.message))
def _send_memory_usage(self, args, appInfo): """ Send app memory usage to analytics Parameters: -------------------------------------------------------------------- args: the args passed to the run() method appInfo: the applications appInfo """ cmdName = "arm_none_eabi_size" cmdArgs = [os.path.join("build", "pebble-app.elf")] try: output = sh.arm_none_eabi_size(*cmdArgs) (textSize, dataSize, bssSize) = [int(x) for x in output.stdout.splitlines()[1].split()[:3]] sizeDict = {"text": textSize, "data": dataSize, "bss": bssSize} PblAnalytics.code_size_evt(uuid=appInfo["uuid"], segSizes=sizeDict) except sh.ErrorReturnCode as e: logging.error( "command %s %s failed. stdout: %s, stderr: %s" % (cmdName, " ".join(cmdArgs), e.stdout, e.stderr) ) except sh.CommandNotFound as e: logging.error("The command %s could not be found. Could not " "collect memory usage analytics." % e.message)
def _send_memory_usage(self, args, appInfo): """ Send app memory usage to analytics Parameters: -------------------------------------------------------------------- args: the args passed to the run() method appInfo: the applications appInfo """ cmdName = 'arm_none_eabi_size' cmdArgs = [os.path.join("build", "pebble-app.elf")] try: output = sh.arm_none_eabi_size(*cmdArgs) (textSize, dataSize, bssSize) = [int(x) for x in \ output.stdout.splitlines()[1].split()[:3]] sizeDict = {'text': textSize, 'data': dataSize, 'bss': bssSize} PblAnalytics.code_size_evt(uuid=appInfo["uuid"], segSizes=sizeDict) except sh.ErrorReturnCode as e: logging.error("command %s %s failed. stdout: %s, stderr: %s" % (cmdName, ' '.join(cmdArgs), e.stdout, e.stderr)) except sh.CommandNotFound as e: logging.error("The command %s could not be found. Could not " "collect memory usage analytics." % (e.message))
def _get_memory_usage(self, platform): """ Determines memory usage for analytics Parameters: -------------------------------------------------------------------- args: the args passed to the run() method appInfo: the applications appInfo """ cmd_name = 'arm-none-eabi-size' cmd_args = [os.path.join("build", platform, "pebble-app.elf")] try: output = sh.arm_none_eabi_size(*cmd_args, _tty_out=False) text_size, data_size, bss_size = [ int(x) for x in output.stdout.splitlines()[1].split()[:3] ] return {'text': text_size, 'data': data_size, 'bss': bss_size} except sh.ErrorReturnCode as e: logging.error("command %s %s failed. stdout: %s, stderr: %s" % (cmd_name, ' '.join(cmd_args), e.stdout, e.stderr)) except sh.CommandNotFound as e: logging.error("The command %s could not be found. Could not " "collect memory usage analytics." % (e.message))