Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
German Leon
Carol-fi
Commits
460770cd
Commit
460770cd
authored
Dec 18, 2020
by
leon@uji.es
Browse files
Cruzaitos
parent
b7e5ba94
Changes
2
Hide whitespace changes
Inline
Side-by-side
fault_injector.py
View file @
460770cd
...
...
@@ -693,6 +693,7 @@ def main():
'fault_models'
:
[
int
(
i
)
for
i
in
str
(
conf
.
get
(
'DEFAULT'
,
'faultModel'
)).
split
(
','
)],
'max_time'
:
float
(
kernel_info_dict
[
'max_time'
])
*
float
(
conf
.
get
(
'DEFAULT'
,
'maxWaitTimes'
)),
'end_time'
:
float
(
kernel_info_dict
[
'max_time_kernel'
]),
'max_regs'
:
int
(
kernel_info_dict
[
'max_regs'
]),
'iterations'
:
each_thread_iterations
,
'benchmark_binary'
:
benchmark_binary
,
'benchmark_args'
:
conf
.
get
(
'DEFAULT'
,
'benchmarkArgs'
),
...
...
@@ -718,7 +719,7 @@ def main():
for
thread
in
gpus_threads
:
thread
.
join
()
ret
+=
thread
.
exit_code
#
ret += thread.exit_code
os
.
system
(
"rm -f {}/bin/*"
.
format
(
current_path
))
if
exit_injector
:
...
...
@@ -727,7 +728,7 @@ def main():
cf
.
printf
(
"Fault injection finished, results can be found in {}"
.
format
(
csv_file
))
########################################################################
return
re
s
return
re
t
########################################################################
# Main #
########################################################################
...
...
prueba.py
View file @
460770cd
import
os
import
re
import
gdb
import
time
import
common_functions
as
cf
def
exit_handler
(
event
):
global
nosalir
nosalir
=
False
...
...
@@ -18,8 +20,42 @@ Handler that will put a breakpoint on the kernel after
signal
"""
def
selectrd
():
linea
=
cf
.
execute_command
(
gdb
=
gdb
,
to_execute
=
"x/1i $pc"
)
print
(
linea
)
#+"-"+str(len(linea))+"-"+linea[0])
print
(
"============"
)
lista
=
re
.
findall
(
r
"R(\d+)"
,
linea
[
0
])
#Si no hay nexti
listareg
=
[
" R{} "
.
format
(
x
)
for
x
in
lista
]
strlistareg
=
"info registers "
for
x
in
listareg
:
strlistareg
+=
x
;
print
(
strlistareg
)
valores
=
cf
.
execute_command
(
gdb
=
gdb
,
to_execute
=
strlistareg
)
print
(
"===========VALORES=========="
)
regs
=
{}
for
x
in
valores
:
print
(
x
)
m
=
re
.
match
(
r
".*R(\d+).*0x([0-9a-fA-F]+).*"
,
x
)
if
m
:
regs
[
m
.
group
(
1
)]
=
m
.
group
(
2
)
print
(
str
(
m
.
group
(
0
))
+
" "
+
str
(
m
.
group
(
1
)))
#Loop----
gdb
.
execute
(
"nexti"
)
linea
=
cf
.
execute_command
(
gdb
=
gdb
,
to_execute
=
"x/1i $pc"
)
valores
=
cf
.
execute_command
(
gdb
=
gdb
,
to_execute
=
strlistareg
)
regdst
=
{}
for
x
in
valores
:
print
(
x
)
m
=
re
.
match
(
r
".*R(\d+).*0x([0-9a-fA-F]+).*"
,
x
)
if
m
:
if
(
regs
[
m
.
group
(
1
)]
!=
m
.
group
(
2
))
regdst
.
add
(
m
.
group
(
1
))
print
(
type
(
lista
))
print
(
lista
)
def
set_event
(
event
):
global
trun
,
ocurrencias
,
t
if
(
isinstance
(
event
,
gdb
.
BreakpointEvent
)):
...
...
@@ -47,10 +83,16 @@ def main():
# Connecting to a stop signal event
gdb
.
events
.
stop
.
connect
(
set_event
)
gdb
.
execute
(
"file ~/rodinia_3.1/cuda/lud/cuda/lud_cuda"
)
gdb
.
execute
(
"set arg -s 10000"
)
gdb
.
execute
(
"break lud_cuda"
)
#gdb.execute("file ~/rodinia_3.1/cuda/lud/cuda/lud_cuda")
#gdb.execute("set arg -s 10000")
#gdb.execute("break lud_cuda")
gdb
.
execute
(
"file codes/mmElem/matrixMul"
)
gdb
.
execute
(
"set arg -wA=16384 -hA=16384 -hB=16384 -wB=16384"
)
gdb
.
execute
(
"set cuda break_on_launch application"
)
gdb
.
execute
(
'r'
)
selectrd
()
nosalir
=
True
while
nosalir
:
gdb
.
execute
(
"finish"
)
...
...
Write
Preview
Supports
Markdown
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