summaryrefslogtreecommitdiff
path: root/src/libvmon/vmon.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2017-03-07 18:27:41 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2017-03-14 19:41:48 -0700
commit2c9fe3973a28504e664c5d7c9d990bc2f16c0348 (patch)
treec21704ea12434680b60d4ac15ca1ba981a711f41 /src/libvmon/vmon.h
parent4c0ec19811a6192ae8c3739bd9caff7d91bb725f (diff)
libvmon: add "sys-wide" arg for sample callbacks
We need to eventually plumb an vwm_overlays_t reference back to sample_cb, for now we'll just obviate the need for the vwm_ptr global by plumbing the vwm_t through.
Diffstat (limited to 'src/libvmon/vmon.h')
-rw-r--r--src/libvmon/vmon.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libvmon/vmon.h b/src/libvmon/vmon.h
index 06a062b..56c7b56 100644
--- a/src/libvmon/vmon.h
+++ b/src/libvmon/vmon.h
@@ -217,7 +217,7 @@ struct _vmon_t;
/* list of callbacks is maintained for the per-process callbacks, it's convenient to do things like update multiple dynamic contexts associated with a given process monitor (think multiple windows) */
typedef struct _vmon_proc_callback_t {
- void (*func)(struct _vmon_t *, struct _vmon_proc_t *, void *);
+ void (*func)(struct _vmon_t *, void *, struct _vmon_proc_t *, void *);
void *arg;
list_head_t callbacks;
} vmon_proc_callback_t;
@@ -283,7 +283,8 @@ typedef struct _vmon_t {
vmon_sys_wants_t activity; /* bits updated when there's activity on the respective wants (stores have changes) */
void *stores[VMON_STORE_SYS_NR]; /* stores for the sys-wide wants */
- void (*sample_cb)(struct _vmon_t *); /* callback invoked after executing the selected sys wants (once per vmon_sample() call)) */
+ void (*sample_cb)(struct _vmon_t *, void *); /* callback invoked after executing the selected sys wants (once per vmon_sample() call)) */
+ void *sample_cb_arg; /* user pointer for sample_cb */
char buf[8192]; /* scratch buffer for private use XXX: it may make sense to dynamically size these... */
char buf_bis[8192]; /* secondary scratch buffer for private use */
@@ -301,8 +302,8 @@ typedef struct _vmon_t {
int vmon_init(vmon_t *, vmon_flags_t, vmon_sys_wants_t, vmon_proc_wants_t);
void vmon_destroy(vmon_t *);
-vmon_proc_t * vmon_proc_monitor(vmon_t *, vmon_proc_t *, int, vmon_proc_wants_t, void (*)(vmon_t *, vmon_proc_t *, void *), void *);
-void vmon_proc_unmonitor(vmon_t *, vmon_proc_t *, void (*)(vmon_t *, vmon_proc_t *, void *), void *);
+vmon_proc_t * vmon_proc_monitor(vmon_t *, vmon_proc_t *, int, vmon_proc_wants_t, void (*)(vmon_t *, void *, vmon_proc_t *, void *), void *);
+void vmon_proc_unmonitor(vmon_t *, vmon_proc_t *, void (*)(vmon_t *, void *, vmon_proc_t *, void *), void *);
int vmon_sample(vmon_t *);
#endif
© All Rights Reserved