aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/stats/stat_segment.h
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-02-26 13:10:56 +0100
committerDamjan Marion <dmarion@me.com>2019-02-26 20:17:30 +0000
commit849cbe225ea9c0358e3f2789c89d4b84d0f7b367 (patch)
tree6cd69a8271367ee08a3e03eb7297c87975aac5cf /src/vpp/stats/stat_segment.h
parentca80dccb1e91bf83a133bd91d9ff1693840e95c6 (diff)
stats: buffer gauge callbacks use index instead of name.
Change-Id: I500b8e72d7e021b9564dad0ffc087cb0e1ceb96f Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp/stats/stat_segment.h')
-rw-r--r--src/vpp/stats/stat_segment.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/vpp/stats/stat_segment.h b/src/vpp/stats/stat_segment.h
index f3ea50c9d99..fb450f38f53 100644
--- a/src/vpp/stats/stat_segment.h
+++ b/src/vpp/stats/stat_segment.h
@@ -85,12 +85,18 @@ stat_segment_pointer (void *start, uint64_t offset)
return ((char *) start + offset);
}
-typedef void (*stat_segment_update_fn)(stat_segment_directory_entry_t * e);
+typedef void (*stat_segment_update_fn)(stat_segment_directory_entry_t * e, u32 i);
+
+typedef struct {
+ u32 directory_index;
+ stat_segment_update_fn fn;
+ u32 caller_index;
+} stat_segment_gauges_pool_t;
typedef struct
{
/* internal, does not point to shared memory */
- stat_segment_update_fn *gauges_fns;
+ stat_segment_gauges_pool_t *gauges;
/* statistics segment */
uword *directory_vector_by_name;
@@ -104,12 +110,12 @@ typedef struct
stat_segment_shared_header_t *shared_header; /* pointer to shared memory segment */
int memfd;
- u64 last_input_packets;
+ u64 last_input_packets; // OLE REMOVE?
} stat_segment_main_t;
extern stat_segment_main_t stat_segment_main;
clib_error_t *
-stat_segment_register_gauge (u8 *names, stat_segment_update_fn update_fn);
+stat_segment_register_gauge (u8 *names, stat_segment_update_fn update_fn, u32 index);
#endif