summaryrefslogtreecommitdiffstats
path: root/runtime/stat.c
diff options
context:
space:
mode:
authorhunt <hunt>2006-01-25 09:15:15 +0000
committerhunt <hunt>2006-01-25 09:15:15 +0000
commit98ec387a8443f7185814715175c4c0d86390c9b6 (patch)
treebff384e50bc08423bc4231c2d2ed93832bf2fd43 /runtime/stat.c
parentf10925a5b61a32ae45c7ad6946fdb53569616676 (diff)
downloadsystemtap-steved-98ec387a8443f7185814715175c4c0d86390c9b6.tar.gz
systemtap-steved-98ec387a8443f7185814715175c4c0d86390c9b6.tar.xz
systemtap-steved-98ec387a8443f7185814715175c4c0d86390c9b6.zip
2006-01-25 Martin Hunt <hunt@redhat.com>
* stat.c (_stp_stat_init): Use _stp_alloc_percpu(). (_stp_stat_del): New function. * alloc.c (_stp_alloc_percpu): New function. (_stp_free_percpu): New function.
Diffstat (limited to 'runtime/stat.c')
-rw-r--r--runtime/stat.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/runtime/stat.c b/runtime/stat.c
index 29dcef9b..d9eff2c3 100644
--- a/runtime/stat.c
+++ b/runtime/stat.c
@@ -101,7 +101,7 @@ Stat _stp_stat_init (int type, ...)
return NULL;
size = buckets * sizeof(int64_t) + sizeof(stat);
- sd = (stat *) __alloc_percpu (size, 8);
+ sd = (stat *) _stp_alloc_percpu (size);
if (sd == NULL)
goto exit1;
@@ -135,6 +135,20 @@ exit1:
return NULL;
}
+/** Delete Stat.
+ * Call this to free all memory allocated during initialization.
+ *
+ * @param st Stat
+ */
+void _stp_stat_del (Stat st)
+{
+ if (st) {
+ _stp_free_percpu (st->sd);
+ kfree (st->agg);
+ kfree (st);
+ }
+}
+
/** Add to a Stat.
* Add an int64 to a Stat.
*