The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ipc: Print end-user information on Linux

Including how to gathering logs on Linux, and that the service has started.

+69
+69
src/xrt/ipc/server/ipc_server_process.c
··· 24 24 #include "util/u_verify.h" 25 25 #include "util/u_process.h" 26 26 #include "util/u_debug_gui.h" 27 + #include "util/u_pretty_print.h" 27 28 28 29 #include "util/u_git_tag.h" 29 30 ··· 123 124 * Static functions. 124 125 * 125 126 */ 127 + 128 + XRT_MAYBE_UNUSED static void 129 + print_linux_end_user_failed_information(enum u_logging_level log_level) 130 + { 131 + struct u_pp_sink_stack_only sink; 132 + u_pp_delegate_t dg = u_pp_sink_stack_only_init(&sink); 133 + 134 + // Print Newline 135 + #define PN() u_pp(dg, "\n") 136 + // Print Newline, Hash, Space 137 + #define PNH() u_pp(dg, "\n#") 138 + // Print Newline, Hash, Space 139 + #define PNHS(...) u_pp(dg, "\n# "__VA_ARGS__) 140 + // Print Newline, 80 Hashes 141 + #define PN80H() \ 142 + do { \ 143 + PN(); \ 144 + for (uint32_t i = 0; i < 8; i++) { \ 145 + u_pp(dg, "##########"); \ 146 + } \ 147 + } while (false) 148 + 149 + PN80H(); 150 + PNHS(" #"); 151 + PNHS(" The Monado service has failed to start. #"); 152 + PNHS(" #"); 153 + PNHS("If you want to report please upload the logs of the service as a text file. #"); 154 + PNHS("You can also capture the output the monado-cli info command to provide more #"); 155 + PNHS("information about your system, that will help diagnosing your problem. The #"); 156 + PNHS("below commands is how you best capture the information from the commands. #"); 157 + PNHS(" #"); 158 + PNHS(" monado-cli info 2>&1 | tee info.txt #"); 159 + PNHS(" monado-service 2>&1 | tee logs.txt #"); 160 + PNHS(" #"); 161 + PN80H(); 162 + 163 + U_LOG_IFL_I(log_level, "%s", sink.buffer); 164 + } 165 + 166 + XRT_MAYBE_UNUSED static void 167 + print_linux_end_user_started_information(enum u_logging_level log_level) 168 + { 169 + struct u_pp_sink_stack_only sink; 170 + u_pp_delegate_t dg = u_pp_sink_stack_only_init(&sink); 171 + 172 + 173 + PN80H(); 174 + PNHS(" #"); 175 + PNHS(" The Monado service has started. #"); 176 + PNHS(" #"); 177 + PN80H(); 178 + 179 + #undef PN 180 + #undef PNH 181 + #undef PNHS 182 + #undef PN80H 183 + 184 + U_LOG_IFL_I(log_level, "%s", sink.buffer); 185 + } 126 186 127 187 static void 128 188 teardown_all(struct ipc_server *s) ··· 921 981 922 982 int ret = init_all(s, log_level); 923 983 if (ret < 0) { 984 + #ifdef XRT_OS_LINUX 985 + // Print information how to debug issues. 986 + print_linux_end_user_failed_information(log_level); 987 + #endif 988 + 924 989 u_debug_gui_stop(&s->debug_gui); 925 990 free(s); 926 991 return ret; ··· 929 994 // Start the debug UI now (if enabled). 930 995 u_debug_gui_start(s->debug_gui, s->xinst, s->xsysd); 931 996 997 + #ifdef XRT_OS_LINUX 998 + // Print a very clear service started message. 999 + print_linux_end_user_started_information(log_level); 1000 + #endif 932 1001 // Main loop. 933 1002 ret = main_loop(s); 934 1003