Skip to content

Commit

Permalink
Add option to disable device profiling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerilk committed Jul 3, 2023
1 parent 4defc27 commit 2b6070a
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions xprof/xprof.sh.erb.in
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ display_help() {
echo " -l, --timeline Dump the timeline. Will create a `out.pftrace` file that can be opened in perfetto (https://ui.perfetto.dev/#!/viewer)"
echo " -j, --json Summary will be printed as json"
echo " -m, --tracing-mode <mode> [minimal, default, full]"
echo " --backend-level <name:value,...> Update tally default backend levels"
echo " --no-profile Device activities will not be profiled"
echo " --backend-level <name:value,...> Update tally default backend levels"
echo " --asm Dump in your current directory low-level kernels information (asm, isa, visa, ...)"
echo " --no-save Data will be processed on-the-fly"
echo " --mangle Use mangled name"
Expand Down Expand Up @@ -199,7 +200,9 @@ enable_events_cl() {
lttngq enable-event --channel=blocking-channel --userspace $opencl_disable_events
fi
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_opencl_build:infos*
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_opencl_profiling:*
if [ $profile = true ]; then
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_opencl_profiling:*
fi
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_opencl_arguments:kernel_info
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_opencl_devices:*
}
Expand All @@ -210,7 +213,9 @@ enable_events_ze() {
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_ze_properties:device_timer
else
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_ze_build:log*
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_ze_profiling:*
if [ $profile = true ]; then
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_ze_profiling:*
fi
# Wildcard using the * character are supported at the end of tracepoint names.
# https://lttng.org/man/1/lttng-enable-event/v2.8/#doc-_understanding_event_rule_conditions
# Disable-event doesn't have wildcard sadly
Expand All @@ -229,7 +234,9 @@ enable_events_ze() {

enable_events_cuda() {
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_cuda:*
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_cuda_profiling:*
if [ $profile = true ]; then
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_cuda_profiling:*
fi
lttngq enable-event --channel=blocking-channel --userspace lttng_ust_cuda_properties:*
}

Expand Down Expand Up @@ -310,12 +317,16 @@ preload_lib_tracers() {
<%= print_loader_logic("cl","libOpenCL","libTracerOpenCL")%>
<% end %>
<% if languages.include?("ze") %>
export LTTNG_UST_ZE_PROFILE=1
thapi_export LTTNG_UST_ZE_PARANOID_DRIFT 1
if [ $profile = true ]; then
export LTTNG_UST_ZE_PROFILE=1
thapi_export LTTNG_UST_ZE_PARANOID_DRIFT 1
fi
<%= print_loader_logic("ze","libze_loader","libTracerZE")%>
<% end %>
<% if languages.include?("cuda") %>
export LTTNG_UST_CUDA_PROFILE=1
if [ $profile = true ]; then
export LTTNG_UST_CUDA_PROFILE=1
fie
<%= print_loader_logic("cuda","libcuda","libTracerCUDA")%>
<% end %>
<% if languages.include?("hip") %>
Expand Down Expand Up @@ -510,6 +521,7 @@ traced_ranks=0
asm=false
replay=false
cleanup=false
profile=true

while (( "$#" )); do
case "$1" in
Expand All @@ -522,6 +534,7 @@ while (( "$#" )); do
-l | --timeline) shift; timeline=true ;;
-j | --json) shift; bt_tally_argv+=" --display_mode=json" ;;
-m | --tracing-mode) shift; tracing_mode=$1; shift ;;
--no-profile) shift; profile=false; shift ;;
--backend-level) shift; bt_tally_argv+=" --backend_level=$1"; shift ;;
--no-save) shift; procesing_mode="on-the-fly" ;;
--traced-ranks) shift; traced_ranks=$1; shift ;;
Expand Down

0 comments on commit 2b6070a

Please sign in to comment.