===== arch/sparc64/kernel/setup.c 1.54 vs edited ===== --- 1.54/arch/sparc64/kernel/setup.c 2004-06-27 00:19:38 -07:00 +++ edited/arch/sparc64/kernel/setup.c 2004-07-23 15:58:47 -07:00 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -714,3 +715,80 @@ } subsys_initcall(topology_init); + +static u64 memcpy_lens[256 + 1]; +static u64 src_align[64]; +static u64 dst_align[64]; + +extern __kernel_size_t __real_memcpy(void *, const void *, __kernel_size_t); + +__kernel_size_t __memcpy(void *dst, const void *src, __kernel_size_t len) +{ + memcpy_lens[(len <= 256) ? len : 256]++; + src_align[((long)src) & 63]++; + dst_align[((long)dst) & 63]++; + + if (prof_buffer) { + unsigned long pc; + + pc = (unsigned long) __builtin_return_address(0); + pc -= (unsigned long) _stext; + pc >>= prof_shift; + if (pc >= prof_len) + pc = prof_len - 1; + atomic_inc((atomic_t *)&prof_buffer[pc]); + } + + return __real_memcpy(dst, src, len); +} + +static int show_memcpy_lens(struct seq_file *m, void *__unused) +{ + int i; + + for (i = 0; i <= 256; i++) + seq_printf(m, "[%3d]: %lu\n", i, memcpy_lens[i]); + + return 0; +} + +struct seq_operations memcpy_lens_op = { + .start =c_start, + .next = c_next, + .stop = c_stop, + .show = show_memcpy_lens, +}; + +static int show_memcpy_src_align(struct seq_file *m, void *__unused) +{ + int i; + + for (i = 0; i < 64; i++) + seq_printf(m, "[%2d]: %lu\n", i, src_align[i]); + + return 0; +} + +struct seq_operations src_align_op = { + .start =c_start, + .next = c_next, + .stop = c_stop, + .show = show_memcpy_src_align, +}; + +static int show_memcpy_dst_align(struct seq_file *m, void *__unused) +{ + int i; + + for (i = 0; i < 64; i++) + seq_printf(m, "[%2d]: %lu\n", i, dst_align[i]); + + return 0; +} + +struct seq_operations dst_align_op = { + .start =c_start, + .next = c_next, + .stop = c_stop, + .show = show_memcpy_dst_align, +}; ===== arch/sparc64/kernel/time.c 1.53 vs edited ===== --- 1.53/arch/sparc64/kernel/time.c 2004-05-07 07:17:21 -07:00 +++ edited/arch/sparc64/kernel/time.c 2004-07-23 15:09:34 -07:00 @@ -443,11 +443,12 @@ void sparc64_do_profile(struct pt_regs *regs) { +#if 0 unsigned long pc = regs->tpc; unsigned long o7 = regs->u_regs[UREG_RETPC]; - +#endif profile_hook(regs); - +#if 0 if (user_mode(regs)) return; @@ -480,6 +481,7 @@ pc = prof_len - 1; atomic_inc((atomic_t *)&prof_buffer[pc]); } +#endif } static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs * regs) ===== arch/sparc64/lib/VIScopy.S 1.6 vs edited ===== --- 1.6/arch/sparc64/lib/VIScopy.S 2004-02-10 21:34:37 -08:00 +++ edited/arch/sparc64/lib/VIScopy.S 2004-07-23 15:05:25 -07:00 @@ -306,11 +306,11 @@ .globl __memcpy_begin __memcpy_begin: - .globl __memcpy - .type __memcpy,@function + .globl __real_memcpy + .type __real_memcpy,@function memcpy_private: -__memcpy: +__real_memcpy: memcpy: mov ASI_P, asi_src ! IEU0 Group brnz,pt %o2, __memcpy_entry ! CTI mov ASI_P, asi_dest ! IEU1 ===== fs/proc/proc_misc.c 1.103 vs edited ===== --- 1.103/fs/proc/proc_misc.c 2004-06-24 01:55:46 -07:00 +++ edited/fs/proc/proc_misc.c 2004-07-23 15:05:25 -07:00 @@ -270,6 +270,42 @@ .release = seq_release, }; +extern struct seq_operations memcpy_lens_op; +static int memcpy_lens_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &memcpy_lens_op); +} +static struct file_operations proc_memcpy_lens_operations = { + .open = memcpy_lens_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +extern struct seq_operations src_align_op; +static int src_align_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &src_align_op); +} +static struct file_operations proc_src_align_operations = { + .open = src_align_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +extern struct seq_operations dst_align_op; +static int dst_align_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &dst_align_op); +} +static struct file_operations proc_dst_align_operations = { + .open = dst_align_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + extern struct seq_operations vmstat_op; static int vmstat_open(struct inode *inode, struct file *file) { @@ -671,6 +707,9 @@ if (entry) entry->proc_fops = &proc_kmsg_operations; create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); + create_seq_entry("memcpy_lens", 0, &proc_memcpy_lens_operations); + create_seq_entry("src_align", 0, &proc_src_align_operations); + create_seq_entry("dst_align", 0, &proc_dst_align_operations); create_seq_entry("partitions", 0, &proc_partitions_operations); create_seq_entry("stat", 0, &proc_stat_operations); create_seq_entry("interrupts", 0, &proc_interrupts_operations);