Skip to contentSkip to conversation

ltt for 2.6.10 : mm/ events

PATCH In review Karim Yaghmour 1 participant 1 message Jan 14, 2005

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 6/8 ltt for 2.6.10 : mm/ events

mm/filemap.c +5 -0
@@ -28,6 +28,7 @@
 #include <linux/blkdev.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
+#include <linux/ltt-events.h>
 /*
  * This is needed for the following functions:
  *  - try_to_release_page
@@ -402,9 +403,13 @@ void fastcall wait_on_page_bit(struct pa
 {
 	DEFINE_WAIT_BIT(wait, &page->flags, bit_nr);
 
+	ltt_ev_memory(LTT_EV_MEMORY_PAGE_WAIT_START, 0);
+
 	if (test_bit(bit_nr, &page->flags))
 		__wait_on_bit(page_waitqueue(page), &wait, sync_page,
 							TASK_UNINTERRUPTIBLE);
+
+	ltt_ev_memory(LTT_EV_MEMORY_PAGE_WAIT_END, 0);
 }
 EXPORT_SYMBOL(wait_on_page_bit);
 
mm/memory.c +4 -0
@@ -47,6 +47,9 @@
 #include <linux/module.h>
 #include <linux/init.h>
 
+#include <linux/module.h>
+#include <linux/ltt-events.h>
+
 #include <asm/pgalloc.h>
 #include <asm/uaccess.h>
 #include <asm/tlb.h>
@@ -1346,6 +1349,7 @@ static int do_swap_page(struct mm_struct
 	spin_unlock(&mm->page_table_lock);
 	page = lookup_swap_cache(entry);
 	if (!page) {
+	        ltt_ev_memory(LTT_EV_MEMORY_SWAP_IN, address);
  		swapin_readahead(entry, address, vma);
  		page = read_swap_cache_async(entry, vma, address);
 		if (!page) {
mm/page_alloc.c +4 -0
@@ -32,6 +32,7 @@
 #include <linux/sysctl.h>
 #include <linux/cpu.h>
 #include <linux/nodemask.h>
+#include <linux/ltt-events.h>
 
 #include <asm/tlbflush.h>
 
@@ -278,6 +279,8 @@ void __free_pages_ok(struct page *page,
 	LIST_HEAD(list);
 	int i;
 
+	ltt_ev_memory(LTT_EV_MEMORY_PAGE_FREE, order);
+
 	arch_free_page(page, order);
 
 	mod_page_state(pgfree, 1 << order);
@@ -752,6 +755,7 @@ fastcall unsigned long __get_free_pages(
 	page = alloc_pages(gfp_mask, order);
 	if (!page)
 		return 0;
+	ltt_ev_memory(LTT_EV_MEMORY_PAGE_ALLOC, order);
 	return (unsigned long) page_address(page);
 }
 
mm/page_io.c +2 -0
@@ -17,6 +17,7 @@
 #include <linux/bio.h>
 #include <linux/swapops.h>
 #include <linux/writeback.h>
+#include <linux/ltt-events.h>
 #include <asm/pgtable.h>
 
 static struct bio *get_swap_bio(int gfp_flags, pgoff_t index,
@@ -103,6 +104,7 @@ int swap_writepage(struct page *page, st
 	inc_page_state(pswpout);
 	set_page_writeback(page);
 	unlock_page(page);
+	ltt_ev_memory(LTT_EV_MEMORY_SWAP_OUT, (unsigned long) page);
 	submit_bio(rw, bio);
 out:
 	return ret;