summaryrefslogtreecommitdiff
path: root/viengoos/activity.c
diff options
context:
space:
mode:
authorneal <neal>2008-07-04 09:08:00 +0000
committerneal <neal>2008-07-04 09:08:00 +0000
commit3a1baf63e36c9add56f39e1f72804165b7312d9e (patch)
tree36ca2ff52b790f66024107024fb771e8251c771c /viengoos/activity.c
parent326bc8dd2af1af31f49dde75f86a38379533f8ce (diff)
2008-07-04 Neal H. Walfield <neal@gnu.org>
* activity.c: Include "zalloc.h" and "memory.h". (activity_dump): Also print the total amount of memory, the available memory, and the memory on the laundry list.
Diffstat (limited to 'viengoos/activity.c')
-rw-r--r--viengoos/activity.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/viengoos/activity.c b/viengoos/activity.c
index 1b54f6f..2f1fe18 100644
--- a/viengoos/activity.c
+++ b/viengoos/activity.c
@@ -26,6 +26,8 @@
#include "thread.h"
#include "object.h"
#include "profile.h"
+#include "zalloc.h"
+#include "memory.h"
struct activity *root_activity;
@@ -73,6 +75,9 @@ activity_create (struct activity *parent,
void
activity_destroy (struct activity *activity, struct activity *victim)
{
+ debug (0, "Destroying activity " OBJECT_NAME_FMT,
+ OBJECT_NAME_PRINTF ((struct object *) victim));
+
assert (object_type ((struct object *) activity) == cap_activity_control);
assert (object_type ((struct object *) victim) == cap_activity_control);
@@ -115,7 +120,7 @@ activity_destroy (struct activity *activity, struct activity *victim)
folio_free (activity, (struct folio *) o);
}
- /* Activity's that are sub-activity's of ACTIVITY are not
+ /* Activities that are sub-activities of ACTIVITY are not
necessarily allocated out of storage allocated to ACTIVITY. */
while ((o = cap_to_object (activity, &victim->children_cap)))
{
@@ -408,7 +413,7 @@ do_activity_dump (struct activity *activity, int indent)
int clean = eviction_list_count (&activity->eviction_clean);
int dirty = eviction_list_count (&activity->eviction_dirty);
- printf ("%s " OBJECT_NAME_FMT ": %d frames (active: %d, inactive: %d, "
+ printf ("%s" OBJECT_NAME_FMT ": %d frames (active: %d, inactive: %d, "
"pending eviction: %d/%d); total: %d; "
"%d free allocs, %d karma, %d excluded, s:%d/%d; c:%d/%d\n",
indent_string,
@@ -431,6 +436,13 @@ do_activity_dump (struct activity *activity, int indent)
void
activity_dump (struct activity *activity)
{
- do_debug (0)
- do_activity_dump (activity, 0);
+ do_debug (5)
+ {
+ printf ("Available memory: %d (%d%%); laundry: %d\n",
+ zalloc_memory + available_list_count (&available),
+ (100 * (zalloc_memory + available_list_count (&available))) /
+ memory_total,
+ eviction_list_count (&laundry));
+ do_activity_dump (activity, 0);
+ }
}