testing/merge_scripts/code_coverage/merge_lib.py
def _call_profdata_tool(profile_input_file_paths,
                        profile_output_file_path,
                        profdata_tool_path,
                        sparse=False):
  """Calls the llvm-profdata tool.

  Args:
    profile_input_file_paths: A list of relative paths to the files that
        are to be merged.
    profile_output_file_path: The path to the merged file to write.
    profdata_tool_path: The path to the llvm-profdata executable.
    sparse (bool): flag to indicate whether to run llvm-profdata with --sparse.
      Doc: https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-merge

  Returns:
    A list of paths to profiles that had to be excluded to get the merge to
    succeed, suspected of being corrupted or malformed.

  Raises:
    CalledProcessError: An error occurred merging profiles.
  """
  try:
    subprocess_cmd = [
        profdata_tool_path, 'merge', '-o', profile_output_file_path,
    ]
    if sparse:
      subprocess_cmd += ['-sparse=true',]
    subprocess_cmd.extend(profile_input_file_paths)
    logging.info('profdata command: %r', subprocess_cmd)

    # Redirecting stderr is required because when error happens, llvm-profdata
    # writes the error output to stderr and our error handling logic relies on
    # that output.
    subprocess.check_call(subprocess_cmd, stderr=subprocess.STDOUT)
  except subprocess.CalledProcessError as error:
    logging.error('Failed to merge profiles, return code (%d), output: %r' %
                  (error.returncode, error.output))
    raise error

  logging.info('Profile data is created as: "%r".', profile_output_file_path)
  return []
Calls the llvm-profdata tool.

  Args:
    profile_input_file_paths: A list of relative paths to the files that
        are to be merged.
    profile_output_file_path: The path to the merged file to write.
    profdata_tool_path: The path to the llvm-profdata executable.
    sparse (bool): flag to indicate whether to run llvm-profdata with --sparse.
      Doc: https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-merge

  Returns:
    A list of paths to profiles that had to be excluded to get the merge to
    succeed, suspected of being corrupted or malformed.

  Raises:
    CalledProcessError: An error occurred merging profiles.
  
Calls the llvm-profdata tool.
Calls the llvm - profdata tool .
def _call_profdata_tool(profile_input_file_paths,
                        profile_output_file_path,
                        profdata_tool_path,
                        sparse=False):
  try:
    subprocess_cmd = [
        profdata_tool_path, 'merge', '-o', profile_output_file_path,
    ]
    if sparse:
      subprocess_cmd += ['-sparse=true',]
    subprocess_cmd.extend(profile_input_file_paths)
    logging.info('profdata command: %r', subprocess_cmd)
    subprocess.check_call(subprocess_cmd, stderr=subprocess.STDOUT)
  except subprocess.CalledProcessError as error:
    logging.error('Failed to merge profiles, return code (%d), output: %r' %
                  (error.returncode, error.output))
    raise error
  logging.info('Profile data is created as: "%r".', profile_output_file_path)
  return []
def _call_profdata_tool ( profile_input_file_paths , profile_output_file_path , profdata_tool_path , sparse = False ) : try : subprocess_cmd = [ profdata_tool_path , 'merge' , '-o' , profile_output_file_path , ] if sparse : subprocess_cmd += [ '-sparse=true' , ] subprocess_cmd . extend ( profile_input_file_paths ) logging . info ( 'profdata command: %r' , subprocess_cmd ) subprocess . check_call ( subprocess_cmd , stderr = subprocess . STDOUT ) except subprocess . CalledProcessError as error : logging . error ( 'Failed to merge profiles, return code (%d), output: %r' % ( error . returncode , error . output ) ) raise error logging . info ( 'Profile data is created as: "%r".' , profile_output_file_path ) return [ ]
Calls the llvm-profdata tool.
Calls the llvm - profdata tool .
"""Calls the llvm-profdata tool.

  Args:
    profile_input_file_paths: A list of relative paths to the files that
        are to be merged.
    profile_output_file_path: The path to the merged file to write.
    profdata_tool_path: The path to the llvm-profdata executable.
    sparse (bool): flag to indicate whether to run llvm-profdata with --sparse.
      Doc: https://llvm.org/docs/CommandGuide/llvm-profdata.html#profdata-merge

  Returns:
    A list of paths to profiles that had to be excluded to get the merge to
    succeed, suspected of being corrupted or malformed.

  Raises:
    CalledProcessError: An error occurred merging profiles.
  """ # Redirecting stderr is required because when error happens, llvm-profdata # writes the error output to stderr and our error handling logic relies on # that output.
A list of paths to profiles that had to be excluded to get the merge to
succeed, suspected of being corrupted or malformed.
A list of paths to profiles that had to be excluded to get the merge to succeed suspected of being corrupted or malformed .
An error occurred merging profiles.
An error occurred merging profiles .
CalledProcessError
profile_input_file_paths
A list of relative paths to the files that
are to be merged.
A list of relative paths to the files that are to be merged .
profile_output_file_path
The path to the merged file to write.
The path to the merged file to write .
profdata_tool_path
The path to the llvm-profdata executable.
The path to the llvm - profdata executable .
sparse
flag to indicate whether to run llvm-profdata with --sparse.
flag to indicate whether to run llvm - profdata with -- sparse .