Core Types¶
These types are used across the main Amphimixis modules and are the primary targets for cross-references from function and method signatures.
The common module that is used in most other modules
- class Arch(*values)¶
Bases:
StrEnumSupported architectures
- X86 = 'x86'¶
- RISCV = 'riscv'¶
- ARM = 'arm'¶
- class ProfileStats(build_name: str | None = None, executable: str | None = None, executable_run_success: bool | None = None, real_time: str | None = None, user_time: str | None = None, kernel_time: str | None = None, perf_stat: str | None = None, perf_record_name: str | None = None, perf_script_name: str | None = None, perf_archive_name: str | None = None)¶
Bases:
objectProfiling and execution statistics for an executable
- Variables:
build_name (str | None) – Name of the build.
executable (str | None) – Path to the executable file (relative to build dir).
executable_run_success (bool | None) – Whether the executable finished successfully.
real_time (str | None) – Wall-clock (real) execution time.
user_time (str | None) – CPU time spent in user mode.
kernel_time (str | None) – CPU time spent in kernel mode.
perf_stat (str | None) – Output of perf stat command.
perf_record_name (str | None) – Filename of the recorded perf record data.
perf_script_name (str | None) – Filename of the processed perf script output.
perf_script_name – Filename of the archive gathered using perf archive.
- Parameters:
- class MachineAuthenticationInfo(username: str, password: str | None, port: int)¶
Bases:
objectInformation about authentication on a remote machine
- Variables:
- Parameters:
Password can be set to None if an SSH agent is used.
- Variables:
port (int) – Port number for the SSH connection.
- Parameters:
- class MachineInfo(arch: Arch, address: str | None, auth: MachineAuthenticationInfo | None)¶
Bases:
objectInformation about the machine
- Variables:
- Parameters:
arch (Arch)
address (str | None)
auth (MachineAuthenticationInfo | None)
If address is None, the machine is considered to be local.
- Variables:
auth (MachineAuthenticationInfo) – Authentication info for the machine.
- Parameters:
arch (Arch)
address (str | None)
auth (MachineAuthenticationInfo | None)
- auth: MachineAuthenticationInfo | None¶
- class CompilerFlagsAttrs(*values)¶
Bases:
StrEnumEnumeration for getting access to flags of concrete compiler
- C_FLAGS = 'c_flags'¶
- CXX_FLAGS = 'cxx_flags'¶
- CSHARP_FLAGS = 'csharp_flags'¶
- CUDA_FLAGS = 'cuda_flags'¶
- OBJC_FLAGS = 'objc_flags'¶
- OBJCXX_FLAGS = 'objcxx_flags'¶
- FORTRAN_FLAGS = 'fortran_flags'¶
- HIP_FLAGS = 'hip_flags'¶
- ISPC_FLAGS = 'ispc_flags'¶
- SWIFT_FLAGS = 'swift_flags'¶
- ASM_FLAGS = 'asm_flags'¶
- ASM_NASM_FLAGS = 'asm_nasm_flags'¶
- ASM_MARMASM_FLAGS = 'asm_marmasm_flags'¶
- ASM_MASM_FLAGS = 'asm_masm_flags'¶
- ASM_ATT_FLAGS = 'asm_att_flags'¶
- class ToolchainAttrs(*values)¶
Bases:
StrEnumConstants for getting access to attributes from toolchain dictionary
- AR_T = 'ar'¶
- AS_T = 'as'¶
- LD_T = 'ld'¶
- NM_T = 'nm'¶
- OBJCOPY_T = 'objcopy'¶
- OBJDUMP_T = 'objdump'¶
- RANLIB_T = 'ranlib'¶
- READELF_T = 'readelf'¶
- STRIP_T = 'strip'¶
- C_COMPILER = 'c_compiler'¶
- CXX_COMPILER = 'cxx_compiler'¶
- CSHARP_COMPILER = 'csharp_compiler'¶
- CUDA_COMPILER = 'cuda_compiler'¶
- OBJC_COMPILER = 'objc_compiler'¶
- OBJCXX_COMPILER = 'objcxx_compiler'¶
- FORTRAN_COMPILER = 'fortran_compiler'¶
- HIP_COMPILER = 'hip_compiler'¶
- ISPC_COMPILER = 'ispc_compiler'¶
- SWIFT_COMPILER = 'swift_compiler'¶
- ASM_COMPILER = 'asm_compiler'¶
- ASM_NASM_COMPILER = 'asm_nasm_compiler'¶
- ASM_MARMASM_COMPILER = 'asm_marmasm_compiler'¶
- ASM_MASM_COMPILER = 'asm_masm_compiler'¶
- ASM_ATT_COMPILER = 'asm_att_compiler'¶
- class Toolchain(name: str | None = None, sysroot: str | None = None)¶
Bases:
objectClass that generalized idea of toolchain
- get(attr: ToolchainAttrs | CompilerFlagsAttrs) str | None¶
Getter of toolchain attributes
- Parameters:
attr (ToolchainAttrs | CompilerFlagsAttrs)
- Return type:
str | None
- set(attr: ToolchainAttrs | CompilerFlagsAttrs, new_value: str) None¶
Setter of toolchain attributes
- Parameters:
attr (ToolchainAttrs | CompilerFlagsAttrs) – Tool / compiler / flags attribute of toolchain
new_value (str) – absolute path to tool / compiler or flags of compiler
attr
- Return type:
None
- class CompilerFlags¶
Bases:
objectStoring flags of compilers
- get(attr: CompilerFlagsAttrs) str | None¶
Getter of compiler flags
- Parameters:
attr (CompilerFlagsAttrs)
- Return type:
str | None
- set(attr: CompilerFlagsAttrs, new_value: str) None¶
Setter of compiler flags
- Parameters:
attr (CompilerFlagsAttrs)
new_value (str)
- Return type:
None
- property data: dict[CompilerFlagsAttrs, str]¶
Return dictionary with all tools
- class IUI¶
Bases:
ABCInterface for User Interface (UI) classes
- class NullUI¶
Bases:
IUIA UI implementation that does nothing (used to suppress output)
- class ILowLevelBuildSystem(project: Project, ui: IUI = NullUI())¶
Bases:
ABCInterface for classes implementing interaction with runner (low-level build-system)
- class IHighLevelBuildSystem(project: Project, runner: ILowLevelBuildSystem, ui: IUI = NullUI())¶
Bases:
ABCInterface for classes implementing interaction with build system (high-level build-system)
- Parameters:
project (Project)
runner (ILowLevelBuildSystem)
ui (IUI)
- class DummyRunner¶
Bases:
ILowLevelBuildSystemRunner that does nothing
- class DummyBuildSystem¶
Bases:
IHighLevelBuildSystemBuild system that does nothing
- class BuildSystem(project: Project, runner: ILowLevelBuildSystem = DummyRunner(), ui: IUI = NullUI())¶
Bases:
objectCommon class for build systems
- Parameters:
project (Project)
runner (ILowLevelBuildSystem)
ui (IUI)
- class Build(build_machine: MachineInfo, run_machine: MachineInfo, build_name: str, executables: list[str], toolchain: Toolchain | None, sysroot: str | None, compiler_flags: CompilerFlags | None, config_flags: None | str, jobs: None | int = None, successfully_built: bool = True)¶
Bases:
objectClass with information about one build of project
- Variables:
build_machine (MachineInfo) – Information about the machine to build at
run_machine (MachineInfo) – Information about the machine to profile at
build_name (str) – Unique name of the build
toolchain (Toolchain | None) – Toolchain used to building
sysroot (str | None) – Path to sysroot or name of sysroot used to building
executables (list[str]) – List of relative to build path paths to executables
compiler_flags (str) – Compiler flags for the build
jobs (None | int) – Number of building jobs
successfully_built (bool) – Flag of completness of build
- Parameters:
build_machine (MachineInfo)
run_machine (MachineInfo)
build_name (str)
toolchain (Toolchain | None)
sysroot (str | None)
compiler_flags (CompilerFlags | None)
config_flags (None | str)
jobs (None | int)
successfully_built (bool)
- build_machine: MachineInfo¶
- run_machine: MachineInfo¶
- compiler_flags: CompilerFlags | None¶
- class Project(path: str, builds: list[Build] | None = None, build_system: IHighLevelBuildSystem = DummyBuildSystem())¶
Bases:
objectClass with information about project and his builds
- Variables:
path (str) – Path to project for research.
builds (list[Build]) – List of project configurations to be build.
build_system (IHighLevelBuildSystem) – High-level build system.
- Parameters:
path (str)
build_system (IHighLevelBuildSystem)