Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
78aff3e9
Commit
78aff3e9
authored
Dec 08, 2020
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsc: Control adjusted values with a 'r'aw argument
parent
69dfe498
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
vsc.h
include/vapi/vsc.h
+3
-1
vsc.c
lib/libvarnishapi/vsc.c
+3
-0
No files found.
include/vapi/vsc.h
View file @
78aff3e9
...
...
@@ -69,6 +69,7 @@ struct VSC_point {
const
char
*
sdesc
;
/* short description */
const
char
*
ldesc
;
/* long description */
void
*
priv
;
/* return val from VSC_new_f */
unsigned
raw
;
/* adjusted or raw value */
};
/*---------------------------------------------------------------------
...
...
@@ -118,6 +119,7 @@ int VSC_Arg(struct vsc *, char arg, const char *opt);
* 'X' - field exclusion glob
* 'R' - required field glob
* 'f' - legacy field filter glob (deprecated)
* 'r' - toggle raw gauges
*
* Return:
* -1 error, VSM_Error() returns diagnostic string
...
...
@@ -165,7 +167,7 @@ VSC_Value(const struct VSC_point * const pt)
uint64_t
val
;
val
=
*
pt
->
ptr
;
if
(
pt
->
semantics
==
'g'
&&
val
>
INT64_MAX
)
if
(
!
pt
->
raw
&&
pt
->
semantics
==
'g'
&&
val
>
INT64_MAX
)
val
=
0
;
return
(
val
);
}
...
...
lib/libvarnishapi/vsc.c
View file @
78aff3e9
...
...
@@ -98,6 +98,7 @@ struct vsc {
unsigned
magic
;
#define VSC_MAGIC 0x3373554a
unsigned
raw
;
struct
vsc_sf_head
sf_list
;
VTAILQ_HEAD
(,
vsc_seg
)
segs
;
...
...
@@ -185,6 +186,7 @@ VSC_Arg(struct vsc *vsc, char arg, const char *opt)
case
'X'
:
return
(
vsc_sf_arg
(
vsc
,
opt
,
VSC_SF_EXCLUDE
));
case
'R'
:
return
(
vsc_sf_arg
(
vsc
,
opt
,
VSC_SF_REQUIRE
));
case
'f'
:
return
(
vsc_f_arg
(
vsc
,
opt
));
case
'r'
:
vsc
->
raw
=
!
vsc
->
raw
;
return
(
1
);
default:
return
(
0
);
}
}
...
...
@@ -299,6 +301,7 @@ vsc_fill_point(const struct vsc *vsc, const struct vsc_seg *seg,
AN
(
vt
);
point
->
point
.
ptr
=
(
volatile
void
*
)(
seg
->
body
+
atoi
(
vt
->
value
));
point
->
point
.
raw
=
vsc
->
raw
;
}
static
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment