Projects
osmocom:master
libosmocore
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 336
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-master -Version: 1.9.0.189.35f20 +Version: 1.9.0.190.4301 Release: 0 Summary: The Open Source Mobile Communications Core Library License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later Group: Productivity/Telephony/Utilities Url: https://osmocom.org/projects/libosmocore/wiki/Libosmocore -Source: libosmocore_1.9.0.189.35f20.tar.xz +Source: libosmocore_1.9.0.190.4301.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2
View file
commit_35f20b1ff745334573bd1a9ed7c6337ed32133e0.txt
Deleted
View file
commit_43018ec1610a17db699451b403898a8fe33ec9e6.txt
Added
View file
libosmocore_1.9.0.189.35f20.dsc -> libosmocore_1.9.0.190.4301.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmocore 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 Architecture: any all -Version: 1.9.0.189.35f20 +Version: 1.9.0.190.4301 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmocore Standards-Version: 3.9.8 @@ -35,8 +35,8 @@ libosmovty-doc deb doc optional arch=all libosmovty13 deb libs optional arch=any Checksums-Sha1: - d26ca4e8b96bfe1ee297750cfe9e041100e43c09 1108428 libosmocore_1.9.0.189.35f20.tar.xz + 6c80f4a0e959dac9384e845036974ecc014543b7 1108776 libosmocore_1.9.0.190.4301.tar.xz Checksums-Sha256: - 39e181c6ff7ac3c8e45309d8343efd4bdefc86cde782ac0a9972b1e28d678a6c 1108428 libosmocore_1.9.0.189.35f20.tar.xz + e14d3e1bd6cca3a63393214d25cc94b366a12a4026d7de23d30e2b561af12e4f 1108776 libosmocore_1.9.0.190.4301.tar.xz Files: - 16878d77068fb92d5533dfd028d8319e 1108428 libosmocore_1.9.0.189.35f20.tar.xz + 251f6017c897046e517bcb2aaa9d018f 1108776 libosmocore_1.9.0.190.4301.tar.xz
View file
libosmocore_1.9.0.189.35f20.tar.xz/.tarball-version -> libosmocore_1.9.0.190.4301.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.9.0.189-35f20 +1.9.0.190-4301
View file
libosmocore_1.9.0.189.35f20.tar.xz/debian/changelog -> libosmocore_1.9.0.190.4301.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmocore (1.9.0.189.35f20) unstable; urgency=medium +libosmocore (1.9.0.190.4301) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Wed, 20 Mar 2024 12:35:32 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Fri, 22 Mar 2024 09:12:42 +0000 libosmocore (1.9.0) unstable; urgency=medium
View file
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
@@ -409,7 +409,8 @@ /* filter on the targets */ void log_set_all_filter(struct log_target *target, int); - +int log_cache_enable(void); +void log_cache_update(int mapped_subsys, uint8_t enabled, uint8_t level); void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int);
View file
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
@@ -58,6 +58,8 @@ log_add_target; log_category_name; log_check_level; +log_cache_enable; +log_cache_update; log_del_target; log_enable_multithread; log_fini;
View file
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
@@ -93,6 +93,80 @@ static __thread long int logging_tid; #if (!EMBEDDED) +/*! One global copy that contains the union of log levels for all targets +* for all categories, used for quick lock free checks of log targets. */ +static volatile uint8_t *log_level_lookup_cache; + +/*! Updates cache for all targets for all categies, caller must hold osmo_log_tgt_mutex. */ +static void log_cache_update_all(void) +{ + struct log_target *tgt; + uint8_t tmp_enosmo_log_info->num_cat; + uint8_t tmp_levelosmo_log_info->num_cat; + + if (!log_level_lookup_cache) + return; + + memset(tmp_en, 0, osmo_log_info->num_cat); + memset(tmp_level, UINT8_MAX, osmo_log_info->num_cat); + + /* values can also decrease.. */ + llist_for_each_entry(tgt, &osmo_log_target_list, entry) { + for (int i = 0; i < osmo_log_info->num_cat; i++) { + struct log_category *cat = &tgt->categoriesi; + tmp_eni = OSMO_MAX(tmp_eni, cat->enabled); + tmp_leveli = OSMO_MIN(tmp_leveli, cat->loglevel); + tmp_leveli = tgt->loglevel ? OSMO_MIN(tmp_leveli, tgt->loglevel) : tmp_leveli; + } + } + + for (int i = 0; i < osmo_log_info->num_cat; i++) + log_level_lookup_cachei = tmp_eni ? tmp_leveli : UINT8_MAX; +} + +/*! Updates single cache entry, caller must hold osmo_log_tgt_mutex. + * + * \paramin mapped_subsys plain category index (after mapping) + * \paramin enabled log category enabled? + * \paramin level log level + */ +void log_cache_update(int mapped_subsys, uint8_t enabled, uint8_t level) +{ + struct log_target *tgt; + struct log_category tmp = { UINT8_MAX, 0 }; + + if (!log_level_lookup_cache) + return; + + /* values can also decrease.. */ + llist_for_each_entry(tgt, &osmo_log_target_list, entry) { + struct log_category *cat = &tgt->categoriesmapped_subsys; + tmp.enabled = OSMO_MAX(tmp.enabled, cat->enabled); + tmp.loglevel = OSMO_MIN(tmp.loglevel, cat->loglevel); + tmp.loglevel = tgt->loglevel ? OSMO_MIN(tmp.loglevel, tgt->loglevel) : tmp.loglevel; + } + tmp.enabled = OSMO_MAX(tmp.enabled, enabled); + tmp.loglevel = OSMO_MIN(tmp.loglevel, level); + + log_level_lookup_cachemapped_subsys = tmp.enabled ? tmp.loglevel : UINT8_MAX; +} + +/*! Queries log level cache. + * + * \paramin mapped_subsys plain category index (after mapping) + * \paramin level log level + * \returns true if logging should happen for at least one log target +*/ +static bool log_cache_check(int mapped_subsys, int level) +{ + if (!log_level_lookup_cache) { + /* log-cache is not enabled, so we simply behave like we did before the cache */ + return true; + } + + return (level < log_level_lookup_cachemapped_subsys) ? false : true; +} + /*! This mutex must be held while using osmo_log_target_list or any of its log_targets in a multithread program. Prevents race conditions between threads like producing unordered timestamps or VTY deleting a target while another @@ -426,6 +500,10 @@ } } while ((category_token = strtok(NULL, ":"))); +#if !defined(EMBEDDED) + log_cache_update_all(); +#endif + free(mask); } @@ -680,6 +758,11 @@ subsys = map_subsys(subsys); +#if !defined(EMBEDDED) + if (!log_cache_check(subsys, level)) + return; +#endif + log_tgt_mutex_lock(); llist_for_each_entry(tar, &osmo_log_target_list, entry) { @@ -754,6 +837,9 @@ void log_add_target(struct log_target *target) { llist_add_tail(&target->entry, &osmo_log_target_list); +#if (!EMBEDDED) + log_cache_update_all(); +#endif } /*! Unregister a log target from the logging core @@ -762,6 +848,9 @@ void log_del_target(struct log_target *target) { llist_del(&target->entry); +#if (!EMBEDDED) + log_cache_update_all(); +#endif } /*! Reset (clear) the logging context */ @@ -922,6 +1011,9 @@ void log_set_log_level(struct log_target *target, int log_level) { target->loglevel = log_level; +#if !defined(EMBEDDED) + log_cache_update_all(); +#endif } /*! Set a category filter on a given log target @@ -938,6 +1030,10 @@ category = map_subsys(category); target->categoriescategory.enabled = !!enable; target->categoriescategory.loglevel = level; + +#if !defined(EMBEDDED) + log_cache_update(category, !!enable, level); +#endif } #if (!EMBEDDED) @@ -1046,6 +1142,15 @@ /* global log level */ target->loglevel = 0; + +#if !defined(EMBEDDED) + /* update cache */ + for (i = 0; i < osmo_log_info->num_cat; i++) { + const struct log_info_cat *c = &osmo_log_info->cati; + log_cache_update(i, c->enabled, c->loglevel); + } +#endif + return target; } @@ -1393,6 +1498,31 @@ return rc; } +/*! Enable the log level lookup cache to bypass string formatting and other code for log statements which are + * not actually enabled/needed by any existing log target. + * \retruns 0 in case of success, negative -errno in case of error. */ +int log_cache_enable(void) +{ +#if !defined(EMBEDDED) + if (log_level_lookup_cache) + return -EEXIST; + + log_level_lookup_cache = talloc_zero_array(osmo_log_info, uint8_t, osmo_log_info->num_cat); + if (!log_level_lookup_cache) + return -ENOMEM; + + /* copy everything for level lookup cache */ + log_tgt_mutex_lock(); + log_cache_update_all(); + log_tgt_mutex_unlock(); + + return 0; +#else + return -ENOTSUP; +#endif +} + + /*! Initialize the Osmocom logging core * \paramin inf Information regarding logging categories, could be NULL * \paramin ctx talloc context for logging allocations @@ -1486,6 +1616,11 @@ subsys = map_subsys(subsys); +#if !defined(EMBEDDED) + if (!log_cache_check(subsys, level)) + return 0; +#endif + /* TODO: The following could/should be cached (update on config) */ log_tgt_mutex_lock();
View file
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
@@ -382,6 +382,10 @@ tgt->categoriescategory.enabled = 1; tgt->categoriescategory.loglevel = level; +#if !defined(EMBEDDED) + log_cache_update(category, 1, level); +#endif + RET_WITH_UNLOCK(CMD_SUCCESS); } @@ -406,6 +410,9 @@ cat->enabled = 1; cat->loglevel = level; +#if !defined(EMBEDDED) + log_cache_update(i, 1, level); +#endif } RET_WITH_UNLOCK(CMD_SUCCESS); }
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.