Lines Matching full:link
77 /** @brief Return link and relative domain id based on absolute domain id.
80 * @param[out] rel_domain_id Domain ID elative to the link domain ID as output.
82 * @return Link to which given domain belongs. NULL if link was not found.
88 STRUCT_SECTION_FOREACH(log_link, link) { in get_link_domain()
89 domain_max = link->ctrl_blk->domain_offset + in get_link_domain()
90 link->ctrl_blk->domain_cnt; in get_link_domain()
93 *rel_domain_id = domain_id - link->ctrl_blk->domain_offset; in get_link_domain()
94 return link; in get_link_domain()
105 * Runtime filters for each link are dynamically allocated as an array of
106 * filters for all domains in the link. In order to fetch link associated with
109 static uint32_t get_source_offset(const struct log_link *link, in get_source_offset() argument
115 offset += log_link_sources_count(link, i); in get_source_offset()
124 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in z_log_link_get_dynamic_filter() local
127 __ASSERT_NO_MSG(link != NULL); in z_log_link_get_dynamic_filter()
129 source_offset = get_source_offset(link, rel_domain_id); in z_log_link_get_dynamic_filter()
131 return &link->ctrl_blk->filters[source_offset + source_id]; in z_log_link_get_dynamic_filter()
135 static int link_filters_init(const struct log_link *link) in link_filters_init() argument
137 uint32_t total_cnt = get_source_offset(link, link->ctrl_blk->domain_cnt); in link_filters_init()
139 link->ctrl_blk->filters = k_malloc(sizeof(uint32_t) * total_cnt); in link_filters_init()
140 if (link->ctrl_blk->filters == NULL) { in link_filters_init()
146 memset(link->ctrl_blk->filters, 0, sizeof(uint32_t) * total_cnt); in link_filters_init()
148 link->name, (int)(total_cnt * sizeof(uint32_t))); in link_filters_init()
181 STRUCT_SECTION_FOREACH(log_link, link) { in z_log_ext_domain_count()
182 cnt += log_link_domains_count(link); in z_log_ext_domain_count()
191 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in link_source_count() local
193 __ASSERT_NO_MSG(link != NULL); in link_source_count()
195 return log_link_sources_count(link, rel_domain_id); in link_source_count()
223 /* If not in cache fetch from link and cache it. */ in link_source_name_get()
226 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in link_source_name_get() local
229 __ASSERT_NO_MSG(link != NULL); in link_source_name_get()
231 err = log_link_get_source_name(link, rel_domain_id, source_id, in link_source_name_get()
271 /* If not in cache fetch from link and cache it. */ in link_domain_name_get()
274 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in link_domain_name_get() local
277 __ASSERT_NO_MSG(link != NULL); in link_domain_name_get()
279 err = log_link_get_domain_name(link, rel_domain_id, cached, &cache_size); in link_domain_name_get()
303 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in link_compiled_level_get() local
306 __ASSERT_NO_MSG(link != NULL); in link_compiled_level_get()
308 return !log_link_get_levels(link, rel_domain_id, source_id, &level, NULL) ? in link_compiled_level_get()
328 const struct log_link *link = get_link_domain(domain_id, &rel_domain_id); in z_log_link_set_runtime_level() local
330 __ASSERT_NO_MSG(link != NULL); in z_log_link_set_runtime_level()
332 return log_link_set_runtime_level(link, rel_domain_id, source_id, level); in z_log_link_set_runtime_level()
511 static void link_filter_set(const struct log_link *link, in link_filter_set() argument
515 if (log_link_is_active(link) != 0) { in link_filter_set()
519 for (uint8_t d = link->ctrl_blk->domain_offset; in link_filter_set()
520 d < link->ctrl_blk->domain_offset + link->ctrl_blk->domain_cnt; d++) { in link_filter_set()
543 STRUCT_SECTION_FOREACH(log_link, link) { in backend_filter_set()
544 link_filter_set(link, backend, level); in backend_filter_set()
608 STRUCT_SECTION_FOREACH(log_link, link) { in z_log_links_initiate()
610 if (link->mpsc_pbuf) { in z_log_links_initiate()
611 mpsc_pbuf_init(link->mpsc_pbuf, link->mpsc_pbuf_config); in z_log_links_initiate()
615 err = log_link_initiate(link, NULL); in z_log_links_initiate()
616 __ASSERT(err == 0, "Failed to initialize link"); in z_log_links_initiate()
621 static void backends_link_init(const struct log_link *link) in backends_link_init() argument
631 link_filter_set(link, backend, backend->cb->level); in backends_link_init()
645 STRUCT_SECTION_FOREACH(log_link, link) { in z_log_links_activate()
647 int err = log_link_activate(link); in z_log_links_activate()
650 uint8_t domain_cnt = log_link_domains_count(link); in z_log_links_activate()
652 link->ctrl_blk->domain_offset = *offset; in z_log_links_activate()
653 link->ctrl_blk->domain_cnt = domain_cnt; in z_log_links_activate()
656 link_filters_init(link); in z_log_links_activate()
657 backends_link_init(link); in z_log_links_activate()