How to configure Arm Code Advisor

Arm Code Advisor can be configured using a configuration file. This topic describes how to create and use a configuration file for Code Advisor.

The configuration information for Arm Code Advisor is stored in a standardized hierarchy, enabling administrators to set system defaults and, where permitted, users to override them for their own use cases.

The following steps show you how to check and configure your own installation of Arm Code Advisor:

  1. Check the current configuration

    To check current configuration, use:

    armcadvisor config query 

    If the "Set From" column says "default", then there are no user-defined configurations or environment variables being identified from a configuration file. Instead, the default configuration is being used.

  2. Create a configuration file

    Configuration files can be created from scratch, or you can generate a template. To generate a template, use:

    armcadvisor config new-template
    This prints a template configuration file to stdout. Create a new file and copy the template into it.
     
    For Code Advisor to recognize the new configuration file, it must be renamed to armcadvisor-config.toml and stored in one of the following three locations:
     
    1. /etc/armcadvisor/
    2. <install_location>/etc/armcadvisor/
    3. ~/.armcadvisor/

    These locations are read by Code Advisor in the given order, with the last file read taking priority over any before it.

  3. Edit the configuration file

    TOML is an easy-to-read file format that supports comments and can be read and edited in any basic text editor. It is important to note that TOML is case sensitive. For more information on the TOML file format, you can read about it here.

    The configuration file is divided into subsections by armcadvisor command. The following configuration options are available:

    [analyze]

    Option Default Value
    Description
    Profile "latest"
    Which profile in the repository to use.
    OutputLocation "armcadvisor.advice" The location of the resulting advice file.
    Binaries [""]
    Binary to analyze, this option can be specified multiple times.
    PathRulesFile ""
    Allows binary-encoded source trees to be located by specifying a new path tree. Syntax: "oldpath,newpath". For example: a/b/c,x/y/z where a/b/c is the original source tree and x/y/z is the new location.
    SystemBinPrefixes ["/usr", "/lib", "/bin", "/opt/arm"]
    Prefix to system binaries and libraries, this option can be specified multiple times (default [/usr,/lib,/bin,/opt/arm]).
    ShowProgress false
    Display individual plugin progress during advice file generation.
    IgnoreMissingBinaries false
    Ignore missing binaries.
    RedistSamplesBinaries
    [""]
    A list of binaries that cannot be changed - attempt to redistribute samples accordingly.

    [collect]

    Option  Default Value
    Description
    ArmieEnabled false Arm Instruction Emulator enabled.
    ArmieArchOptions "sve-vector-bits=256" Vector length to use. Must be a multiple of 128 bits up to 2048 bits.
    ArmieBinName
    "armie"
    Arm Instruction Emulator bin directory.
    PerfEnabled true
    Collect samples using perf.
    PerfSampleFreq 1000
    Set the sample frequency in samples/second.
    Backtraces false
    Enable the collection of backtrace information.

    [plugins]

    Option Default Value
    Description
    InstallPluginDir
    "<install_location>/support/plugins" Location of Arm built-in Code Advisor plug-ins.
    SystemPluginDir "/etc/armcadvisor/plugins" Location of system-wide plug-ins, available to all users.
    UserPluginDir "<install_location>/.armcadvisor/plugins"
    Location of user-specified plug-ins.
    ProgressIncrement 10 Percentage progress completion before the next progress message is reported.
    PluginDiscoveryTimeoutSeconds 10 Length of time Arm Code Advisor will wait before a plug-in is considered to have crashed.
    DisabledPlugins [""]
    Disables the list of plugins provided.
    WarnDisabledArm true
    Issue a warning if Arm built-in plug-ins are disabled.

    [repository]

    Option  Default Value
    Description
    FilePermission 600
    Permissions for files in the repository.
    FolderPermission 700
    Permissions for folders in the repository.
    PersistentCollect false
    Use numbered persistent profiles instead of a single profile overwritten each time collect is run.
    Location "<install_location>/.armcadvisor/profiles"
    Location of the repository.

    [web]

    Option Default Value
    Description
    Port 8080
    Web server port number.
    Open
    false Attempt to open a browser with the URL for you.
    NetworkVisible
    false
    Allow the server to be accessible over the network.
    NoAuth false
    Disable authentication of clients.
    SourceLocation "."
    Set the source path.
    Usernames [""] Username and password for web application, this can be specified multiple times. Syntax: ["user:hashpassword", ..., "user:hashpassword"].

    [global]

    Option Default Value
    Description
    LogFile "stderr"
    Specifies the log file.
    LogLevel 1
    Level of logging detail (0=Error, 1=Warn, 2=Info 3=Debug).
    Debug false
    Print stack traces in the case of an error.

     

  4. Edit the file to set your user-chosen configuration options.

    Note: All configuration settings in a generated template are commented out. Un-comment each configuration setting as you specify the value you want for each option.

    You are now ready to run Code Advisor using your specified configuration settings.

    See the Getting started topic for further information on running Code Advisor.

Command reference

The Command Reference Library provides further information on the commands available within Arm Code Advisor, including: