1 // vim: ts=4 sw=4 noet :
3 ==================================================================================
4 Copyright 2021 Samsung Electronics All Rights Reserved.
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 ==================================================================================
21 Mnemonic: rmr_debug_si.c
22 Abstract: This is the compile point for the debug apis for si
23 version of the rmr library
25 API functions in this file will provide debug information
28 Future: the API functions can be added with necessity met
31 Author: Chung, Seung Wook
37 rmr_get_rx_debug_count function will reset debug information of rmr rx queue
38 both drop count and enqueue count of type uint64_t to zero.
40 The vctx pointer is the pointer returned by the rmr_init function.
42 On success function will return 0 otherwise it is an error.
43 On error, errno will have failure reason, EINVAL.
45 extern int rmr_reset_rx_debug_count(void *vctx) {
47 if ((ctx = (uta_ctx_t *)vctx) == NULL) {
57 rmr_get_rx_debug_info function fills debug information of rmr rx status using
58 rmr_rx_debug_t structure type. Debug information for RX status in rmr provides number
59 of messages successfully queued to rmr and number of messages dropped for debug usage.
61 The vctx pointer is the pointer returned by the rmr_init function. rx_debug is a pointer
62 to a structure to receive rmr rx status information.
64 On success function will return 0 otherwise it is an error.
65 On error, errno will have failure reason, EINVAL.
68 acc_dcount and acc_ecount will count in uint64_t range and will wrap-around when
69 counted more. Two variables are counter thus will only increase.
71 extern int rmr_get_rx_debug_info(void *vctx, rmr_rx_debug_t *rx_debug) {
73 if ((ctx = (uta_ctx_t *)vctx) == NULL || rx_debug == NULL ) {
77 rx_debug->drop = ctx->acc_dcount;
78 rx_debug->enqueue = ctx->acc_ecount;