Revert "sysinfo, procfs: Support memory info partially"
This reverts commit 8f74888f87.
Change-Id: I65530dd8a4e1af2ca47cb02c02f5c54a9b4595a5
This commit is contained in:
@@ -56,24 +56,6 @@ rusage_total_memory_add(unsigned long size)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_total_memory()
|
||||
{
|
||||
return rusage.total_memory;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_free_memory()
|
||||
{
|
||||
return rusage.total_memory - rusage.total_memory_usage;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_usage_memory()
|
||||
{
|
||||
return rusage.total_memory_usage;
|
||||
}
|
||||
|
||||
static inline void
|
||||
rusage_rss_add(unsigned long size)
|
||||
{
|
||||
@@ -417,24 +399,6 @@ rusage_rss_add(unsigned long size)
|
||||
{
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_total_memory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_free_memory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline unsigned long
|
||||
rusage_get_usage_memory()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
rusage_rss_sub(unsigned long size)
|
||||
{
|
||||
|
||||
@@ -443,22 +443,6 @@ struct rusage {
|
||||
long ru_nivcsw;
|
||||
};
|
||||
|
||||
struct sysinfo {
|
||||
long uptime; /* Seconds since boot */
|
||||
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
|
||||
unsigned long totalram; /* Total usable main memory size */
|
||||
unsigned long freeram; /* Available memory size */
|
||||
unsigned long sharedram; /* Amount of shared memory */
|
||||
unsigned long bufferram; /* Memory used by buffers */
|
||||
unsigned long totalswap; /* Total swap space size */
|
||||
unsigned long freeswap; /* swap space still available */
|
||||
unsigned short procs; /* Number of current processes */
|
||||
unsigned long totalhigh; /* Total high memory size */
|
||||
unsigned long freehigh; /* Available high memory size */
|
||||
unsigned int mem_unit; /* Memory unit size in bytes */
|
||||
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding for libc5 */
|
||||
};
|
||||
|
||||
extern void terminate(int, int);
|
||||
|
||||
struct tod_data_s {
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <mman.h>
|
||||
#include <bitmap.h>
|
||||
#include <init.h>
|
||||
#include <rusage_private.h>
|
||||
|
||||
//#define DEBUG_PRINT_PROCFS
|
||||
|
||||
@@ -360,28 +359,6 @@ static int _process_procfs_request(struct ikc_scd_packet *rpacket, int *result)
|
||||
goto end;
|
||||
}
|
||||
#endif /* POSTK_DEBUG_ARCH_DEP_42 */
|
||||
else if (!strcmp(p, "meminfo")) {
|
||||
ans = snprintf(buf, count,
|
||||
"MemTotal: %10d kB\n"
|
||||
"MemFree: %10d kB\n"
|
||||
"SwapTotal: %10d kB\n"
|
||||
"SwapFree: %10d kB\n"
|
||||
"CommitLimit: %10d kB\n"
|
||||
"Committed_AS: %10d kB\n",
|
||||
rusage_get_total_memory() >> 10,
|
||||
rusage_get_free_memory() >> 10,
|
||||
0, 0,
|
||||
rusage_get_free_memory() >> 10,
|
||||
rusage_get_usage_memory() >> 10);
|
||||
|
||||
if (ans < 0 || ans > count ||
|
||||
buf_add(&buf_top, &buf_cur, buf, ans) < 0) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
ans = 0;
|
||||
goto end;
|
||||
}
|
||||
else {
|
||||
kprintf("unsupported procfs entry: %s\n", p);
|
||||
goto end;
|
||||
|
||||
@@ -6685,27 +6685,6 @@ SYSCALL_DECLARE(getrusage)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DECLARE(sysinfo)
|
||||
{
|
||||
struct sysinfo *sysinfo = (struct sysinfo *)ihk_mc_syscall_arg0(ctx);
|
||||
struct sysinfo __sysinfo;
|
||||
int ret = 0;
|
||||
|
||||
memset(&__sysinfo, '\0', sizeof(struct sysinfo));
|
||||
|
||||
__sysinfo.totalram = rusage_get_total_memory();
|
||||
__sysinfo.freeram = rusage_get_free_memory();
|
||||
__sysinfo.mem_unit = 1; // always one unit for McKernel
|
||||
|
||||
if (copy_to_user(sysinfo, &__sysinfo, sizeof(struct sysinfo))) {
|
||||
ret = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int ptrace_traceme(void);
|
||||
extern void set_single_step(struct thread *thread);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user