Error getting diff: tar:

Changes of Revision 336

libosmocore.spec Changed
x
 
1
@@ -14,13 +14,13 @@
2
 
3
 Name:           libosmocore
4
 Requires: osmocom-master
5
-Version: 1.9.0.189.35f20
6
+Version: 1.9.0.190.4301
7
 Release:        0
8
 Summary:        The Open Source Mobile Communications Core Library
9
 License:        GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later
10
 Group:          Productivity/Telephony/Utilities
11
 Url:            https://osmocom.org/projects/libosmocore/wiki/Libosmocore
12
-Source: libosmocore_1.9.0.189.35f20.tar.xz
13
+Source: libosmocore_1.9.0.190.4301.tar.xz
14
 Source1: rpmlintrc
15
 BuildRequires:  automake >= 1.6
16
 BuildRequires:  libtool >= 2
17
commit_35f20b1ff745334573bd1a9ed7c6337ed32133e0.txt Deleted
commit_43018ec1610a17db699451b403898a8fe33ec9e6.txt Added
libosmocore_1.9.0.189.35f20.dsc -> libosmocore_1.9.0.190.4301.dsc Changed
22
 
1
@@ -2,7 +2,7 @@
2
 Source: libosmocore
3
 Binary: libosmocore, libosmocodec4, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore21, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm20, libosmogsm-doc, libosmoisdn0, libosmoisdn-doc, libosmovty13, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmosim-doc, libosmousb0, libosmousb-doc, libosmocore-dev, libosmocore-utils, libosmocore-dbg
4
 Architecture: any all
5
-Version: 1.9.0.189.35f20
6
+Version: 1.9.0.190.4301
7
 Maintainer: Osmocom team <openbsc@lists.osmocom.org>
8
 Homepage: https://projects.osmocom.org/projects/libosmocore
9
 Standards-Version: 3.9.8
10
@@ -35,8 +35,8 @@
11
  libosmovty-doc deb doc optional arch=all
12
  libosmovty13 deb libs optional arch=any
13
 Checksums-Sha1:
14
- d26ca4e8b96bfe1ee297750cfe9e041100e43c09 1108428 libosmocore_1.9.0.189.35f20.tar.xz
15
+ 6c80f4a0e959dac9384e845036974ecc014543b7 1108776 libosmocore_1.9.0.190.4301.tar.xz
16
 Checksums-Sha256:
17
- 39e181c6ff7ac3c8e45309d8343efd4bdefc86cde782ac0a9972b1e28d678a6c 1108428 libosmocore_1.9.0.189.35f20.tar.xz
18
+ e14d3e1bd6cca3a63393214d25cc94b366a12a4026d7de23d30e2b561af12e4f 1108776 libosmocore_1.9.0.190.4301.tar.xz
19
 Files:
20
- 16878d77068fb92d5533dfd028d8319e 1108428 libosmocore_1.9.0.189.35f20.tar.xz
21
+ 251f6017c897046e517bcb2aaa9d018f 1108776 libosmocore_1.9.0.190.4301.tar.xz
22
libosmocore_1.9.0.189.35f20.tar.xz/.tarball-version -> libosmocore_1.9.0.190.4301.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-1.9.0.189-35f20
3
+1.9.0.190-4301
4
libosmocore_1.9.0.189.35f20.tar.xz/debian/changelog -> libosmocore_1.9.0.190.4301.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-libosmocore (1.9.0.189.35f20) unstable; urgency=medium
3
+libosmocore (1.9.0.190.4301) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom master feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Wed, 20 Mar 2024 12:35:32 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Fri, 22 Mar 2024 09:12:42 +0000
9
 
10
 libosmocore (1.9.0) unstable; urgency=medium
11
 
12
libosmocore_1.9.0.189.35f20.tar.xz/include/osmocom/core/logging.h -> libosmocore_1.9.0.190.4301.tar.xz/include/osmocom/core/logging.h Changed
11
 
1
@@ -409,7 +409,8 @@
2
 
3
 /* filter on the targets */
4
 void log_set_all_filter(struct log_target *target, int);
5
-
6
+int log_cache_enable(void);
7
+void log_cache_update(int mapped_subsys, uint8_t enabled, uint8_t level);
8
 void log_set_use_color(struct log_target *target, int);
9
 void log_set_print_extended_timestamp(struct log_target *target, int);
10
 void log_set_print_timestamp(struct log_target *target, int);
11
libosmocore_1.9.0.189.35f20.tar.xz/src/core/libosmocore.map -> libosmocore_1.9.0.190.4301.tar.xz/src/core/libosmocore.map Changed
10
 
1
@@ -58,6 +58,8 @@
2
 log_add_target;
