diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library.cpp index 05d182fa71..64d5f6bdf7 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library.cpp @@ -410,6 +410,22 @@ rocprofsys_init_library_hidden() static bool _once = false; auto _debug_init = get_debug_init(); + int _selinux_mode = 0; + { + std::ifstream _fenforcing{ "/sys/fs/selinux/enforce" }; + if(!(_fenforcing >> _selinux_mode)) _selinux_mode = 0; + _fenforcing.close(); + } + + if(_selinux_mode == 1) + { + ROCPROFSYS_BASIC_VERBOSE(0, "/sys/fs/selinux/enforce has a value of %i. \n", + _selinux_mode); + std::cerr << "SELinux enforcing mode detected. Consider disabling SELinux " + << "or configure permissive mode with 'sudo setenforce 0'. Aborting.\n"; + std::exit(EXIT_FAILURE); + } + ROCPROFSYS_CONDITIONAL_BASIC_PRINT_F(_debug_init, "State is %s...\n", std::to_string(get_state()).c_str()); diff --git a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp index 59cf4e72f1..975c27837e 100644 --- a/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp +++ b/projects/rocprofiler-systems/source/lib/rocprof-sys/library/rocprofiler-sdk.cpp @@ -1851,14 +1851,11 @@ tool_hip_stream_callback(rocprofiler_callback_tracing_record_t record, // STREAM_HANDLE_CREATE and DESTROY are no-ops if(record.operation == ROCPROFILER_HIP_STREAM_CREATE) { - ROCPROFSYS_VERBOSE_F( - 2, "Entered hip_streams_callback function for ROCPROFILER_HIP_STREAM_CREATE"); + ROCPROFSYS_VERBOSE_F(3, " operation = ROCPROFILER_HIP_STREAM_CREATE\n"); } else if(record.operation == ROCPROFILER_HIP_STREAM_DESTROY) { - ROCPROFSYS_VERBOSE_F( - 2, - "Entered hip_streams_callback function for ROCPROFILER_HIP_STREAM_DESTROY"); + ROCPROFSYS_VERBOSE_F(3, " operation = ROCPROFILER_HIP_STREAM_DESTROY\n"); } else if(record.operation == ROCPROFILER_HIP_STREAM_SET) { @@ -1866,17 +1863,19 @@ tool_hip_stream_callback(rocprofiler_callback_tracing_record_t record, // called if(record.phase == ROCPROFILER_CALLBACK_PHASE_ENTER) { - ROCPROFSYS_VERBOSE_F( - 2, "Entered hip_streams_callback function for ROCPROFILER_HIP_STREAM_SET " - "with ROCPROFILER_CALLBACK_PHASE_ENTER"); + ROCPROFSYS_VERBOSE_F(3, + " operation = ROCPROFILER_HIP_STREAM_SET, phase = " + "ROCPROFILER_CALLBACK_PHASE_ENTER, stream_id=%lu\n", + (unsigned long) stream_id.handle); stream_id_push(stream_id); } // Pop stream ID off of stream stack after underlying HIP function is completed else if(record.phase == ROCPROFILER_CALLBACK_PHASE_EXIT) { - ROCPROFSYS_VERBOSE_F( - 2, "Entered hip_stream_callback function for ROCPROFILER_HIP_STREAM_SET " - "with ROCPROFILER_CALLBACK_PHASE_EXIT"); + ROCPROFSYS_VERBOSE_F(3, + "operation = ROCPROFILER_HIP_STREAM_SET, phase = " + "ROCPROFILER_CALLBACK_PHASE_EXIT, stream_id=%lu\n", + (unsigned long) stream_id.handle); stream_id_pop(); } }