# HG changeset patch # User Paul Boddie # Date 1708213912 -3600 # Node ID 7123a7307a82e4044695758a359e233ae1b02a0c # Parent 2733e5770ee97dedd059eed94e90ea3dd4dd2360 Introduced some debugging output control. diff -r 2733e5770ee9 -r 7123a7307a82 fsaccess/op_run.c --- a/fsaccess/op_run.c Fri Jan 26 00:32:35 2024 +0100 +++ b/fsaccess/op_run.c Sun Feb 18 00:51:52 2024 +0100 @@ -239,8 +239,6 @@ return -1; } - printf("Finished program initiation.\n"); - /* Release the relinquished end of the pipe. */ client_close(output_writer); diff -r 2733e5770ee9 -r 7123a7307a82 libexec/include/exec/process_monitor.h --- a/libexec/include/exec/process_monitor.h Fri Jan 26 00:32:35 2024 +0100 +++ b/libexec/include/exec/process_monitor.h Sun Feb 18 00:51:52 2024 +0100 @@ -1,7 +1,7 @@ /* * A process monitor abstraction. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -34,6 +34,7 @@ public Resource { protected: + bool _debug; /* Resources associated with the created process. */ @@ -47,7 +48,7 @@ l4_cap_idx_t _notifier = L4_INVALID_CAP; public: - explicit ProcessMonitor(); + explicit ProcessMonitor(bool debug = false); /* Server details. */ diff -r 2733e5770ee9 -r 7123a7307a82 libexec/lib/src/external_pager.cc --- a/libexec/lib/src/external_pager.cc Fri Jan 26 00:32:35 2024 +0100 +++ b/libexec/lib/src/external_pager.cc Sun Feb 18 00:51:52 2024 +0100 @@ -1,7 +1,7 @@ /* * A system pager implementation residing in a separate task. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -283,7 +283,9 @@ if (sig == 0) { +#if DEBUG printf("Signal from internal pager.\n"); +#endif /* For some reason, threads cannot be released by the process, so they are also unmapped on its behalf. */ diff -r 2733e5770ee9 -r 7123a7307a82 libexec/lib/src/process_monitor.cc --- a/libexec/lib/src/process_monitor.cc Fri Jan 26 00:32:35 2024 +0100 +++ b/libexec/lib/src/process_monitor.cc Sun Feb 18 00:51:52 2024 +0100 @@ -1,7 +1,7 @@ /* * A process monitor abstraction. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -34,8 +34,8 @@ /* A process monitor receiving signals from a task. */ -ProcessMonitor::ProcessMonitor() -: NotificationSupport() +ProcessMonitor::ProcessMonitor(bool debug) +: NotificationSupport(), _debug(debug) { } @@ -50,7 +50,8 @@ void ProcessMonitor::close() { - printf("Process monitor closing...\n"); + if (_debug) + printf("Process monitor closing...\n"); } @@ -123,7 +124,8 @@ if (sig == 0) { - printf("Signal from task.\n"); + if (_debug) + printf("Signal from task.\n"); /* Cancel any IPC to avoid spurious pager warnings. */ diff -r 2733e5770ee9 -r 7123a7307a82 libexec/rm/region_mapper.cc --- a/libexec/rm/region_mapper.cc Fri Jan 26 00:32:35 2024 +0100 +++ b/libexec/rm/region_mapper.cc Sun Feb 18 00:51:52 2024 +0100 @@ -90,10 +90,13 @@ return 1; } - printf("Starting pager...\n"); + if (debug) + printf("Starting pager...\n"); + server.start(true); - printf("Ending pager...\n"); + if (debug) + printf("Ending pager...\n"); return 0; }