OpenVPN
perf.h
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single TCP/UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2002-2025 OpenVPN Inc <sales@openvpn.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2
12 * as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, see <https://www.gnu.org/licenses/>.
21 */
22
23/*
24 * The interval_ routines are designed to optimize the calling of a routine
25 * (normally tls_multi_process()) which can be called less frequently
26 * between triggers.
27 */
28
29#ifndef PERF_H
30#define PERF_H
31
32/*#define ENABLE_PERFORMANCE_METRICS*/
33
34/*
35 * Metrics
36 */
37#define PERF_BIO_READ_PLAINTEXT 0
38#define PERF_BIO_WRITE_PLAINTEXT 1
39#define PERF_BIO_READ_CIPHERTEXT 2
40#define PERF_BIO_WRITE_CIPHERTEXT 3
41#define PERF_TLS_MULTI_PROCESS 4
42#define PERF_IO_WAIT 5
43#define PERF_EVENT_LOOP 6
44#define PERF_MULTI_CREATE_INSTANCE 7
45#define PERF_MULTI_CLOSE_INSTANCE 8
46#define PERF_MULTI_SHOW_STATS 9
47#define PERF_MULTI_BCAST 10
48#define PERF_MULTI_MCAST 11
49#define PERF_SCRIPT 12
50#define PERF_READ_IN_LINK 13
51#define PERF_PROC_IN_LINK 14
52#define PERF_READ_IN_TUN 15
53#define PERF_PROC_IN_TUN 16
54#define PERF_PROC_OUT_LINK 17
55#define PERF_PROC_OUT_TUN 18
56#define PERF_PROC_OUT_TUN_MTCP 19
57#define PERF_N 20
58
59#ifdef ENABLE_PERFORMANCE_METRICS
60
61#include "basic.h"
62
63/*
64 * Stack size
65 */
66#define STACK_N 64
67
68void perf_push(int type);
69
70void perf_pop(void);
71
72void perf_output_results(void);
73
74#else /* ifdef ENABLE_PERFORMANCE_METRICS */
75
76static inline void
77perf_push(int type)
78{
79}
80static inline void
82{
83}
84static inline void
86{
87}
88
89#endif /* ifdef ENABLE_PERFORMANCE_METRICS */
90
91#endif /* ifndef PERF_H */
static void perf_push(int type)
Definition perf.h:77
static void perf_output_results(void)
Definition perf.h:85
static void perf_pop(void)
Definition perf.h:81