Commit Graph

2320 Commits

Author SHA1 Message Date
Richard Hughes
cf9ebdb703 Add startup profiling functionality
Using `sudo FWUPD_PROFILE=10 ./src/fwupd --verbose` will print a
dump of startup times onto the console so that we can debug which
plugin is slowing down system startup. For example:

    ../src/fu-engine.c:5409:plugins-coldplug [108.55ms]:
        ../plugins/amt/fu-plugin-amt.c:437:amt [27.14ms]:
            :create-context [12.66ms]
            :get-version [8.44ms]
            :add-device [3.95ms]
2022-06-14 22:08:02 +01:00
Richard Hughes
7a5964435f Add startup profiling support to FuPlugin->init() 2022-06-14 22:08:02 +01:00
Richard Hughes
d4d0ba0faf Unexport fu_common_cab_build_silo()
There's no reason this needs to be in the shared library.
2022-06-14 14:36:52 -05:00
Richard Hughes
3eaa907534 Remove the now unnecessary fu_smbios_to_string() 2022-06-14 14:36:52 -05:00
Richard Hughes
fc2da47b69 Remove fu_strtoull_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
377bcb718f Remove the 'common' prefix from the volume creation methods 2022-06-14 14:36:52 -05:00
Richard Hughes
4105768a01 Remove the 'common' prefix when parsing version numbers 2022-06-14 14:36:52 -05:00
Richard Hughes
3e0a4dc1c3 Be smarter and include less header files per source file 2022-06-14 14:36:52 -05:00
Richard Hughes
067d7d8088 Split out the path helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
2822d724b2 Unexport the nearly-unused FuAppFlags 2022-06-14 14:36:52 -05:00
Richard Hughes
770a452132 Unexport fu_common_error_array_get_best()
Plugins should not be using this.
2022-06-14 14:36:52 -05:00
Richard Hughes
72ca59653e Unexport fu_common_uri_get_scheme()
We don't want plugins to be using this.
2022-06-14 14:36:52 -05:00
Richard Hughes
518ba8b6f7 Unexport fu_common_realpath()
We don't want plugins to be using this.
2022-06-14 14:36:52 -05:00
Richard Hughes
2c5e4ff3ab Unexport fu_common_firmware_builder()
We don't want plugins to be using this.
2022-06-14 14:36:52 -05:00
Richard Hughes
25dccf09f7 Unexport fu_common_spawn_sync()
This isn't something we want plugins to use.
2022-06-14 14:36:52 -05:00
Richard Hughes
4b1313b406 Split out the GByte helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
9d33c29e92 Split out the string helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
c6581fb7a6 Split out the GByteArray helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
0d1ba6667f trivial: Remove a few ctags headers that snuck in 2022-06-14 17:57:38 +01:00
Richard Hughes
9b29d70f31 Add a progress flag to indicate for when the child returns early
Using `fu_progress_finished(fu_progress_get_child(progress))` is IMHO
a hacky workaround.
2022-06-14 14:31:19 +01:00
Richard Hughes
28395271e9 trivial: Fix a tiny memory leak with fwupdtool get-plugins 2022-06-13 20:17:45 +01:00
Richard Hughes
2ae4587a1c trivial: Add three more update categories 2022-06-13 13:00:38 +01:00
Richard Hughes
3a2f8e5d40 Fix a warning when using 'fwupdtool install-blob
Do not re-use the global FuProgress object for multiple operations.
2022-06-11 11:05:08 +01:00
Richard Hughes
fa1708e76f Correctly set the progress steps when loading backends 2022-06-08 15:41:45 +01:00
Richard Hughes
314003df90 Correctly set the progress steps when loading plugins 2022-06-08 15:41:45 +01:00
Richard Hughes
0ef11aee0c Add each USB device manually to correctly set the progress steps 2022-06-08 15:41:45 +01:00
Richard Hughes
45f71b1ecc trivial: Remove one layer of indirection when getting config keys
This makes it much easier to add new config keys in the future.
2022-06-08 13:41:38 +01:00
Richard Hughes
e6b487e762 Add FuProgress to ->startup() and ->coldplug()
This allows us to profile the daemon startup so we can find any plugins
taking an inordinate amount of time to start.
2022-06-04 20:21:50 +01:00
Richard Hughes
dc91d59f8e Remove the recently added fu_progress_add_step_full()
Just break API instead.
2022-06-03 13:47:11 -05:00
Richard Hughes
4ee6cce9b8 Remove some duplicated unsafe API 2022-06-03 13:47:11 -05:00
Richard Hughes
d6fd08e3a5 Remove some deprecated API 2022-06-03 13:47:11 -05:00
Richard Hughes
5ef0ae182d Add a 'name' attribute to each FuProgress step
This allows us to print better warning strings, and in the future
would allow us to profile each operation in a meaningful way.

