Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
36d67f73
Commit
36d67f73
authored
Apr 23, 2021
by
Antoine Kaufmann
Browse files
trace: add gem5 instruction event
parent
aa796ba1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
trace/events.h
trace/events.h
+15
-0
trace/gem5.cc
trace/gem5.cc
+2
-0
trace/process.cc
trace/process.cc
+4
-1
No files found.
trace/events.h
View file @
36d67f73
...
...
@@ -42,6 +42,21 @@ class event {
virtual
void
dump
(
std
::
ostream
&
out
)
=
0
;
};
class
EHostInstr
:
public
event
{
public:
uint64_t
pc
;
EHostInstr
(
uint64_t
ts_
,
uint64_t
pc_
)
:
event
(
ts_
),
pc
(
pc_
)
{
}
virtual
~
EHostInstr
()
{
}
virtual
void
dump
(
std
::
ostream
&
out
)
{
out
<<
ts
<<
": H.INSTR pc="
<<
std
::
hex
<<
pc
<<
std
::
dec
<<
std
::
endl
;
}
};
class
EHostCall
:
public
event
{
public:
const
std
::
string
&
fun
;
...
...
trace/gem5.cc
View file @
36d67f73
...
...
@@ -52,6 +52,8 @@ void gem5_parser::process_msg(uint64_t ts, char *comp_name,
if
(
!
p
.
consume_hex
(
addr
)
||
p
.
consume_char
(
'.'
))
return
;
yield
(
std
::
make_shared
<
EHostInstr
>
(
ts
,
addr
));
if
(
const
std
::
string
*
s
=
syms
.
lookup
(
addr
))
{
yield
(
std
::
make_shared
<
EHostCall
>
(
ts
,
*
s
));
}
...
...
trace/process.cc
View file @
36d67f73
...
...
@@ -81,7 +81,10 @@ void Printer(coro_t::pull_type &source) {
uint64_t
ts_off
=
0
;
for
(
auto
ev
:
source
)
{
std
::
shared_ptr
<
EHostCall
>
hc
;
if
((
hc
=
std
::
dynamic_pointer_cast
<
EHostCall
>
(
ev
))
&&
std
::
shared_ptr
<
EHostInstr
>
hi
;
if
((
hi
=
std
::
dynamic_pointer_cast
<
EHostInstr
>
(
ev
)))
{
continue
;
}
else
if
((
hc
=
std
::
dynamic_pointer_cast
<
EHostCall
>
(
ev
))
&&
strcmp
(
ev
->
source
->
label
,
"C"
)
&&
hc
->
fun
==
"__sys_sendto"
)
{
std
::
cout
<<
"---------- REQ START:"
<<
ev
->
ts
<<
std
::
endl
;
...
...
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