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
4507c595
Commit
4507c595
authored
Oct 09, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also split out the VSC part of the (v)abi
parent
2dbbcb44
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
52 deletions
+87
-52
Makefile.am
include/Makefile.am
+1
-0
vsc.h
include/vapi/vsc.h
+85
-0
varnishapi.h
include/varnishapi.h
+1
-52
No files found.
include/Makefile.am
View file @
4507c595
...
@@ -16,6 +16,7 @@ pkginclude_HEADERS = \
...
@@ -16,6 +16,7 @@ pkginclude_HEADERS = \
tbl/vsc_fields.h
\
tbl/vsc_fields.h
\
tbl/vsl_tags.h
\
tbl/vsl_tags.h
\
vapi/vsm.h
\
vapi/vsm.h
\
vapi/vsc.h
\
varnishapi.h
\
varnishapi.h
\
vcli.h
\
vcli.h
\
vsc.h
\
vsc.h
\
...
...
include/vapi/vsc.h
0 → 100644
View file @
4507c595
/*-
* Copyright (c) 2006 Verdens Gang AS
* Copyright (c) 2006-2011 Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@phk.freebsd.dk>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#ifndef VAPI_VSC_H_INCLUDED
#define VAPI_VSC_H_INCLUDED
/*---------------------------------------------------------------------
* VSC level access functions
*/
void
VSC_Setup
(
struct
VSM_data
*
vd
);
/*
* Setup vd for use with VSC functions.
*/
#define VSC_ARGS "f:n:"
#define VSC_n_USAGE VSM_n_USAGE
#define VSC_USAGE VSC_N_USAGE
int
VSC_Arg
(
struct
VSM_data
*
vd
,
int
arg
,
const
char
*
opt
);
/*
* Handle standard stat-presenter arguments
* Return:
* -1 error
* 0 not handled
* 1 Handled.
*/
int
VSC_Open
(
struct
VSM_data
*
vd
,
int
diag
);
/*
* Open shared memory for VSC processing.
* args and returns as VSM_Open()
*/
struct
VSC_C_main
*
VSC_Main
(
struct
VSM_data
*
vd
);
/*
* return Main stats structure
*/
struct
VSC_point
{
const
char
*
class
;
/* stat struct type */
const
char
*
ident
;
/* stat struct ident */
const
char
*
name
;
/* field name */
const
char
*
fmt
;
/* field format ("uint64_t") */
int
flag
;
/* 'a' = counter, 'i' = gauge */
const
char
*
desc
;
/* description */
const
volatile
void
*
ptr
;
/* field value */
};
typedef
int
VSC_iter_f
(
void
*
priv
,
const
struct
VSC_point
*
const
pt
);
int
VSC_Iter
(
struct
VSM_data
*
vd
,
VSC_iter_f
*
func
,
void
*
priv
);
/*
* Iterate over all statistics counters, calling "func" for
* each counter not suppressed by any "-f" arguments.
*/
#endif
/* VAPI_VSC_H_INCLUDED */
include/varnishapi.h
View file @
4507c595
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#define VARNISHAPI_H_INCLUDED
#define VARNISHAPI_H_INCLUDED
#include <vapi/vsm.h>
#include <vapi/vsm.h>
#include <vapi/vsc.h>
#include <stdint.h>
#include <stdint.h>
...
@@ -43,58 +44,6 @@
...
@@ -43,58 +44,6 @@
* API use failures will trip assert.
* API use failures will trip assert.
*/
*/
/*---------------------------------------------------------------------
* VSC level access functions
*/
void
VSC_Setup
(
struct
VSM_data
*
vd
);
/*
* Setup vd for use with VSC functions.
*/
#define VSC_ARGS "f:n:"
#define VSC_n_USAGE VSM_n_USAGE
#define VSC_USAGE VSC_N_USAGE
int
VSC_Arg
(
struct
VSM_data
*
vd
,
int
arg
,
const
char
*
opt
);
/*
* Handle standard stat-presenter arguments
* Return:
* -1 error
* 0 not handled
* 1 Handled.
*/
int
VSC_Open
(
struct
VSM_data
*
vd
,
int
diag
);
/*
* Open shared memory for VSC processing.
* args and returns as VSM_Open()
*/
struct
VSC_C_main
*
VSC_Main
(
struct
VSM_data
*
vd
);
/*
* return Main stats structure
*/
struct
VSC_point
{
const
char
*
class
;
/* stat struct type */
const
char
*
ident
;
/* stat struct ident */
const
char
*
name
;
/* field name */
const
char
*
fmt
;
/* field format ("uint64_t") */
int
flag
;
/* 'a' = counter, 'i' = gauge */
const
char
*
desc
;
/* description */
const
volatile
void
*
ptr
;
/* field value */
};
typedef
int
VSC_iter_f
(
void
*
priv
,
const
struct
VSC_point
*
const
pt
);
int
VSC_Iter
(
struct
VSM_data
*
vd
,
VSC_iter_f
*
func
,
void
*
priv
);
/*
* Iterate over all statistics counters, calling "func" for
* each counter not suppressed by any "-f" arguments.
*/
/*---------------------------------------------------------------------
/*---------------------------------------------------------------------
* VSL level access functions
* VSL level access functions
*/
*/
...
...
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