Skip to content

Commit

Permalink
Rename memreusedist to memstackdist.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximeCheramy committed Oct 16, 2012
1 parent b67bc9f commit 4492835
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 85 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -10,7 +10,7 @@ all: depend mica.so
%.o: %.cpp
$(CXX) -g -o $@ -c $< $(CXXFLAGS) $(PIN_CXXFLAGS)

mica.so: mica.o mica_all.o mica_init.o mica_utils.o mica_ilp.o mica_itypes.o mica_ppm.o mica_reg.o mica_stride.o mica_memfootprint.o mica_memreusedist.o
mica.so: mica.o mica_all.o mica_init.o mica_utils.o mica_ilp.o mica_itypes.o mica_ppm.o mica_reg.o mica_stride.o mica_memfootprint.o mica_memstackdist.o
$(CXX) -g -o $@ $(PIN_LDFLAGS) $(LINK_DEBUG) $^ $(PIN_LPATHS) $(PIN_LIBS) $(DBG)

clean:
Expand Down
16 changes: 8 additions & 8 deletions README
Expand Up @@ -46,7 +46,7 @@ Specifying the parameters is done using the mica.conf configuration file.
A sample mica.conf file is provided with the distribution, and details
on how to specify the parameters are found below.

analysis_type: all | ilp | ilp_one | itypes | ppm | reg | stride | memfootprint | memreusedist | custom
analysis_type: all | ilp | ilp_one | itypes | ppm | reg | stride | memfootprint | memstackdist | custom
interval_size: full | <size>
[ilp_size: <size>]
[block_size: <2^size>]
Expand Down Expand Up @@ -103,9 +103,9 @@ stride:
memfootprint:
full: memfootprint_full_int_pin.out
interval: memfootprint_phases_int_pin.out
memreusedist:
full: memreusedist_full_int_pin.out
interval: memreusedist_phases_int_pin.out
memstackdist:
full: memstackdist_full_int_pin.out
interval: memstackdist_phases_int_pin.out


* Full execution metrics
Expand Down Expand Up @@ -209,9 +209,9 @@ The size of the instruction and data memory footprint is characterized by
counting the number of blocks (64-byte) and pages (4KB) touched. This
is done seperately for data and instruction addresses.

+++ memreusedist +++
+++ memstackdist +++

analysis_type: memreusedist
analysis_type: memstackdist

Memory reuse distances.

Expand Down Expand Up @@ -283,7 +283,7 @@ huge memory requirements for large workloads)

DON'T TOUCH: -

+++ memreusedist +++
+++ memstackdist +++

RESET: bucket counts (including cold reference and memory access counts)

Expand Down Expand Up @@ -396,7 +396,7 @@ FORMAT:

num_64-byte_blocks_data<space>num_4KB_pages_data<space>num_64-byte_blocks_instr<space>num_4KB_pages_instr

+++ memreusedist +++
+++ memstackdist +++

FORMAT:

Expand Down
32 changes: 16 additions & 16 deletions mica.cpp
Expand Up @@ -34,7 +34,7 @@
#include "mica_reg.h"
#include "mica_stride.h"
#include "mica_memfootprint.h"
#include "mica_memreusedist.h"
#include "mica_memstackdist.h"

#include <sstream>
#include <iostream>
Expand All @@ -57,7 +57,7 @@ ins_buffer_entry* ins_buffer[MAX_MEM_TABLE_ENTRIES];
UINT32 _ilp_win_size;
char* _itypes_spec_file;

/* ILP, MEMFOOTPRINT, MEMREUSEDIST */
/* ILP, MEMFOOTPRINT, MEMSTACKDIST */
UINT32 _block_size;

/* MEMFOOTPRINT */
Expand Down Expand Up @@ -171,7 +171,7 @@ VOID Instruction_all(INS ins, VOID* v){
//instrument_reg(ins, e);
//instrument_stride(ins, v);
//instrument_memfootprint(ins, v);
//instrument_memreusedist(ins, v);
//instrument_memstackdist(ins, v);
instrument_all(ins, v, e);
}

