Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
aim
Commits
9f366748
Commit
9f366748
authored
7 years ago
by
Martin Mareš
Browse files
Options
Downloads
Patches
Plain Diff
Access: Drobná vylepšení grafítka
parent
f113bb3a
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
access/graph.pl
+23
-13
23 additions, 13 deletions
access/graph.pl
with
23 additions
and
13 deletions
access/graph.pl
+
23
−
13
View file @
9f366748
#!/usr/bin/perl
#!/usr/bin/perl
my
$min_mem
=
8
;
# Minimum memory block size (KB)
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
@item_sizes
=
(
16
,
64
,
128
,
1024
,
4096
);
# Sizes of items
my
@randomized
=
(
0
,
1
);
# Try randomized accesses?
my
@randomized
=
(
0
,
1
);
# Try randomized accesses?
my
@modify
=
(
0
,
1
);
# Try read-write accesses?
my
@modify
=
(
0
,
1
);
# Try read-write accesses?
...
@@ -46,13 +46,25 @@ for my $f ("access.c", "Makefile") {
...
@@ -46,13 +46,25 @@ for my $f ("access.c", "Makefile") {
-
f
$f
or
symlink
"
../
$f
",
$f
or
die
;
-
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
`;
my
$hostname
=
`
hostname
`;
chomp
$machine
;
chomp
$hostname
;
$machine
.=
"
Array
"
if
$array
;
$machine
.=
"
HugePages
"
if
$huge
;
my
$cpu
=
`
grep -m1 '^model name[[:space:]]
\\
+:' /proc/cpuinfo
`;
$machine
=
"
(
$machine
)
";
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
;
our
$c
;
my
@caches
=
();
my
@caches
=
();
...
@@ -71,15 +83,13 @@ for $c (</sys/devices/system/cpu/cpu0/cache/index*>) {
...
@@ -71,15 +83,13 @@ for $c (</sys/devices/system/cpu/cpu0/cache/index*>) {
my
$w
=
rd
("
ways_of_associativity
");
my
$w
=
rd
("
ways_of_associativity
");
my
$s
=
rd
("
size
");
my
$s
=
rd
("
size
");
my
$t
=
rd
("
type
");
my
$t
=
rd
("
type
");
my
$L
=
rd
("
coherency_line_size
");
my
$line
=
(
$L
==
$prev_L
)
?
""
:
"
(
${L}
B line)
";
$t
=~
s/(.).*/$1/
;
$t
=~
s/(.).*/$1/
;
$t
=~
s/U//
;
$t
=~
s/U//
;
$t
eq
"
I
"
and
next
;
$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
;
$prev_L
=
$L
;
}
}
$machine
.=
"
[
"
.
join
("
,
",
@caches
)
.
"
]
";
$machine
.=
"
$hostname
[
"
.
join
("
"
,
$cpu
,
@caches
)
.
"
]
";
### Profiling ###
### Profiling ###
...
@@ -154,10 +164,10 @@ print GP <<EOF ;
...
@@ -154,10 +164,10 @@ print GP <<EOF ;
set
terminal
png
large
size
1024
,
768
set
terminal
png
large
size
1024
,
768
set
logscale
x
2
set
logscale
x
2
set
key
left
set
key
left
set
xlabel
"
data set size [KB]
"
set
xlabel
"
data set size [K
i
B]
"
set
ylabel
"
time per access [ns]
"
set
ylabel
"
time per access [ns]
"
set
grid
set
grid
set
yrange
[
1
:
50
]
# Change if necessary
set
yrange
[
0
:
15
]
# Change if necessary
EOF
EOF
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment