Merge branch 'master' of gitlab.ops-class.org:staff/os161

This commit is contained in:
Guru Prasad Srinivasa 2016-03-10 17:30:37 -05:00
commit 03f484ff21
11 changed files with 45 additions and 15 deletions

View File

@ -130,6 +130,7 @@ void *kmalloc(size_t size);
void kfree(void *ptr);
void kheap_printstats(void);
void kheap_printused(void);
unsigned long kheap_getused(void);
void kheap_nextgeneration(void);
void kheap_dump(void);
void kheap_dumpall(void);

View File

@ -819,17 +819,17 @@ kheap_printstats(void)
spinlock_release(&kmalloc_spinlock);
}
/*
* Print number of used heap bytes.
* Return the number of used bytes.
*/
void
kheap_printused(void)
{
unsigned long
kheap_getused(void) {
struct pageref *pr;
unsigned long total = 0;
char total_string[32];
/* print the whole thing with interrupts off */
/* compute with interrupts off */
spinlock_acquire(&kmalloc_spinlock);
for (pr = allbase; pr != NULL; pr = pr->next_all) {
total += subpage_stats(pr, true);
@ -837,7 +837,18 @@ kheap_printused(void)
total += coremap_used_bytes();
spinlock_release(&kmalloc_spinlock);
snprintf(total_string, sizeof(total_string), "%lu", total);
return total;
}
/*
* Print number of used bytes.
*/
void
kheap_printused(void)
{
char total_string[32];
snprintf(total_string, sizeof(total_string), "%lu", kheap_getused());
secprintf(SECRET, total_string, "khu");
}

View File

@ -2,9 +2,11 @@
name: "CV Test 1"
description:
Tests core CV functionality through cyclic waiting.
tags: [synch, cvs]
tags: [synch, cvs, kleaks]
depends: [boot, semaphores, locks]
sys161:
cpus: 32
---
khu
cvt1
khu

View File

@ -3,9 +3,11 @@ name: "CV Test 2"
description:
Tests core CV functionality through a mixture of sleeping and waking
threads.
tags: [synch, cvs]
tags: [synch, cvs, kleaks]
depends: [boot, semaphores, locks]
sys161:
cpus: 32
---
khu
cvt2
khu

View File

@ -1,10 +1,12 @@
---
name: "CV Test 5"
description:
Tests CV and location relationship.
tags: [synch, cvs]
Tests CV and lock relationship.
tags: [synch, cvs, kleaks]
depends: [boot, locks]
sys161:
cpus: 32
---
khu
cvt5
khu

View File

@ -2,9 +2,11 @@
name: "Lock Test 1"
description:
Tests core lock functionality through modifications to shared state.
tags: [synch, locks]
tags: [synch, locks, kleaks]
depends: [boot, semaphores]
sys161:
cpus: 32
---
khu
lt1
khu

View File

@ -3,9 +3,11 @@ name: "RW Lock Test 1"
description:
Tests core reader-writer lock functionality by reading and writing shared
state.
tags: [synch, rwlocks]
tags: [synch, rwlocks, kleaks]
depends: [boot, semaphores]
sys161:
cpus: 32
---
khu
rwt1
khu

View File

@ -3,9 +3,11 @@ name: "RW Lock Test 2"
description:
Tests that reader-writer locks allow maximum read concurrency when no
writers are waiting.
tags: [synch, rwlocks]
tags: [synch, rwlocks, kleaks]
depends: [boot, semaphores, cvs]
sys161:
cpus: 32
---
khu
rwt2
khu

View File

@ -2,9 +2,11 @@
name: "Semaphore Test"
description:
Tests core semaphore logic through cycling signaling.
tags: [synch, semaphores]
tags: [synch, semaphores, kleaks]
depends: [boot]
sys161:
cpus: 32
---
khu
sem1
khu

View File

@ -3,4 +3,6 @@ name: "Whalemating Test"
tags: [synchprobs]
depends: [boot, semaphores, locks]
---
khu
sp1
khu

View File

@ -3,4 +3,6 @@ name: "Stoplight Test"
tags: [synchprobs]
depends: [boot, semaphores, locks, cvs]
---
khu
sp2
khu