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
HeteroFlow
THAPI
Commits
f7f20104
Commit
f7f20104
authored
Jan 12, 2021
by
Brice Videau
Browse files
Added new event to dump device timer when available.
parent
3b9d82f0
Pipeline
#12269
failed with stage
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
opencl/opencl_events.yaml
View file @
f7f20104
...
@@ -243,3 +243,12 @@ lttng_ust_opencl_devices:
...
@@ -243,3 +243,12 @@ lttng_ust_opencl_devices:
fields
:
fields
:
-
[
ctf_integer_hex
,
uintptr_t
,
device
,
"
(uintptr_t)device"
]
-
[
ctf_integer_hex
,
uintptr_t
,
device
,
"
(uintptr_t)device"
]
-
[
ctf_string
,
name
,
name
]
-
[
ctf_string
,
name
,
name
]
-
name
:
device_timer
args
:
-
[
cl_device_id
,
device
]
-
[
cl_ulong
,
device_timestamp
]
-
[
cl_ulong
,
host_timestamp
]
fields
:
-
[
ctf_integer_hex
,
uintptr_t
,
device
,
"
(uintptr_t)device"
]
-
[
ctf_integer
,
cl_ulong
,
device_timestamp
,
device_timestamp
]
-
[
ctf_integer
,
cl_ulong
,
host_timestamp
,
host_timestamp
]
opencl/opencl_model.rb
View file @
f7f20104
...
@@ -1151,7 +1151,13 @@ register_prologue "clGetDeviceIDs", <<EOF
...
@@ -1151,7 +1151,13 @@ register_prologue "clGetDeviceIDs", <<EOF
cl_uint n_e;
cl_uint n_e;
if (tracepoint_enabled(lttng_ust_opencl_devices, device_name) && !num_devices && devices) {
if (tracepoint_enabled(lttng_ust_opencl_devices, device_name) && !num_devices && devices) {
num_devices = &n_e;
num_devices = &n_e;
}
}
EOF
register_prologue
"clGetDeviceIDs"
,
<<
EOF
if (tracepoint_enabled(lttng_ust_opencl_devices, device_timer) && !num_devices && devices) {
num_devices = &n_e;
}
EOF
EOF
register_epilogue
"clGetDeviceIDs"
,
<<
EOF
register_epilogue
"clGetDeviceIDs"
,
<<
EOF
...
@@ -1162,6 +1168,14 @@ register_epilogue "clGetDeviceIDs", <<EOF
...
@@ -1162,6 +1168,14 @@ register_epilogue "clGetDeviceIDs", <<EOF
}
}
EOF
EOF
register_epilogue
"clGetDeviceIDs"
,
<<
EOF
if (tracepoint_enabled(lttng_ust_opencl_devices, device_timer) && _retval == CL_SUCCESS && devices) {
for (cl_uint i = 0; i < *num_devices; i++) {
dump_device_timer(devices[i]);
}
}
EOF
str
=
$opencl_commands
.
select
{
|
c
|
c
.
extension?
}.
collect
{
|
c
|
str
=
$opencl_commands
.
select
{
|
c
|
c
.
extension?
}.
collect
{
|
c
|
<<
EOF
<<
EOF
if (strcmp(func_name, "
#{
c
.
prototype
.
name
}
") == 0) {
if (strcmp(func_name, "
#{
c
.
prototype
.
name
}
") == 0) {
...
...
opencl/tracer_opencl_helpers.include.c
View file @
f7f20104
...
@@ -23,7 +23,7 @@ struct opencl_version {
...
@@ -23,7 +23,7 @@ struct opencl_version {
//static const struct opencl_version opencl_version_1_1 = {1, 1};
//static const struct opencl_version opencl_version_1_1 = {1, 1};
static
const
struct
opencl_version
opencl_version_1_2
=
{
1
,
2
};
static
const
struct
opencl_version
opencl_version_1_2
=
{
1
,
2
};
//static const struct opencl_version opencl_version_2_0 = {2, 0};
//static const struct opencl_version opencl_version_2_0 = {2, 0};
//
static const struct opencl_version opencl_version_2_1 = {2, 1};
static
const
struct
opencl_version
opencl_version_2_1
=
{
2
,
1
};
//static const struct opencl_version opencl_version_2_2 = {2, 2};
//static const struct opencl_version opencl_version_2_2 = {2, 2};
static
inline
int
compare_opencl_version
(
const
struct
opencl_version
*
v1
,
const
struct
opencl_version
*
v2
)
{
static
inline
int
compare_opencl_version
(
const
struct
opencl_version
*
v1
,
const
struct
opencl_version
*
v2
)
{
...
@@ -759,6 +759,19 @@ cleanup:
...
@@ -759,6 +759,19 @@ cleanup:
free
(
name
);
free
(
name
);
}
}
static
inline
void
dump_device_timer
(
cl_device_id
device
)
{
struct
opencl_version
version
=
{
1
,
0
};
get_device_platform_version
(
device
,
&
version
);
if
(
compare_opencl_version
(
&
version
,
&
opencl_version_2_1
)
>=
0
)
{
cl_ulong
device_timestamp
;
cl_ulong
host_timestamp
;
if
(
CL_GET_DEVICE_AND_HOST_TIMER_PTR
(
device
,
&
device_timestamp
,
&
host_timestamp
)
!=
CL_SUCCESS
)
return
;
do_tracepoint
(
lttng_ust_opencl_devices
,
device_timer
,
device
,
device_timestamp
,
host_timestamp
);
}
}
static
inline
void
dump_program_device_build_infos
(
cl_program
program
,
cl_device_id
device
)
{
static
inline
void
dump_program_device_build_infos
(
cl_program
program
,
cl_device_id
device
)
{
cl_build_status
build_status
;
cl_build_status
build_status
;
char
*
build_options
=
""
;
char
*
build_options
=
""
;
...
...
utils/xprof.sh.erb.in
View file @
f7f20104
...
@@ -73,7 +73,7 @@ trace_and_summary() {
...
@@ -73,7 +73,7 @@ trace_and_summary() {
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_build:infos
*
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_build:infos
*
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_profiling:
*
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_profiling:
*
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_arguments:kernel_info
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_arguments:kernel_info
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_devices:
device_name
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_opencl_devices:
*
<% end %>
<% end %>
<%
if
languages.include?
(
"ze"
)
%>
<%
if
languages.include?
(
"ze"
)
%>
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_ze:
*
lttng
$quiet
enable-event
--channel
=
blocking-channel
--userspace
lttng_ust_ze:
*
...
...
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