From: giwoong.kim Date: Fri, 20 Apr 2012 07:59:27 +0000 (+0900) Subject: [Title] added memory log X-Git-Tag: TizenStudio_2.0_p2.3~1490 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3f064823125c6df75b4865fc6ee4b89d5bc8fb26;p=sdk%2Femulator%2Fqemu.git [Title] added memory log [Type] enhancement [Module] Emulator [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- diff --git a/tizen/src/emulator.c b/tizen/src/emulator.c old mode 100644 new mode 100755 index cadfdac..d322a4b --- a/tizen/src/emulator.c +++ b/tizen/src/emulator.c @@ -48,10 +48,11 @@ #include #if defined( _WIN32) -//#include +#include #elif defined(__linux__) #include #include +#include #endif #include "mloop_event.h" @@ -234,6 +235,8 @@ void extract_info(int qemu_argc, char** qemu_argv) static void system_info(void) { +#define DIV 1024 + #ifdef __linux__ char lscmd[MAXLEN] = "lspci >> "; #endif @@ -277,6 +280,12 @@ static void system_info(void) GetSystemInfo(&sysi); INFO("* Processor type : %d, Number of processors : %d\n", sysi.dwProcessorType, sysi.dwNumberOfProcessors); + MEMORYSTATUSEX memInfo; + memInfo.dwLength = sizeof(MEMORYSTATUSEX); + GlobalMemoryStatusEx(&memInfo); + INFO("* Total Ram : %llu kB, Free: %lld kB\n", + memInfo.ullTotalPhys / DIV, memInfo.ullAvailPhys / DIV); + #elif defined(__linux__) /* depends on building */ INFO("* Qemu build machine linux kernel version : (%d, %d, %d)\n", @@ -289,6 +298,13 @@ static void system_info(void) host_uname_buf.release, host_uname_buf.version, host_uname_buf.machine); } + struct sysinfo sys_info; + if (sysinfo(&sys_info) == 0) { + INFO("* Total Ram : %llu kB, Free: %llu kB\n", + sys_info.totalram * (unsigned long long)sys_info.mem_unit / DIV, + sys_info.freeram * (unsigned long long)sys_info.mem_unit / DIV); + } + /* pci device description */ INFO("* Pci devices :\n"); strcat(lscmd, logpath);