Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Martin Mareš
aim
Commits
9f366748
Commit
9f366748
authored
Nov 14, 2017
by
Martin Mareš
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Access: Drobná vylepšení grafítka
parent
f113bb3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
13 deletions
+23
-13
access/graph.pl
access/graph.pl
+23
-13
No files found.
access/graph.pl
View file @
9f366748
#!/usr/bin/perl
my
$min_mem
=
8
;
# Minimum memory block size (KB)
my
$max_mem
=
65536
;
# Maximum memory block size (KB), must fit in physical memory
my
$max_mem
=
262144
;
# Maximum memory block size (KB), must fit in physical memory
my
@item_sizes
=
(
16
,
64
,
128
,
1024
,
4096
);
# Sizes of items
my
@randomized
=
(
0
,
1
);
# Try randomized accesses?
my
@modify
=
(
0
,
1
);
# Try read-write accesses?
...
...
@@ -46,13 +46,25 @@ for my $f ("access.c", "Makefile") {
-
f
$f
or
symlink
"
../
$f
",
$f
or
die
;
}
### Get machine
name and the description
of caches ###
### Get machine
description, including layout
of caches ###
my
$machine
=
`
hostname
`;
chomp
$machine
;
$machine
.=
"
Array
"
if
$array
;
$machine
.=
"
HugePages
"
if
$huge
;
$machine
=
"
(
$machine
)
";
my
$hostname
=
`
hostname
`;
chomp
$hostname
;
my
$cpu
=
`
grep -m1 '^model name[[:space:]]
\\
+:' /proc/cpuinfo
`;
chomp
$cpu
;
$cpu
=~
s{^model name\s+:\s*}{}
;
$cpu
=
"
$cpu
";
$cpu
=~
s{\(tm\)|\(r\)}{}gi
;
$cpu
=~
s{ (Intel|AMD|CPU|Processor) }{ }g
;
$cpu
=~
s{ @.*}{}
;
$cpu
=~
s{\s+}{ }g
;
$cpu
=~
s{^\s+|\s+$}{}g
;
my
@options
=
();
push
@options
,
(
$array
?
"
Array
"
:
"
List
");
push
@options
,
"
HugePages
"
if
$huge
;
$machine
=
'
(
'
.
join
("
",
@options
)
.
'
)
';
our
$c
;
my
@caches
=
();
...
...
@@ -71,15 +83,13 @@ for $c (</sys/devices/system/cpu/cpu0/cache/index*>) {
my
$w
=
rd
("
ways_of_associativity
");
my
$s
=
rd
("
size
");
my
$t
=
rd
("
type
");
my
$L
=
rd
("
coherency_line_size
");
my
$line
=
(
$L
==
$prev_L
)
?
""
:
"
(
${L}
B line)
";
$t
=~
s/(.).*/$1/
;
$t
=~
s/U//
;
$t
eq
"
I
"
and
next
;
push
@caches
,
"
L
$l$t
$s
$w
-way
$line
";
push
@caches
,
"
L
$l$t
:
$s
/
$w
-way
";
$prev_L
=
$L
;
}
$machine
.=
"
[
"
.
join
("
,
"
,
@caches
)
.
"
]
";
$machine
.=
"
$hostname
[
"
.
join
("
",
$cpu
,
@caches
)
.
"
]
";
### Profiling ###
...
...
@@ -154,10 +164,10 @@ print GP <<EOF ;
set
terminal
png
large
size
1024
,
768
set
logscale
x
2
set
key
left
set
xlabel
"
data set size [KB]
"
set
xlabel
"
data set size [K
i
B]
"
set
ylabel
"
time per access [ns]
"
set
grid
set
yrange
[
1
:
50
]
# Change if necessary
set
yrange
[
0
:
15
]
# Change if necessary
EOF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment