def etlparser_from_config(config_file, **kwargs): """start from a YAML config file""" # option defaults args = {'xperf_path': 'xperf.exe', 'etl_filename': 'test.etl', 'outputFile': 'etl_output.csv', 'processID': None, 'approot': None, 'whitelist_file': None, 'error_filename': None, 'all_stages': False, 'all_threads': False } args.update(kwargs) # override from YAML config file args = xtalos.options_from_config(args, config_file) # ensure process ID is given if not args.get('processID'): raise xtalos.XTalosError("No process ID option given") # ensure path to xperf given if not os.path.exists(args['xperf_path']): raise xtalos.XTalosError("ERROR: xperf_path '%s' does not exist" % args['xperf_path']) # update args with config file args['configFile'] = config_file # call etlparser etlparser(**args)
def stop_from_config(config_file=None, debug=False, **kwargs): """start from a YAML config file""" # required options and associated error messages required = {"xperf_path": "xperf_path not given", "etl_filename": "No etl_filename given"} for key in required: if key not in kwargs: kwargs[key] = None if config_file: # override options from YAML config file kwargs = xtalos.options_from_config(kwargs, config_file) # ensure the required options are given for key, msg in required.items(): if not kwargs.get(key): raise xtalos.XTalosError(msg) # ensure path to xperf actually exists if not os.path.exists(kwargs["xperf_path"]): raise xtalos.XTalosError("ERROR: xperf_path '%s' does not exist" % kwargs["xperf_path"]) # make calling arguments stopargs = {} stopargs["xperf_path"] = kwargs["xperf_path"] stopargs["debug"] = debug # call start stop(**stopargs) etlparser.etlparser_from_config( config_file, approot=kwargs["approot"], error_filename=kwargs["error_filename"], processID=kwargs["processID"] )
def start_from_config(config_file=None, debug=False, **kwargs): """start from a YAML config file""" # required options and associated error messages required = {'xperf_path': "xperf_path not given", 'xperf_providers': "No xperf providers given", 'xperf_user_providers': "No xperf user providers given", 'xperf_stackwalk': "No xperf stackwalk options given", "etl_filename": "No etl_filename given"} for key in required: if key not in kwargs: kwargs[key] = None if config_file: # override options from YAML config file kwargs = xtalos.options_from_config(kwargs, config_file) # ensure the required options are given for key, msg in required.items(): if not kwargs.get(key): raise xtalos.xtalosError(msg) # ensure path to xperf actually exists if not os.path.exists(kwargs['xperf_path']): raise xtalos.xtalosError("ERROR: xperf_path '%s' does not exist" % kwargs['xperf_path']) # make calling arguments args = dict([(key, kwargs[key]) for key in required.keys()]) args['debug'] = debug # call start start(**args)
def stop_from_config(config_file=None, debug=False, **kwargs): """start from a YAML config file""" # required options and associated error messages required = { "xperf_path": "xperf_path not given", "etl_filename": "No etl_filename given", } for key in required: if key not in kwargs: kwargs[key] = None if config_file: # override options from YAML config file kwargs = xtalos.options_from_config(kwargs, config_file) # ensure the required options are given for key, msg in required.items(): if not kwargs.get(key): raise xtalos.XTalosError(msg) # ensure path to xperf actually exists if not os.path.exists(kwargs["xperf_path"]): raise xtalos.XTalosError( "ERROR: xperf_path '%s' does not exist" % kwargs["xperf_path"] ) # make calling arguments stopargs = {} stopargs["xperf_path"] = kwargs["xperf_path"] stopargs["debug"] = debug # call start stop(**stopargs) etlparser.etlparser_from_config( config_file, approot=kwargs["approot"], error_filename=kwargs["error_filename"], processID=kwargs["processID"], ) csv_base = "%s.csv" % kwargs["etl_filename"] run_session_restore_analysis(csv_filename=csv_base, debug=debug, **kwargs) if not debug: mozfile.remove(csv_base)
def stop_from_config(config_file=None, debug=False, **kwargs): """start from a YAML config file""" # required options and associated error messages required = { 'xperf_path': "xperf_path not given", "etl_filename": "No etl_filename given" } for key in required: if key not in kwargs: kwargs[key] = None if config_file: # override options from YAML config file kwargs = xtalos.options_from_config(kwargs, config_file) # ensure the required options are given for key, msg in required.items(): if not kwargs.get(key): raise xtalos.xtalosError(msg) # ensure path to xperf actually exists if not os.path.exists(kwargs['xperf_path']): raise xtalos.xtalosError("ERROR: xperf_path '%s' does not exist" % kwargs['xperf_path']) # make calling arguments stopargs = {} stopargs['xperf_path'] = kwargs['xperf_path'] stopargs['debug'] = debug # call start stop(**stopargs) etlparser.etlparser_from_config(config_file, approot=kwargs['approot'], error_filename=kwargs['error_filename'], processID=kwargs['processID'])