3
 log_category_name;
4
 log_check_level;
5
+log_cache_enable;
6
+log_cache_update;
7
 log_del_target;
8
 log_enable_multithread;
9
 log_fini;
10
libosmocore_1.9.0.189.35f20.tar.xz/src/core/logging.c -> libosmocore_1.9.0.190.4301.tar.xz/src/core/logging.c Changed
201
 
1
@@ -93,6 +93,80 @@
2
 static __thread long int logging_tid;
3
 
4
 #if (!EMBEDDED)
5
+/*! One global copy that contains the union of log levels for all targets
6
+*  for all categories, used for quick lock free checks of log targets. */
7
+static volatile uint8_t *log_level_lookup_cache;
8
+
9
+/*! Updates cache for all targets for all categies, caller must hold osmo_log_tgt_mutex. */
10
+static void log_cache_update_all(void)
11
+{
12
+   struct log_target *tgt;
13
+   uint8_t tmp_enosmo_log_info->num_cat;
14
+   uint8_t tmp_levelosmo_log_info->num_cat;
15
+
16
+   if (!log_level_lookup_cache)
17
+       return;
18
+
19
+   memset(tmp_en, 0, osmo_log_info->num_cat);
20
+   memset(tmp_level, UINT8_MAX, osmo_log_info->num_cat);
21
+
22
+   /* values can also decrease.. */
23
+   llist_for_each_entry(tgt, &osmo_log_target_list, entry) {
24
+       for (int i = 0; i < osmo_log_info->num_cat; i++) {
25
+           struct log_category *cat = &tgt->categoriesi;
26
+           tmp_eni = OSMO_MAX(tmp_eni, cat->enabled);
27
+           tmp_leveli = OSMO_MIN(tmp_leveli, cat->loglevel);
28
+           tmp_leveli = tgt->loglevel ? OSMO_MIN(tmp_leveli, tgt->loglevel) : tmp_leveli;
29
+       }
30
+   }
31
+
32
+   for (int i = 0; i < osmo_log_info->num_cat; i++)
33
+       log_level_lookup_cachei = tmp_eni ? tmp_leveli : UINT8_MAX;
34
+}
35
+
36
+/*! Updates single cache entry, caller must hold osmo_log_tgt_mutex.
37
+ *
38
+ *  \paramin mapped_subsys plain category index (after mapping)
39
+ *  \paramin enabled log category enabled?
40
+ *  \paramin level log level
41
+ */
42
+void log_cache_update(int mapped_subsys, uint8_t enabled, uint8_t level)
43
+{
44
+   struct log_target *tgt;
45
+   struct log_category tmp = { UINT8_MAX, 0 };
46
+
47
+   if (!log_level_lookup_cache)
48
+       return;
49
+
50
+   /* values can also decrease.. */
51
+   llist_for_each_entry(tgt, &osmo_log_target_list, entry) {
52
+       struct log_category *cat = &tgt->categoriesmapped_subsys;
53
+       tmp.enabled = OSMO_MAX(tmp.enabled, cat->enabled);
54
+       tmp.loglevel = OSMO_MIN(tmp.loglevel, cat->loglevel);
55
+       tmp.loglevel = tgt->loglevel ? OSMO_MIN(tmp.loglevel, tgt->loglevel) : tmp.loglevel;
56
+   }
57
+   tmp.enabled = OSMO_MAX(tmp.enabled, enabled);
58
+   tmp.loglevel = OSMO_MIN(tmp.loglevel, level);
59
+
60
+   log_level_lookup_cachemapped_subsys = tmp.enabled ? tmp.loglevel : UINT8_MAX;
61
+}
62
+
63
+/*! Queries log level cache.
64
+ *
65
+ *  \paramin mapped_subsys plain category index (after mapping)
66
+ *  \paramin level log level
67
+ *  \returns true if logging should happen for at least one log target
68
+*/
69
+static bool log_cache_check(int mapped_subsys, int level)
70
+{
71
+   if (!log_level_lookup_cache) {
72
+       /* log-cache is not enabled, so we simply behave like we did before the cache */
73
+       return true;
74
+   }
75
+
76
+   return (level < log_level_lookup_cachemapped_subsys) ? false : true;
77
+}
78
+
79
 /*! This mutex must be held while using osmo_log_target_list or any of its
80
   log_targets in a multithread program. Prevents race conditions between threads
81
   like producing unordered timestamps or VTY deleting a target while another
82
@@ -426,6 +500,10 @@
83
        }
84
    } while ((category_token = strtok(NULL, ":")));
85
 
86
+#if !defined(EMBEDDED)
87
+   log_cache_update_all();
88
+#endif
89
+
90
    free(mask);
91
 }
92
 
93
@@ -680,6 +758,11 @@
94
 
95
    subsys = map_subsys(subsys);
96
 
97
+#if !defined(EMBEDDED)
98
+   if (!log_cache_check(subsys, level))
99
+       return;
100
+#endif
101
+
102
    log_tgt_mutex_lock();
103
 
104
    llist_for_each_entry(tar, &osmo_log_target_list, entry) {
105
@@ -754,6 +837,9 @@
106
 void log_add_target(struct log_target *target)
107
 {
108
    llist_add_tail(&target->entry, &osmo_log_target_list);
109
+#if (!EMBEDDED)
110
+   log_cache_update_all();
111
+#endif
112
 }
113
 
114
 /*! Unregister a log target from the logging core
115
@@ -762,6 +848,9 @@
116
 void log_del_target(struct log_target *target)
117
 {
118
    llist_del(&target->entry);
119
+#if (!EMBEDDED)
120
+   log_cache_update_all();
121
+#endif
122
 }
123
 
124
 /*! Reset (clear) the logging context */
