sh: Convert sh64 /proc/asids to debugfs and generic sh.

This converts the sh64 /proc/asids entry to debugfs and enables it for
all SH parts that have debugfs enabled.

On MMU systems this can be used to determine which processes are using
which ASIDs which in turn can be used for finer grained cache tag
analysis.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Paul Mundt
2008-12-10 18:06:36 +09:00
parent 4d1f3bbec4
commit a99d6fde69
5 changed files with 81 additions and 43 deletions

View File

@@ -23,7 +23,6 @@
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/io.h>
#include <asm/syscalls.h>
#include <asm/uaccess.h>
@@ -590,41 +589,3 @@ unsigned long get_wchan(struct task_struct *p)
#endif
return pc;
}
/* Provide a /proc/asids file that lists out the
ASIDs currently associated with the processes. (If the DM.PC register is
examined through the debug link, this shows ASID + PC. To make use of this,
the PID->ASID relationship needs to be known. This is primarily for
debugging.)
*/
#if defined(CONFIG_SH64_PROC_ASIDS)
static int
asids_proc_info(char *buf, char **start, off_t fpos, int length, int *eof, void *data)
{
int len=0;
struct task_struct *p;
read_lock(&tasklist_lock);
for_each_process(p) {
int pid = p->pid;
if (!pid)
continue;
if (p->mm)
len += sprintf(buf+len, "%5d : %02lx\n", pid,
asid_cache(smp_processor_id()));
else
len += sprintf(buf+len, "%5d : (none)\n", pid);
}
read_unlock(&tasklist_lock);
*eof = 1;
return len;
}
static int __init register_proc_asids(void)
{
create_proc_read_entry("asids", 0, NULL, asids_proc_info, NULL);
return 0;
}
__initcall(register_proc_asids);
#endif