summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2022-03-24 16:08:16 +0100
committerBenjamin Berg <bberg@redhat.com>2022-03-24 17:02:27 +0100
commit9058d45685d1c7c08d52fb64c393fed9eeed542b (patch)
tree4edf5610042ef6a734b436ebf6513523646317d4 /tools
parent1003d5c2a69e6c28dcf68adf10181b5180b5defa (diff)
downloadupower-9058d45685d1c7c08d52fb64c393fed9eeed542b.tar.gz
Remove Wakeups API
The API relied on /proc/timer_stats which has been removed from the kernel in 2017. Since then, the API has been non-functional (yet incorrectly reporting support because the support test was buggy). Just remove it completely. The debian codesearch does not uncover any API users. Also, I doubt that any new API (based on tracing scheduler events as perf would do) would map well to what exists now. i.e. if something like this is re-implemented in UPower or elsewhere, then the API should likely look different. And, realistically, if this does need root privileges (i.e. can't be moved to use BPF programs or so on user units), then we can also create a new small daemon that is launched on-demand just for that.
Diffstat (limited to 'tools')
-rw-r--r--tools/up-tool.c65
1 files changed, 0 insertions, 65 deletions
diff --git a/tools/up-tool.c b/tools/up-tool.c
index d993b1b..afd3def 100644
--- a/tools/up-tool.c
+++ b/tools/up-tool.c
@@ -182,62 +182,6 @@ up_tool_do_monitor (UpClient *client)
}
/**
- * up_tool_print_wakeup_item:
- **/
-static void
-up_tool_print_wakeup_item (UpWakeupItem *item)
-{
- g_print ("userspace:%i id:%i, interrupts:%.1f, cmdline:%s, details:%s\n",
- up_wakeup_item_get_is_userspace (item),
- up_wakeup_item_get_id (item),
- up_wakeup_item_get_value (item),
- up_wakeup_item_get_cmdline (item),
- up_wakeup_item_get_details (item));
-}
-
-/**
- * up_tool_show_wakeups:
- **/
-static gboolean
-up_tool_show_wakeups (void)
-{
- guint i;
- gboolean ret;
- UpWakeups *wakeups;
- UpWakeupItem *item;
- guint total;
- GPtrArray *array;
-
- /* create new object */
- wakeups = up_wakeups_new ();
-
- /* do we have support? */
- ret = up_wakeups_get_has_capability (wakeups);
- if (!ret) {
- g_print ("No wakeup capability\n");
- goto out;
- }
-
- /* get total */
- total = up_wakeups_get_total_sync (wakeups, NULL, NULL);
- g_print ("Total wakeups per minute: %i\n", total);
-
- /* get data */
- array = up_wakeups_get_data_sync (wakeups, NULL, NULL);
- if (array == NULL)
- goto out;
- g_print ("Wakeup sources:\n");
- for (i=0; i<array->len; i++) {
- item = g_ptr_array_index (array, i);
- up_tool_print_wakeup_item (item);
- }
- g_ptr_array_unref (array);
-out:
- g_object_unref (wakeups);
- return ret;
-}
-
-/**
* main:
**/
int
@@ -247,7 +191,6 @@ main (int argc, char **argv)
guint i;
GOptionContext *context;
gboolean opt_dump = FALSE;
- gboolean opt_wakeups = FALSE;
gboolean opt_enumerate = FALSE;
gboolean opt_monitor = FALSE;
gchar *opt_show_info = FALSE;
@@ -262,7 +205,6 @@ main (int argc, char **argv)
const GOptionEntry entries[] = {
{ "enumerate", 'e', 0, G_OPTION_ARG_NONE, &opt_enumerate, _("Enumerate objects paths for devices"), NULL },
{ "dump", 'd', 0, G_OPTION_ARG_NONE, &opt_dump, _("Dump all parameters for all objects"), NULL },
- { "wakeups", 'w', 0, G_OPTION_ARG_NONE, &opt_wakeups, _("Get the wakeup data"), NULL },
{ "monitor", 'm', 0, G_OPTION_ARG_NONE, &opt_monitor, _("Monitor activity from the power daemon"), NULL },
{ "monitor-detail", 0, 0, G_OPTION_ARG_NONE, &opt_monitor_detail, _("Monitor with detail"), NULL },
{ "show-info", 'i', 0, G_OPTION_ARG_STRING, &opt_show_info, _("Show information about object path"), NULL },
@@ -301,13 +243,6 @@ main (int argc, char **argv)
goto out;
}
- /* wakeups */
- if (opt_wakeups) {
- up_tool_show_wakeups ();
- retval = EXIT_SUCCESS;
- goto out;
- }
-
if (opt_enumerate || opt_dump) {
GPtrArray *devices;
devices = up_client_get_devices2 (client);