Also, add context to some of the progress steps as required.
2022-06-01 15:05:43 +01:00
Richard Hughes
65a220c718 trivial: Remove unused problem string 2022-05-30 16:27:03 +02:00
Richard Hughes
06e009297b Store the last-set status in the daemon
We emit to the client from the daemon, and also proxy the status from
the engine, i.e. we're setting the same property in two places.

When the client requests the last-set status, recover the value sent
from the lowest layer (the daemon) rather than the engine. The former
gets reset back to IDLE automatically, the latter does not.

Fixes https://github.com/fwupd/fwupd/issues/4649
2022-05-26 11:53:28 +01:00
Richard Hughes
2fff75b0ac trivial: Fix a tiny leak when setting the request locale 2022-05-26 11:49:47 +01:00
Richard Hughes
2319f19306 Allow a plugin to only use the RemoveDelay when waiting for replug
Only opt-in plugins that have been tested -- unconditionally enabling
this may cause regressions on devices like docks.

Fixes https://github.com/fwupd/fwupd/issues/4378
2022-05-24 19:52:04 +01:00
Gaël PORTAY
bc49afec7a fu-tool: Allow to request post actions from the end user 2022-05-24 08:36:30 -04:00
Gaël PORTAY
09de8dbc0c fu-tool: Allow to request immediate actions from the end user 2022-05-24 08:36:30 -04:00
Gaël PORTAY
391c85ae27 trivial: Fix segmentation faults if no error set 2022-05-24 06:43:02 -04:00
Gaël PORTAY
5a0fcf5933 trivial: engine: Fix typo
This removes the word udev from the warning message to stay consistant
with the side callback fu_engine_backend_device_added_cb() that does not
mention this word either.
2022-05-24 06:43:02 -04:00
Richard Hughes
5e6ed64f68 Add X-UsbReceiver as an update category 2022-05-24 11:09:18 +01:00
Gaël PORTAY
12279b5165 trivial: util: Fix trailing space 2022-05-22 04:02:32 -04:00
Richard Hughes
2db224627c Do not leave the daemon in 'decompressing' state
Always return to IDLE even in event of an auth error.

Fixes https://github.com/fwupd/fwupd/issues/4649
2022-05-20 14:19:13 +01:00
Richard Hughes
519e80b1ee Allow clients to opt-in to showing updates with user-solvable problems
When typing 'fwupdmgr get-updates' show the updates that *could* be
installed if the problem was resolved.

Do not unconditionally do this, as some clients such as gnome-software
assume that all updates returned by GetUpdates() are updatable with
Install() -- and in a GUI we only want to show the updates we can apply
*right now*. When the problem is removed (e.g. AC power is connected)
the GUI client will notify the user as required, unlike a CLI tool.

Fixes https://github.com/fwupd/fwupd/issues/4629
2022-05-20 13:20:33 +01:00
Richard Hughes
aadf8c07c7 trivial: Watch the FwupdDevice problems in the engine
This ensures we refresh the UI when problems are added or removed.
2022-05-20 10:54:34 +01:00
Richard Hughes
8ebad4ea75 Specify an enumerated problem when inhibiting devices
This allows us to make smarter policy decisions in the future on when
to show unavailable updates. It also means we can show translated
text in the frond-end clients.

Only problems the user can "fix" are enumerated. For example, opening
the laptop lid, or charging the device battery.
2022-05-19 13:09:03 -05:00
Richard Hughes
a4906010d6 Add a way to read the device firmware in fwupdtool
In most cases 'fwupdtool firmware-dump' and 'fwupdtool firmware-read'
are going to be the same. This isn't true in all cases, especially when
dealing with composite firmware like archives.

See https://github.com/fwupd/fwupd/pull/4623#issuecomment-1129227133
2022-05-19 09:29:44 +01:00
Richard Hughes
09c703638f trivial: Pass the FwupdClient to fu_util_device_to_string()
This will be useful for future code that needs the system state for
translated messages, e.g. system battery level.
2022-05-18 15:03:00 -05:00
Richard Hughes
714a87771d trivial: Use FwupdClient in fu_util_print_tree()
This allows us to print the tree title without generating it from the caller.
2022-05-18 15:03:00 -05:00
Richard Hughes
91f23d67ab Export the system battery levels on the D-Bus interface 2022-05-18 07:16:07 +01:00