From 3b3f78131c95e040652c3b6b753134cab5fda06e Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Thu, 31 Aug 2023 14:51:55 -0700 Subject: [PATCH] sysprof-cli: check for /var/run/host Give users some info if there is a good chance their decode will be bad. --- src/sysprof-cli/sysprof-cli.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sysprof-cli/sysprof-cli.c b/src/sysprof-cli/sysprof-cli.c index c990fc66..11c20408 100644 --- a/src/sysprof-cli/sysprof-cli.c +++ b/src/sysprof-cli/sysprof-cli.c @@ -433,6 +433,13 @@ Examples:\n\ } } + /* Warn about access if we're in a container */ + if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS)) + { + if (!g_file_test ("/var/run/host/usr", G_FILE_TEST_EXISTS)) + g_printerr ("Warning: Flatpak detected but cannot access host, set --filesystem=host\n"); + } + profiler = sysprof_profiler_new (); if (argc == 2)