diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 24 | ||||
| -rw-r--r-- | lib/lru_cache.c | 23 | ||||
| -rw-r--r-- | lib/rhashtable.c | 10 |
3 files changed, 39 insertions, 18 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index cb45f59685e6..07c28323f88f 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -143,6 +143,30 @@ config DEBUG_INFO_REDUCED | |||
| 143 | DEBUG_INFO build and compile times are reduced too. | 143 | DEBUG_INFO build and compile times are reduced too. |
| 144 | Only works with newer gcc versions. | 144 | Only works with newer gcc versions. |
| 145 | 145 | ||
| 146 | config DEBUG_INFO_SPLIT | ||
| 147 | bool "Produce split debuginfo in .dwo files" | ||
| 148 | depends on DEBUG_INFO | ||
| 149 | help | ||
| 150 | Generate debug info into separate .dwo files. This significantly | ||
| 151 | reduces the build directory size for builds with DEBUG_INFO, | ||
| 152 | because it stores the information only once on disk in .dwo | ||
| 153 | files instead of multiple times in object files and executables. | ||
| 154 | In addition the debug information is also compressed. | ||
| 155 | |||
| 156 | Requires recent gcc (4.7+) and recent gdb/binutils. | ||
| 157 | Any tool that packages or reads debug information would need | ||
| 158 | to know about the .dwo files and include them. | ||
| 159 | Incompatible with older versions of ccache. | ||
| 160 | |||
| 161 | config DEBUG_INFO_DWARF4 | ||
| 162 | bool "Generate dwarf4 debuginfo" | ||
| 163 | depends on DEBUG_INFO | ||
| 164 | help | ||
| 165 | Generate dwarf4 debug info. This requires recent versions | ||
| 166 | of gcc and gdb. It makes the debug information larger. | ||
| 167 | But it significantly improves the success of resolving | ||
| 168 | variables in gdb on optimized code. | ||
| 169 | |||
| 146 | config ENABLE_WARN_DEPRECATED | 170 | config ENABLE_WARN_DEPRECATED |
| 147 | bool "Enable __deprecated logic" | 171 | bool "Enable __deprecated logic" |
| 148 | default y | 172 | default y |
diff --git a/lib/lru_cache.c b/lib/lru_cache.c index 4a83ecd03650..852c81e3ba9a 100644 --- a/lib/lru_cache.c +++ b/lib/lru_cache.c | |||
| @@ -169,7 +169,7 @@ out_fail: | |||
| 169 | return NULL; | 169 | return NULL; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | void lc_free_by_index(struct lru_cache *lc, unsigned i) | 172 | static void lc_free_by_index(struct lru_cache *lc, unsigned i) |
| 173 | { | 173 | { |
| 174 | void *p = lc->lc_element[i]; | 174 | void *p = lc->lc_element[i]; |
| 175 | WARN_ON(!p); | 175 | WARN_ON(!p); |
| @@ -643,9 +643,10 @@ void lc_set(struct lru_cache *lc, unsigned int enr, int index) | |||
| 643 | * lc_dump - Dump a complete LRU cache to seq in textual form. | 643 | * lc_dump - Dump a complete LRU cache to seq in textual form. |
| 644 | * @lc: the lru cache to operate on | 644 | * @lc: the lru cache to operate on |
| 645 | * @seq: the &struct seq_file pointer to seq_printf into | 645 | * @seq: the &struct seq_file pointer to seq_printf into |
| 646 | * @utext: user supplied "heading" or other info | 646 | * @utext: user supplied additional "heading" or other info |
| 647 | * @detail: function pointer the user may provide to dump further details | 647 | * @detail: function pointer the user may provide to dump further details |
| 648 | * of the object the lc_element is embedded in. | 648 | * of the object the lc_element is embedded in. May be NULL. |
| 649 | * Note: a leading space ' ' and trailing newline '\n' is implied. | ||
| 649 | */ | 650 | */ |
| 650 | void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext, | 651 | void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext, |
| 651 | void (*detail) (struct seq_file *, struct lc_element *)) | 652 | void (*detail) (struct seq_file *, struct lc_element *)) |
| @@ -654,16 +655,18 @@ void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext | |||
| 654 | struct lc_element *e; | 655 | struct lc_element *e; |
| 655 | int i; | 656 | int i; |
| 656 | 657 | ||
| 657 | seq_printf(seq, "\tnn: lc_number refcnt %s\n ", utext); | 658 | seq_printf(seq, "\tnn: lc_number (new nr) refcnt %s\n ", utext); |
| 658 | for (i = 0; i < nr_elements; i++) { | 659 | for (i = 0; i < nr_elements; i++) { |
| 659 | e = lc_element_by_index(lc, i); | 660 | e = lc_element_by_index(lc, i); |
| 660 | if (e->lc_number == LC_FREE) { | 661 | if (e->lc_number != e->lc_new_number) |
| 661 | seq_printf(seq, "\t%2d: FREE\n", i); | 662 | seq_printf(seq, "\t%5d: %6d %8d %6d ", |
| 662 | } else { | 663 | i, e->lc_number, e->lc_new_number, e->refcnt); |
| 663 | seq_printf(seq, "\t%2d: %4u %4u ", i, | 664 | else |
| 664 | e->lc_number, e->refcnt); | 665 | seq_printf(seq, "\t%5d: %6d %-8s %6d ", |
| 666 | i, e->lc_number, "-\"-", e->refcnt); | ||
| 667 | if (detail) | ||
| 665 | detail(seq, e); | 668 | detail(seq, e); |
| 666 | } | 669 | seq_putc(seq, '\n'); |
| 667 | } | 670 | } |
| 668 | } | 671 | } |
| 669 | 672 | ||
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index e6940cf16628..a2c78810ebc1 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -38,16 +38,10 @@ int lockdep_rht_mutex_is_held(const struct rhashtable *ht) | |||
| 38 | EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held); | 38 | EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held); |
| 39 | #endif | 39 | #endif |
| 40 | 40 | ||
| 41 | /** | 41 | static void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he) |
| 42 | * rht_obj - cast hash head to outer object | ||
| 43 | * @ht: hash table | ||
| 44 | * @he: hashed node | ||
| 45 | */ | ||
| 46 | void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he) | ||
| 47 | { | 42 | { |
| 48 | return (void *) he - ht->p.head_offset; | 43 | return (void *) he - ht->p.head_offset; |
| 49 | } | 44 | } |
| 50 | EXPORT_SYMBOL_GPL(rht_obj); | ||
| 51 | 45 | ||
| 52 | static u32 __hashfn(const struct rhashtable *ht, const void *key, | 46 | static u32 __hashfn(const struct rhashtable *ht, const void *key, |
| 53 | u32 len, u32 hsize) | 47 | u32 len, u32 hsize) |
| @@ -386,7 +380,7 @@ EXPORT_SYMBOL_GPL(rhashtable_insert); | |||
| 386 | * deletion when combined with walking or lookup. | 380 | * deletion when combined with walking or lookup. |
| 387 | */ | 381 | */ |
| 388 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, | 382 | void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj, |
| 389 | struct rhash_head **pprev, gfp_t flags) | 383 | struct rhash_head __rcu **pprev, gfp_t flags) |
| 390 | { | 384 | { |
| 391 | struct bucket_table *tbl = rht_dereference(ht->tbl, ht); | 385 | struct bucket_table *tbl = rht_dereference(ht->tbl, ht); |
| 392 | 386 | ||
