Code Coverage: vinyl-cache/bin/vinylstat/vinylstat_bindings.h
 
82217aa4fc7094b3610340078afaf78cd95a8ec9
 
0
/*-
1
 * Copyright (c) 2019 Varnish Software AS
2
 * All rights reserved.
3
 *
4
 * Author: Dridi Boukelmoune <dridi.boukelmoune@gmail.com>
5
 *
6
 * SPDX-License-Identifier: BSD-2-Clause
7
 *
8
 * Redistribution and use in source and binary forms, with or without
9
 * modification, are permitted provided that the following conditions
10
 * are met:
11
 * 1. Redistributions of source code must retain the above copyright
12
 *    notice, this list of conditions and the following disclaimer.
13
 * 2. Redistributions in binary form must reproduce the above copyright
14
 *    notice, this list of conditions and the following disclaimer in the
15
 *    documentation and/or other materials provided with the distribution.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
21
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
 * SUCH DAMAGE.
28
 */
29
30
/*lint -save -e525 -e539 */
31
32
#ifndef BINDING_KEY
33
#  define BINDING_KEY(key, name, next)
34
#endif
35
36 6
#define BINDING_CTRL(c) ((c) & 0x1f)
37
38 7
BINDING_KEY('h',        "h",)
39 7
BINDING(HELP, "\tToggle the help screen.")
40
41 1
BINDING_KEY(KEY_UP,     "UP",   " or ")
42 4
BINDING_KEY('k',        "k",)
43 4
BINDING(UP, "\tNavigate the counter list one line up.")
44
45 1
BINDING_KEY(KEY_DOWN,   "DOWN", " or ")
46 1
BINDING_KEY('j',        "j",)
47 1
BINDING(DOWN, "\tNavigate the counter list one line down.")
48
49 3
BINDING_KEY(KEY_PPAGE,          "PAGEUP",       " or ")
50 4
BINDING_KEY('b',                "b",            " or ")
51 4
BINDING_KEY(BINDING_CTRL('b'),  "CTRL-B",)
52 4
BINDING(PAGEUP, "\tNavigate the counter list one page up.")
53
54 3
BINDING_KEY(KEY_NPAGE,          "PAGEDOWN",     " or ")
55 9
BINDING_KEY(' ',                "SPACE",        " or ")
56 9
BINDING_KEY(BINDING_CTRL('f'),  "CTRL-F",)
57 9
BINDING(PAGEDOWN, "\tNavigate the counter list one page down.")
58
59 2
BINDING_KEY(KEY_HOME,   "HOME", " or ")
60 2
BINDING_KEY('g',        "g",)
61 2
BINDING(TOP, "\tNavigate the counter list to the top.")
62
63 2
BINDING_KEY(KEY_END,    "END",  " or ")
64 4
BINDING_KEY('G',        "G",)
65 4
BINDING(BOTTOM, "\tNavigate the counter list to the bottom.")
66
67 3
BINDING_KEY('d', "d",)
68 3
BINDING(UNSEEN,
69 2
    "\tToggle between showing and hiding unseen counters. Unseen\n"
70 2
    "\tcounters are those that has been zero for the entire runtime\n"
71 2
    "\tof vinylstat. Defaults to hide unseen counters."
72 2
)
73
74 1
BINDING_KEY('r', "r",)
75 1
BINDING(RAW,
76 0
    "\tToggle between showing raw and adjusted gauges. When a gauge\n"
77 0
    "\tis decremented faster than it is incremented, it may appear as\n"
78 0
    "\ta large integer with its most significant bit set. By default\n"
79 0
    "\tsuch values are adjusted to zero."
80 0
)
81
82 2
BINDING_KEY('e', "e",)
83 2
BINDING(SCALE, "\tToggle scaling of values.")
84
85 3
BINDING_KEY('v', "v",)
86 3
BINDING(VERBOSE,
87 2
    "\tIncrease verbosity. Defaults to only showing informational\n"
88 2
    "\tcounters."
89 2
)
90
91 1
BINDING_KEY('V', "V",)
92 1
BINDING(QUIET,
93 0
    "\tDecrease verbosity. Defaults to only showing informational\n"
94 0
    "\tcounters."
95 0
)
96
97 3
BINDING_KEY('q', "q",)
98 3
BINDING(QUIT, "\tQuit.")
99
100 1
BINDING_KEY(BINDING_CTRL('t'), "CTRL+T",)
101 1
BINDING(SAMPLE, "\tSample now.")
102
103 2
BINDING_KEY('0', "0",)
104 2
BINDING(RESET_AVERAGES, "\tReset averages.")
105
106 2
BINDING_KEY('+', "+",)
107 2
BINDING(ACCEL, "\tIncrease refresh interval.")
108
109 2
BINDING_KEY('-', "-",)
110 2
BINDING(DECEL, "\tDecrease refresh interval.")
111
112
#ifdef BINDING_SIG
113 0
BINDING_KEY(BINDING_CTRL('c'), "CTRL+C",)
114 0
BINDING(SIG_INT, "")
115
116 0
BINDING_KEY(BINDING_CTRL('z'), "CTRL+Z",)
117 0
BINDING(SIG_TSTP, "")
118
#  undef BINDING_SIG
119
#endif
120
121 0
#undef BINDING_KEY
122 0
#undef BINDING_CTRL
123 0
#undef BINDING
124
125
/*lint -restore */
126