Expand All @@ -182,7 +182,7 @@ VOID Fini_all(INT32 code, VOID* v){
fini_reg(code, v);
fini_stride(code, v);
fini_memfootprint(code, v);
fini_memreusedist(code, v);
fini_memstackdist(code, v);
}

/* ILP */
Expand Down Expand Up @@ -405,8 +405,8 @@ VOID Fini_memfootprint_only(INT32 code, VOID* v){
fini_memfootprint(code, v);
}

/* MEMREUSEDIST */
VOID Instruction_memreusedist_only(INS ins, VOID* v){
/* MEMSTACKDIST */
VOID Instruction_memstackdist_only(INS ins, VOID* v){
if(interval_size == -1){
if(INS_HasRealRep(ins)){
INS_InsertIfCall(ins, IPOINT_BEFORE, (AFUNPTR)returnArg, IARG_FIRST_REP_ITERATION, IARG_END);
Expand All @@ -428,11 +428,11 @@ VOID Instruction_memreusedist_only(INS ins, VOID* v){
INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)all_instr_intervals_count_always, IARG_END);
}

instrument_memreusedist(ins, v);
instrument_memstackdist(ins, v);
}

VOID Fini_memreusedist_only(INT32 code, VOID* v){
fini_memreusedist(code, v);
VOID Fini_memstackdist_only(INT32 code, VOID* v){
fini_memstackdist(code, v);
}

/* MY TYPE */
Expand Down Expand Up @@ -473,7 +473,7 @@ VOID Instruction_custom(INS ins, VOID* v){
//instrument_reg(ins, e);
//instrument_stride(ins, v);
//instrument_memfootprint(ins, v);
//instrument_memreusedist(ins, v);
//instrument_memstackdist(ins, v);
}

VOID Fini_custom(INT32 code, VOID* v){
Expand All @@ -484,7 +484,7 @@ VOID Fini_custom(INT32 code, VOID* v){
//fini_reg(code, v);
//fini_stride(code, v);
//fini_memfootprint(code, v);
//fini_memreusedist(code, v);
//fini_memstackdist(code, v);
}

void init_custom(){
Expand All @@ -495,7 +495,7 @@ void init_custom(){
//init_reg();
//init_stride();
//init_memfootprint();
//init_memreusedist();
//init_memstackdist();
}


Expand Down Expand Up @@ -581,11 +581,11 @@ int main(int argc, char* argv[]){
INS_AddInstrumentFunction(Instruction_memfootprint_only, 0);
PIN_AddFiniFunction(Fini_memfootprint_only, 0);
break;
case MODE_MEMREUSEDIST:
init_memreusedist();
case MODE_MEMSTACKDIST:
init_memstackdist();
PIN_Init(argc, argv);
INS_AddInstrumentFunction(Instruction_memreusedist_only, 0);
PIN_AddFiniFunction(Fini_memreusedist_only, 0);
INS_AddInstrumentFunction(Instruction_memstackdist_only, 0);
PIN_AddFiniFunction(Fini_memstackdist_only, 0);
break;
case MODE_CUSTOM:
init_custom();
Expand Down
20 changes: 10 additions & 10 deletions mica_all.cpp
Expand Up @@ -15,7 +15,7 @@
#include "mica_reg.h" // needed for reg_instr_full, reg_instr_intervals, reg_instr_interval_output and reg_instr_interval_reset
#include "mica_stride.h" // needed for stride_index_mem*, readMem_stride, writeMem_stride, stride_instr_interval_output and stride_instr_interval_reset
#include "mica_memfootprint.h" // needed for memOp, memfootprint_instr_interval_output and memfootprint_instr_interval_reset
#include "mica_memreusedist.h" // needed for memreusedist_memRead, memreusedist_instr_interval_output and memreusedist_instr_interval_reset
#include "mica_memstackdist.h" // needed for memstackdist_memRead, memstackdist_instr_interval_output and memstackdist_instr_interval_reset

#define PROGRESS_THRESHOLD 10000000 // 10M

Expand Down Expand Up @@ -43,7 +43,7 @@ void init_all(){
init_reg();
init_stride();
init_memfootprint();
init_memreusedist();
init_memstackdist();
}

ADDRINT returnArg(BOOL arg){
Expand Down Expand Up @@ -111,8 +111,8 @@ ADDRINT all_buffer_instruction_2reads_write(void* _e, ADDRINT read1_addr, ADDRIN
memOp(read1_addr, read_size); // memfootprint
memOp(read2_addr, read_size);
memOp(write_addr, write_size);
memreusedist_memRead(read1_addr, read_size); // memreusedist
memreusedist_memRead(read2_addr, read_size);
memstackdist_memRead(read1_addr, read_size); // memstackdist
memstackdist_memRead(read2_addr, read_size);
//return ilp_buffer_instruction_2reads_write(_e, read1_addr, read2_addr, read_size, write_addr, write_size);
ilp_buffer_instruction_only(_e);
ilp_buffer_instruction_read(read1_addr, read_size);
Expand All @@ -129,7 +129,7 @@ ADDRINT all_buffer_instruction_read_write(void* _e, ADDRINT read1_addr, ADDRINT
writeMem_stride(stride_index_memwrite, write_addr, write_size);
memOp(read1_addr, read_size); // memfootprint
memOp(write_addr, write_size);
memreusedist_memRead(read1_addr, read_size); // memreusedist
memstackdist_memRead(read1_addr, read_size); // memstackdist
//return ilp_buffer_instruction_read_write(_e, read1_addr, read_size, write_addr, write_size);
ilp_buffer_instruction_only(_e);
ilp_buffer_instruction_read(read1_addr, read_size);
Expand All @@ -144,8 +144,8 @@ ADDRINT all_buffer_instruction_2reads(void* _e, ADDRINT read1_addr, ADDRINT read
readMem_stride(stride_index_memread2, read2_addr, read_size);
memOp(read1_addr, read_size); // memfootprint
memOp(read2_addr, read_size);
memreusedist_memRead(read1_addr, read_size); // memreusedist
memreusedist_memRead(read2_addr, read_size);
memstackdist_memRead(read1_addr, read_size); // memstackdist
memstackdist_memRead(read2_addr, read_size);
//return ilp_buffer_instruction_2reads(_e, read1_addr, read2_addr, read_size);
ilp_buffer_instruction_only(_e);
ilp_buffer_instruction_read(read1_addr, read_size);
Expand All @@ -158,7 +158,7 @@ ADDRINT all_buffer_instruction_read(void* _e, ADDRINT read1_addr, ADDRINT read_s
//itypes_count_mem_read();
readMem_stride(stride_index_memread1, read1_addr, read_size);
memOp(read1_addr, read_size); // memfootprint
memreusedist_memRead(read1_addr, read_size); // memreusedist
memstackdist_memRead(read1_addr, read_size); // memstackdist
//return ilp_buffer_instruction_read(_e, read1_addr, read_size);
ilp_buffer_instruction_only(_e);
ilp_buffer_instruction_read(read1_addr, read_size);
Expand Down Expand Up @@ -213,8 +213,8 @@ VOID all_instr_interval(){
memfootprint_instr_interval_output();
memfootprint_instr_interval_reset();

memreusedist_instr_interval_output();
memreusedist_instr_interval_reset();
memstackdist_instr_interval_output();
memstackdist_instr_interval_reset();

interval_ins_count = 0;
interval_ins_count_for_hpc_alignment = 0;
Expand Down
16 changes: 8 additions & 8 deletions mica_init.cpp
Expand Up @@ -25,16 +25,16 @@ void setup_mica_log(ofstream *log){
/*
* Read mica.conf config file for MICA.
*
* analysis_type: 'all' | 'ilp' | 'ilp_one' | 'itypes' | 'ppm' | 'reg' | 'stride' | 'memfootprint' | 'memreusedist' | 'custom'
* analysis_type: 'all' | 'ilp' | 'ilp_one' | 'itypes' | 'ppm' | 'reg' | 'stride' | 'memfootprint' | 'memstackdist' | 'custom'
* interval_size: 'full' | <integer>
* ilp_size: <integer>
* itypes_spec_file: <string>
*/

enum CONFIG_PARAM {UNKNOWN_CONFIG_PARAM = -1, ANALYSIS_TYPE = 0, INTERVAL_SIZE, ILP_SIZE, BLOCK_SIZE, PAGE_SIZE, ITYPES_SPEC_FILE, APPEND_PID, CONF_PAR_CNT};
const char* config_params_str[CONF_PAR_CNT] = {"analysis_type", "interval_size", "ilp_size", "block_size", "page_size", "itypes_spec_file"};
enum ANALYSIS_TYPE {UNKNOWN_ANALYSIS_TYPE = -1, ALL=0, ILP, ILP_ONE, ITYPES, PPM, MICA_REG, STRIDE, MEMFOOTPRINT, MEMREUSEDIST, CUSTOM, ANA_TYPE_CNT};
const char* analysis_types_str[ANA_TYPE_CNT] = { "all", "ilp", "ilp_one", "itypes", "ppm", "reg", "stride", "memfootprint", "memreusedist", "custom"};
enum ANALYSIS_TYPE {UNKNOWN_ANALYSIS_TYPE = -1, ALL=0, ILP, ILP_ONE, ITYPES, PPM, MICA_REG, STRIDE, MEMFOOTPRINT, MEMSTACKDIST, CUSTOM, ANA_TYPE_CNT};
const char* analysis_types_str[ANA_TYPE_CNT] = { "all", "ilp", "ilp_one", "itypes", "ppm", "reg", "stride", "memfootprint", "memstackdist", "custom"};

enum CONFIG_PARAM findConfigParam(char* s){

Expand All @@ -59,7 +59,7 @@ enum ANALYSIS_TYPE findAnalysisType(char* s){
if(strcmp(s, "reg") == 0){ return MICA_REG; }
if(strcmp(s, "stride") == 0){ return STRIDE; }
if(strcmp(s, "memfootprint") == 0){ return MEMFOOTPRINT; }
if(strcmp(s, "memreusedist") == 0){ return MEMREUSEDIST; }
if(strcmp(s, "memstackdist") == 0){ return MEMSTACKDIST; }
if(strcmp(s, "custom") == 0){ return CUSTOM; }

return UNKNOWN_ANALYSIS_TYPE;
Expand Down Expand Up @@ -155,10 +155,10 @@ void read_config(ofstream* log, INT64* intervalSize, MODE* mode, UINT32* _ilp_wi
(*log) << "Measuring MEMFOOTPRINT characteristics..." << endl;
break;

case MEMREUSEDIST:
*mode = MODE_MEMREUSEDIST;
cerr << "Measuring MEMREUSEDIST characteristics..." << endl;
(*log) << "Measuring MEMREUSEDIST characteristics..." << endl;
case MEMSTACKDIST:
*mode = MODE_MEMSTACKDIST;
cerr << "Measuring MEMSTACKDIST characteristics..." << endl;
(*log) << "Measuring MEMSTACKDIST characteristics..." << endl;
break;

case CUSTOM:
Expand Down
4 changes: 2 additions & 2 deletions mica_init.h
Expand Up @@ -14,9 +14,9 @@
#include "mica_reg.h"
#include "mica_stride.h"
#include "mica_memfootprint.h"
#include "mica_memreusedist.h"
#include "mica_memstackdist.h"

enum MODE { UNKNOWN_MODE, MODE_ALL, MODE_ILP, MODE_ILP_ONE, MODE_ITYPES, MODE_PPM, MODE_REG, MODE_STRIDE, MODE_MEMFOOTPRINT, MODE_MEMREUSEDIST, MODE_CUSTOM };
enum MODE { UNKNOWN_MODE, MODE_ALL, MODE_ILP, MODE_ILP_ONE, MODE_ITYPES, MODE_PPM, MODE_REG, MODE_STRIDE, MODE_MEMFOOTPRINT, MODE_MEMSTACKDIST, MODE_CUSTOM };

void setup_mica_log(ofstream *log);

Expand Down

0 comments on commit 4492835

Please sign in to comment.