Skip to content

Commit

Permalink
Mat memory graph
Browse files Browse the repository at this point in the history
  • Loading branch information
kento committed Jul 26, 2018
1 parent 1db2a34 commit d05d279
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/mat-mg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.6
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import numpy
Expand Down
22 changes: 21 additions & 1 deletion src/mat_b2t_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,32 @@
#include "mat.h"
#include "mat_util.h"
#include "mat_io.h"


// ip = int(vec[0])
// access_address = int(vec[1])
// block_address = int(vec[3])
// is_read = int(vec[4])
// object_size = int(vec[6])
// tid = int(vec[7])


static void mat_b2t_print_mem_trace(size_t id, int tid, mat_trace_mem_t *mtrace)
{
int is_read;
size_t offset;

is_read = (mtrace->type == MAT_TRACE_LOAD)? 1:0;
printf("%lu %lu %lu %d %lu %d\n", id, (unsigned long)mtrace->addr, (unsigned long)mtrace->head_addr, is_read, mtrace->alloc_size, tid);
offset = (unsigned long)mtrace->addr - (unsigned long)mtrace->head_addr;
printf("%lu %lu %lu %lu %d %lu %lu %d\n",
id,
(unsigned long)mtrace->addr,
offset,
(unsigned long)mtrace->head_addr,
is_read,
mtrace->size,
mtrace->alloc_size,
tid);
}

static void mat_b2t_print(const char* trace_path)
Expand Down
8 changes: 7 additions & 1 deletion test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ case $1 in
5) ## MAT reuse distance
time -p ../src/mat-rd $2
;;
6) ## MAT reuse distance
6) ## MAT binary to text
time -p ../src/mat-b2t $2
;;
7) ## MAT mgraph
touch .empty
time -p ../scripts/mat-mg $2 .empty
rm .empty
;;
*)
echo "No such test case: $1"
echo " 0) Clean trace files"
Expand All @@ -53,6 +58,7 @@ case $1 in
echo " 4) MAT-PIN stream"
echo " 5) MAT reuse distance"
echo " 6) MAT binary to text"
echo " 7) MAT memory graph"
;;
esac
wait
Expand Down

0 comments on commit d05d279

Please sign in to comment.