Giter Club home page Giter Club logo

shadow's Introduction

Shadow Workload Generator v1.0

This framework can create a shadow workload (aka clone) given an x86_64 binary as input. The shadow workload demonstrates similar memory access pattern as the original workload while pruning all the non-memory instructions. The output of this framework is a C++ source code that can be compiled with GNU C or clang (not tested on icc).

Building the framework

Run make from the root directory. Successful build should create the obj-intel64/MAPProfiler.so file.

Running the framework

The tool itself is a target for Intel PIN, and should be invoked as follows:

$ ./pin/pin -t obj-intel64/MAPProfiler.so -func <function_to_be_profiled> -out <output_code_file>		\
	-top <top_filtering_percentage> -step <sample_size> -maxinst <maximum_inst_to_profile>			\
	-- <target_binary> <target_binary_arguments>

Where,

function_to_be_profiled:	The user can limit the profiling to a specific function. If specified,
				the shadow workload only mimics that particular function. Requires the
				target_binary to be compiled with debug flag. (default: main)
							
output_code_file:		Name of the generated shadow workload code file. It can be compiled with
				a C compiler to get the shadow workload binary. (default: genCode.cpp)
							
top_filtering_percentage:	During top rank filtering stage, this specified amount of memory accesses
				will be kept at minimum. (default: 95)
							
sample_size:			Sample size or batch size of the code fragments in number of memory
				instructions. (default: -1, which means only a single code fragment)
							
maxinst:			Maximum number of instructions to profile. This includes all instructions,
				not just memory instructions. (default: -1, no limit)
							
target_binary:			The original workload binary.

target_binary_arguments:	Command line arguments for the target binary, if any.

Example

$ cd examples/scatter_gather
$ make
$ cd ../../
$ ./pin/pin -t obj-intel64/MAPProfiler.so -out shadow.cpp -top 97 -step 1000000 -maxinst 5000000000	\
	-- ./examples/scatter_gather/scatter_gather

This will clone the scatter_gather benchmark with a batch size of 1 million memory instructions, upto a maximum of 5 billion instructions. The generated clone have the file name shadow.cpp. It can be compiled as follows:

$ g++ genCode.cpp -o shadow -mavx

The -mavx flag is necessary since the clone can contain AVX load/store instructions.

shadow's People

Contributors

alifahmed avatar fasiddique 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.