GithubHelp home page GithubHelp logo

isabella232 / lineuse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intel/lineuse

0.0 0.0 0.0 15 KB

I-cache line packing and branch misprediction measuring tool

License: GNU General Public License v2.0

Shell 1.91% Perl 6 98.09%

lineuse's Introduction

lineuse

Cache line use and branch mispredict reporting tool

This script works with the Linux perf tool to capture and analyze LBR (Last Branch Record) data to determine how well I-cache lines are being utilized and how frequently branches are mispredicted. This information is then presented in spreadsheet (.xls and .csv) form.

Note: the branch mispredict information is a conservative estimate. That is, there are at least as many mispredictions as shown in the spreadsheet. Branches with no know mispredictions will not appear in the spreadsheet.

The reason that mispredictions can't be precise is that LBRs can't provide any information on branches that were predicted to be taken but ended up falling through.

The exact misprediction ratio would be (mispredicted_ultimately_taken + mispredicted_ultimately_not_taken) / (branches_taken + branches_fall_through). Everything in that formula can be derived from LBR data except mispredicted_ultimately_not_taken.

##Dependencies:

Lineuse uses the Spreadsheet::WriteExcel Perl Module. You can install it with:

sudo apt-get install libspreadsheet-writeexcel-perl

or

sudo yum install perl-Spreadsheet-WriteExcel

##Use

There are two ways to run the lineuse script, installed mode and stand-alone mode. Installed mode is the preferred method.

###Installed use:

Initial setup (requires root):

mkdir -p /usr/libexec/perf-core/scripts/perl/bin
cp lineuse-re* /usr/libexec/perf-core/scripts/perl/bin/
cp lineuse.pl /usr/libexec/perf-core/scripts/perl/

To capture and report on 5 seconds worth of data:

export LINEUSE_EXEC_NAME=<your_executable_path>
perf script record lineuse -p <your_pid> sleep 5
perf script report lineuse

###Stand-alone use:

To capture data for 5 seconds:

perf record -e instructions -c 2000003 -j u -p <your_pid> sleep 5

To process the data:

export LINEUSE_EXEC_NAME=<your_executable_path>
perf script -s lineuse.pl

lineuse's People

Contributors

gdbentley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.