From 45c2b487202a3455db7cc86f108bfe2fe54677ef Mon Sep 17 00:00:00 2001 From: jistone Date: Mon, 16 Jan 2006 23:40:50 +0000 Subject: 2006-01-16 Josh Stone 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 * stat.c (_stp_stat_clear): add a function that just clears a Stat, so we can use delete in the translator. --- runtime/stat.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'runtime/stat.c') 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_ */ -- cgit