Commit Graph

838 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
faa7871b08 Remove duplicate ->probe() calls to speed up startup by 150ms
Now incorporate is fixed to copy across the properties we need in the
superclass, we don't need to do the subclass ->probe().

Note, we still need to do the subclassed ->probe() when using
FU_UDEV_DEVICE_FLAG_VENDOR_FROM_PARENT or when looking at properties
on the parent device.

This also removes the spurious 'already set GType to FuVliUsbhubDevice,
ignoring FuVliUsbhubDevice' messages when running the daemon.
2022-06-14 21:01:57 +01:00
Richard Hughes
4655e028a6 Copy more properties when doing FuUdevDevice->incorporate
We're supposed to be copying any private data derived during ->probe()
so we can create a superclass with the same attributes.
2022-06-14 21:01:57 +01:00
Richard Hughes
db01004cd4 Copy the possible plugins when incorporating
I don't think this is required, but seems safer.
2022-06-14 21:01:57 +01:00
Richard Hughes
30aab6f564 Copy the instance ID strings when incorporating
Also, add a test.
2022-06-14 21:01:57 +01:00
Richard Hughes
599e67cd2c trivial: More efficiently incorporate metadata 2022-06-14 21:01:57 +01:00
Richard Hughes
2203b3ce7b trivial: gi-docgenize some of the function comments 2022-06-14 14:36:52 -05:00
Richard Hughes
2dc6a7ef73 Remove fu_i2c_device_read_full()
Just use the version with the length specified.
2022-06-14 14:36:52 -05: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
1d9d82ebc5 Use a common prefix for CPU-specific methods 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
14cc9b2064 Unexport fu_common_reverse_uint8()
It's only used in one little-used plugin.
2022-06-14 14:36:52 -05:00
Richard Hughes
7f86ffab6f Split out the dump helpers to a new source file 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
3f77af3cd4 Split out the kernel helpers to a new source file 2022-06-14 14:36:52 -05:00
Richard Hughes
fd9b9db5b3 Unexport fu_common_instance_id_strsafe()
We want plugins to use the instance ID builder instead now.
2022-06-14 14:36:52 -05:00
Richard Hughes
f759569a9f Unexport fu_common_extract_archive()
We have a FuFirmware helper now, which doesn't use a temp dir.
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
425fedcca1 trivial: Remove fu_byte_array_set_size_full() 2022-06-14 14:36:52 -05:00
Richard Hughes
ed1b13da28 Split out the memory helpers to a new source file 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
3fe9c0de34 Split out the CRC and sum functions to new source files 2022-06-14 14:36:52 -05: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
b3f69c1c47 scsi: Use the SCSI target to correctly set the physical ID
We don't want to include the SCSI LUN in the physical ID, as this is a
logical concept not relating to the hardware device.

Use the UDev devtype to find the 'correct' parent.
2022-06-11 11:06:01 +01:00
Richard Hughes
4c3a35c842 trivial: Fix a weird win32 compile failure
Windows is defining `interface` as a keyword when including headers.
2022-06-08 15:41:11 +01:00
Richard Hughes
114a08f0b6 Allow quirk entries to add multiple items 2022-06-08 15:15:53 +01:00
Richard Hughes
165ce50614 Revert "Speed up daemon startup by 650ms"
This reverts commit a7642a7b7e.

I forgot that we need the TYPE, DRIVER and most importantly subsystem
for PossiblePlugin quirk matches. We need something more subtle.
2022-06-08 07:56:45 +01:00
Gaël PORTAY
407ce2655c trivial: Add quirk definitions for CFI
This adds the missing definitions for the CFI quirks.
2022-06-08 07:56:07 +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
f9e6aa16a3 Remove some deprecated API 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
0cbcac93cd Rename fu_udev_device_ioctl_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
029d2895bd Rename fu_udev_device_pread_full() as we broke ABI 2022-06-03 13:47:11 -05:00
Richard Hughes
7e62e5b0c9 Add a FuProgress to ->verify() 2022-06-03 13:47:11 -05:00
Richard Hughes
106d45dede Make the API porting document more useful 2022-06-03 13:47:11 -05:00
Richard Hughes
a7642a7b7e Speed up daemon startup by 650ms
Reading properties from drm_dp_aux1 and drm_dp_aux2 took 700ms, and
we're never going to match any GUIDs as the vendor and model IDs are
both unset.
2022-06-01 15:50:13 +01:00
Richard Hughes
f14e4f8b8d trivial: Do not require an ID to finish a progress object
The function might have returned (possibly with an error set) before
fu_progress_set_id() was called.
2022-06-01 15:05:43 +01:00