diff options
Diffstat (limited to 'hal-0.5.11-patches/0015-make-hal-start-a-lot-faster.patch')
-rw-r--r-- | hal-0.5.11-patches/0015-make-hal-start-a-lot-faster.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/hal-0.5.11-patches/0015-make-hal-start-a-lot-faster.patch b/hal-0.5.11-patches/0015-make-hal-start-a-lot-faster.patch new file mode 100644 index 00000000..79a79329 --- /dev/null +++ b/hal-0.5.11-patches/0015-make-hal-start-a-lot-faster.patch @@ -0,0 +1,57 @@ +From df0551bd5925329b37b0f7d50bcf6e01028014cb Mon Sep 17 00:00:00 2001 +From: Arjan van de Ven <arjan@infradead.org> +Date: Wed, 20 Aug 2008 20:03:56 +0200 +Subject: [PATCH 15/48] make hal start a lot faster + +Hal is a significant part of the boot time of (optimized) systems, +so optimizing hal to start faster is certainly worthwhile. + +The patch below cuts the start time of hal by about one third, +by reducing the number of calls to hal_device_get_udi() from +well over 700.000 to below 100.000. +--- + hald/device_info.c | 19 ++++++++++++------- + 1 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/hald/device_info.c b/hald/device_info.c +index 2381612..e378a2e 100644 +--- a/hald/device_info.c ++++ b/hald/device_info.c +@@ -273,22 +273,27 @@ handle_match (struct rule *rule, HalDevice *d) + char prop_to_check[HAL_PATH_MAX]; + const char *key = rule->key; + const char *value = (char *)RULES_PTR(rule->value_offset); ++ const char *d_udi; ++ ++ d_udi = hal_device_get_udi (d); + + /* Resolve key paths like 'someudi/foo/bar/baz:prop.name' '@prop.here.is.an.udi:with.prop.name' */ + if (!resolve_udiprop_path (key, +- hal_device_get_udi (d), ++ d_udi, + udi_to_check, sizeof (udi_to_check), + prop_to_check, sizeof (prop_to_check))) { + /*HAL_ERROR (("Could not resolve keypath '%s' on udi '%s'", key, value));*/ + return FALSE; + } + +- d = hal_device_store_find (hald_get_gdl (), udi_to_check); +- if (d == NULL) +- d = hal_device_store_find (hald_get_tdl (), udi_to_check); +- if (d == NULL) { +- HAL_ERROR (("Could not find device with udi '%s'", udi_to_check)); +- return FALSE; ++ if (strcmp(udi_to_check, d_udi)) { ++ d = hal_device_store_find (hald_get_gdl (), udi_to_check); ++ if (d == NULL) ++ d = hal_device_store_find (hald_get_tdl (), udi_to_check); ++ if (d == NULL) { ++ HAL_ERROR (("Could not find device with udi '%s'", udi_to_check)); ++ return FALSE; ++ } + } + + switch (rule->type_match) { +-- +1.6.1.2 + |