diff options
author | jistone <jistone> | 2006-01-16 23:40:50 +0000 |
---|---|---|
committer | jistone <jistone> | 2006-01-16 23:40:50 +0000 |
commit | 45c2b487202a3455db7cc86f108bfe2fe54677ef (patch) | |
tree | ce7eea7a4fbb27cd347bb03e8e3312be26207ba8 /runtime/stat.c | |
parent | f903d01cf2ace79ec2f9a046e8072d0095b4928b (diff) | |
download | systemtap-steved-45c2b487202a3455db7cc86f108bfe2fe54677ef.tar.gz systemtap-steved-45c2b487202a3455db7cc86f108bfe2fe54677ef.tar.xz systemtap-steved-45c2b487202a3455db7cc86f108bfe2fe54677ef.zip |
2006-01-16 Josh Stone <joshua.i.stone@intel.com>
PR 2140
* translate.cxx (mapvar::del): Add ability to delete an indexed stat
from (p)maps.
(delete_statement_operand_visitor::visit_symbol): Add ability to
delete entire pmaps and scalars.
(delete_statement_operand_tmp_visitor): Add a special tmpvar visitor
to parallel delete_statement_operand_visitor.
(c_tmpcounter::visit_delete_statement): Invoke the new visitor.
* testsuite/buildok/delete.stp: Also test scalar deletes.
* vim/syntax/stap.vim: Recognize 'delete' operator.
2006-01-16 Josh Stone <joshua.i.stone@intel.com>
* stat.c (_stp_stat_clear): add a function that just
clears a Stat, so we can use delete in the translator.
Diffstat (limited to 'runtime/stat.c')
-rw-r--r-- | runtime/stat.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/stat.c b/runtime/stat.c index c759a043..29dcef9b 100644 --- a/runtime/stat.c +++ b/runtime/stat.c @@ -1,6 +1,7 @@ /* -*- linux-c -*- * Statistics Aggregation * Copyright (C) 2005 Red Hat Inc. + * Copyright (C) 2006 Intel Corporation * * This file is part of systemtap, and is free software. You can * redistribute it and/or modify it under the terms of the GNU General @@ -270,6 +271,22 @@ void _stp_stat_print (Stat st, char *fmt, int clear) __stp_stat_print (fmt, st, agg, 0); STAT_UNLOCK(agg); } + +/** Clear Stats. + * Clears the Stats. + * + * @param st Stat + */ +void _stp_stat_clear (Stat st) +{ + int i; + for_each_cpu(i) { + stat *sd = per_cpu_ptr (st->sd, i); + STAT_LOCK(sd); + _stp_stat_clear_data (st, sd); + STAT_UNLOCK(sd); + } +} /** @} */ #endif /* _STAT_C_ */ |