125
@@ -922,6 +1011,9 @@
126
 void log_set_log_level(struct log_target *target, int log_level)
127
 {
128
    target->loglevel = log_level;
129
+#if !defined(EMBEDDED)
130
+   log_cache_update_all();
131
+#endif
132
 }
133
 
134
 /*! Set a category filter on a given log target
135
@@ -938,6 +1030,10 @@
136
    category = map_subsys(category);
137
    target->categoriescategory.enabled = !!enable;
138
    target->categoriescategory.loglevel = level;
139
+
140
+#if !defined(EMBEDDED)
141
+   log_cache_update(category, !!enable, level);
142
+#endif
143
 }
144
 
145
 #if (!EMBEDDED)
146
@@ -1046,6 +1142,15 @@
147
 
148
    /* global log level */
149
    target->loglevel = 0;
150
+
151
+#if !defined(EMBEDDED)
152
+   /* update cache */
153
+   for (i = 0; i < osmo_log_info->num_cat; i++) {
154
+       const struct log_info_cat *c = &osmo_log_info->cati;
155
+       log_cache_update(i, c->enabled, c->loglevel);
156
+   }
157
+#endif
158
+
159
    return target;
160
 }
161
 
162
@@ -1393,6 +1498,31 @@
163
    return rc;
164
 }
165
 
166
+/*! Enable the log level lookup cache to bypass string formatting and other code for log statements which are
167
+ *  not actually enabled/needed by any existing log target.
168
+ *  \retruns 0 in case of success, negative -errno in case of error. */
169
+int log_cache_enable(void)
170
+{
171
+#if !defined(EMBEDDED)
172
+   if (log_level_lookup_cache)
173
+       return -EEXIST;
174
+
175
+   log_level_lookup_cache = talloc_zero_array(osmo_log_info, uint8_t, osmo_log_info->num_cat);
176
+   if (!log_level_lookup_cache)
177
+       return -ENOMEM;
178
+
179
+   /* copy everything for level lookup cache */
180
+   log_tgt_mutex_lock();
181
+   log_cache_update_all();
182
+   log_tgt_mutex_unlock();
183
+
184
+   return 0;
185
+#else
186
+   return -ENOTSUP;
187
+#endif
188
+}
189
+
190
+
191
 /*! Initialize the Osmocom logging core
192
  *  \paramin inf Information regarding logging categories, could be NULL
193
  *  \paramin ctx talloc context for logging allocations
194
@@ -1486,6 +1616,11 @@
195
 
196
    subsys = map_subsys(subsys);
197
 
198
+#if !defined(EMBEDDED)
199
+   if (!log_cache_check(subsys, level))
200
+       return 0;
201
libosmocore_1.9.0.189.35f20.tar.xz/src/vty/logging_vty.c -> libosmocore_1.9.0.190.4301.tar.xz/src/vty/logging_vty.c Changed
22
 
1
@@ -382,6 +382,10 @@
2
    tgt->categoriescategory.enabled = 1;
3
    tgt->categoriescategory.loglevel = level;
4
 
5
+#if !defined(EMBEDDED)
6
+   log_cache_update(category, 1, level);
7
+#endif
8
+
9
    RET_WITH_UNLOCK(CMD_SUCCESS);
10
 }
11
 
12
@@ -406,6 +410,9 @@
13
 
14
        cat->enabled = 1;
15
        cat->loglevel = level;
16
+#if !defined(EMBEDDED)
17
+       log_cache_update(i, 1, level);
18
+#endif
19
    }
20
    RET_WITH_UNLOCK(CMD_SUCCESS);
21
 }
22