Uploading Existing Profiles

The Blackfire CLI tool can upload any profile generated by the following tools:

  • XHProf;
  • Xdebug;
  • any tools able to generate a callgrind output.

The only requirement to upload a profile is to install the Blackfire CLI tool:

Configuring the Debian Repository

Blackfire uses a custom Debian repository to distribute its packages; it is compatible with most Debian-based distributions like Ubuntu and Linux-Mint.

  1. Register the packagecloud key:
    wget -O - https://packagecloud.io/gpg.key | sudo apt-key add -
  2. Add deb http://packages.blackfire.io/debian any main to /etc/apt/sources.list.d/blackfire.list:
    echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list
  3. Update the repositories:
    sudo apt-get update

Installing the Blackfire CLI tool

  1. Install the blackfire-agent package:
    sudo apt-get install blackfire-agent
  2. Run the config command to initialize the client:
    blackfire config

    This command will ask for your Blackfire client credentials, log in or sign up now:

    or

To profile from your browser, install the Google Chrome extension.

Configuring the Red Hat Repository

Blackfire uses a custom Red Hat repository to distribute its packages; it is compatible with most Red Hat-based distributions like Fedora and CentOS.

  1. Install the pygpgme package used to verify GPG signatures:
    sudo yum install pygpgme
  2. Add the repository to the configuration:
    wget -O - "http://packages.blackfire.io/fedora/blackfire.repo" | sudo tee /etc/yum.repos.d/blackfire.repo
Cannot retrieve repository metadata

With old releases, you can encounter the following message Gpg Keys not imported, cannot verify repomd.xml for repo blackfire

This is often due to the lack of pygpgme on those platforms and can be fixed by editing /etc/yum.repos.d/blackfire.repo and changing the value of repo_gpgcheck to 0

Installing the Blackfire CLI tool

  1. Install the blackfire-agent package:
    sudo yum install blackfire-agent
  2. Run the config command to initialize the client:
    blackfire config

    This command will ask for your Blackfire client credentials, log in or sign up now:

    or

To profile from your browser, install the Google Chrome extension.

Configuring Homebrew

Blackfire provides a homebrew tap to distribute its packages. Make sure that you have brew installed in your system or download and install it.

  1. Add the Blackfire repository:
    brew tap blackfireio/homebrew-blackfire

If you are not using Homebrew and don't want to install Homebrew, use the manual install procedures.

Installing the Blackfire CLI tool

  1. Install the blackfire-agent package:
    brew install blackfire-agent
  2. Run the config command to initialize the client:
    blackfire config

    This command will ask for your Blackfire client credentials, log in or sign up now:

    or

To profile from your browser, install the Google Chrome extension.

If you need to install the stack manually because every other installation methods failed, please contact us and mention your platform and PHP version.

In the meantime, continue the following steps and you will be guided through manual installation.

You are strongly advised to use the other installation methods available if possible as they give you seamless upgrade methods.

Installing the Blackfire CLI tool

  1. Download the "best" client binary for your platform:
  2. Run the config command to initialize the client:
    blackfire config

    This command will ask for your Blackfire client credentials, log in or sign up now:

    or

To profile from your browser, install the Google Chrome extension.

You can now use blackfire upload to upload profiles:

1
$ blackfire upload profile.callgrind

At the end of the upload, blackfire outputs the URL where the profile can be found.

You can even ask Blackfire to aggregate several files into one:

1
$ blackfire upload profile1.callgrind profile2.callgrind profile3.callgrind ...

Before uploading the file to our platform, Blackfire first optimizes the data into a much smaller representation (on average, it compresses the profile by a factor of 1000 for Callgrind profiles); so feel free to feed it with your biggest profiles.