2 * Copyright (c) 2016 Intel Corporation.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
23 #define FUNC_SEQ_VERIFY(v) do { \
24 static uint64_t nb_call; \
27 RTE_VERIFY(tcp_seq_leq(x, v)); \
31 #define FUNC_VERIFY(e, c) do { \
32 static uint64_t nb_call; \
37 RTE_VERIFY(nb_call != (c)); \
40 #define FUNC_STAT(v, c) do { \
41 static uint64_t nb_call, nb_data; \
44 if ((nb_call & ((c) - 1)) == 0) { \
45 printf("%s#%d@%u: nb_call=%lu, avg(" #v ")=%#Lf\n", \
46 __func__, __LINE__, rte_lcore_id(), nb_call, \
47 (long double)nb_data / nb_call); \
53 #define FUNC_TM_STAT(v, c) do { \
54 static uint64_t nb_call, nb_data; \
55 static uint64_t cts, pts, sts; \
62 if ((nb_call & ((c) - 1)) == 0) { \
63 printf("%s#%d@%u: nb_call=%lu, " \
64 "avg(" #v ")=%#Lf, " \
65 "avg(cycles)=%#Lf, " \
66 "avg(cycles/" #v ")=%#Lf\n", \
67 __func__, __LINE__, rte_lcore_id(), nb_call, \
68 (long double)nb_data / nb_call, \
69 (long double)sts / nb_call, \
70 (long double)sts / nb_data); \
81 #endif /* _DEBUG_H_ */