• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/support/scripts/graph-build-time
Ricardo MartincoskiRicardo Martincoski committed cd04833926b22 Jan 2018
Raw file
Source viewDiff to previous
xxxxxxxxxx
    plt.xticks(ind + .6, [p.name for p in data], rotation=-60, rotation_mode="anchor", fontsize=8, ha='left')
 
#!/usr/bin/env python
​
# Copyright (C) 2011 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
# Copyright (C) 2013 by Yann E. MORIN <yann.morin.1998@free.fr>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
​
# This script generates graphs of packages build time, from the timing
# data generated by Buildroot in the $(O)/build-time.log file.
#
# Example usage:
#
#   cat $(O)/build-time.log | ./support/scripts/graph-build-time --type=histogram --output=foobar.pdf
#
# Three graph types are available :
#
#   * histogram, which creates an histogram of the build time for each
#     package, decomposed by each step (extract, patch, configure,
#     etc.). The order in which the packages are shown is
#     configurable: by package name, by build order, or by duration
#     order. See the --order option.
#
#   * pie-packages, which creates a pie chart of the build time of
#     each package (without decomposition in steps). Packages that
#     contributed to less than 1% of the overall build time are all
#     grouped together in an "Other" entry.
#
#   * pie-steps, which creates a pie chart of the time spent globally
#     on each step (extract, patch, configure, etc...)
#
# The default is to generate an histogram ordered by package name.
#
# Requirements:
#
#   * matplotlib (python-matplotlib on Debian/Ubuntu systems)
#   * numpy (python-numpy on Debian/Ubuntu systems)
#   * argparse (by default in Python 2.7, requires python-argparse if
#     Python 2.6 is used)
​
import sys
​
try:
    import matplotlib as mpl
    import numpy
except ImportError:
    sys.stderr.write("You need python-matplotlib and python-numpy to generate build graphs\n")
    exit(1)
​
# Use the Agg backend (which produces a PNG output, see
# http://matplotlib.org/faq/usage_faq.html#what-is-a-backend),
# otherwise an incorrect backend is used on some host machines).
# Note: matplotlib.use() must be called *before* matplotlib.pyplot.
mpl.use('Agg')
​
import matplotlib.pyplot as plt       # noqa: E402
import matplotlib.font_manager as fm  # noqa: E402
import csv                            # noqa: E402
import argparse                       # noqa: E402
​
steps = ['extract', 'patch', 'configure', 'build',
         'install-target', 'install-staging', 'install-images',
         'install-host']
​
default_colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
                  '#0068b5', '#f28e00', '#940084', '#97c000']
​
alternate_colors = ['#00e0e0', '#3f7f7f', '#ff0000', '#00c000',
                    '#0080ff', '#c000ff', '#00eeee', '#e0e000']
​
​
class Package:
    def __init__(self, name):
        self.name = name
        self.steps_duration = {}
        self.steps_start = {}
        self.steps_end = {}
​
    def add_step(self, step, state, time):
        if state == "start":
            self.steps_start[step] = time
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.