'Programming > web 관련' 카테고리의 다른 글
DASH - Dynamic Adaptive Streaming over HTTP (0) | 2015.09.11 |
---|---|
웹소켓(websocket) (0) | 2015.01.07 |
HTML META cache (0) | 2014.10.20 |
aptana / eclipse (0) | 2014.08.25 |
node.js (0) | 2014.07.07 |
DASH - Dynamic Adaptive Streaming over HTTP (0) | 2015.09.11 |
---|---|
웹소켓(websocket) (0) | 2015.01.07 |
HTML META cache (0) | 2014.10.20 |
aptana / eclipse (0) | 2014.08.25 |
node.js (0) | 2014.07.07 |
sysinfo.c
/*********************************************************************** * Some values in /proc are expressed in units of 1/HZ seconds, where HZ * is the kernel clock tick rate. One of these units is called a jiffy. * The HZ value used in the kernel may vary according to hacker desire. * According to Linus Torvalds, this is not true. He considers the values * in /proc as being in architecture-dependant units that have no relation * to the kernel clock tick rate. Examination of the kernel source code * reveals that opinion as wishful thinking. * * In any case, we need the HZ constant as used in /proc. (the real HZ value * may differ, but we don't care) There are several ways we could get HZ: * * 1. Include the kernel header file. If it changes, recompile this library. * 2. Use the sysconf() function. When HZ changes, recompile the C library! * 3. Ask the kernel. This is obviously correct... * * Linus Torvalds won't let us ask the kernel, because he thinks we should * not know the HZ value. Oh well, we don't have to listen to him. * Someone smuggled out the HZ value. :-) * * This code should work fine, even if Linus fixes the kernel to match his * stated behavior. The code only fails in case of a partial conversion. * * Recent update: on some architectures, the 2.4 kernel provides an * ELF note to indicate HZ. This may be for ARM or user-mode Linux * support. This ought to be investigated. Note that sysconf() is still * unreliable, because it doesn't return an error code when it is * used with a kernel that doesn't support the ELF note. On some other * architectures there may be a system call or sysctl() that will work. */ unsigned long long Hertz; static void old_Hertz_hack(void){ unsigned long long user_j, nice_j, sys_j, other_j; /* jiffies (clock ticks) */ double up_1, up_2, seconds; unsigned long long jiffies; unsigned h; char *restrict savelocale; savelocale = setlocale(LC_NUMERIC, NULL); setlocale(LC_NUMERIC, "C"); do{ FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1); /* uptime(&up_1, NULL); */ FILE_TO_BUF(STAT_FILE,stat_fd); sscanf(buf, "cpu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j); FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_2); /* uptime(&up_2, NULL); */ } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */ setlocale(LC_NUMERIC, savelocale); jiffies = user_j + nice_j + sys_j + other_j; seconds = (up_1 + up_2) / 2; h = (unsigned)( (double)jiffies/seconds/smp_num_cpus ); /* actual values used by 2.4 kernels: 32 64 100 128 1000 1024 1200 */ switch(h){ case 9 ... 11 : Hertz = 10; break; /* S/390 (sometimes) */ case 18 ... 22 : Hertz = 20; break; /* user-mode Linux */ case 30 ... 34 : Hertz = 32; break; /* ia64 emulator */ case 48 ... 52 : Hertz = 50; break; case 58 ... 61 : Hertz = 60; break; case 62 ... 65 : Hertz = 64; break; /* StrongARM /Shark */ case 95 ... 105 : Hertz = 100; break; /* normal Linux */ case 124 ... 132 : Hertz = 128; break; /* MIPS, ARM */ case 195 ... 204 : Hertz = 200; break; /* normal << 1 */ case 253 ... 260 : Hertz = 256; break; case 393 ... 408 : Hertz = 400; break; /* normal << 2 */ case 790 ... 808 : Hertz = 800; break; /* normal << 3 */ case 990 ... 1010 : Hertz = 1000; break; /* ARM */ case 1015 ... 1035 : Hertz = 1024; break; /* Alpha, ia64 */ case 1180 ... 1220 : Hertz = 1200; break; /* Alpha */ default: #ifdef HZ Hertz = (unsigned long long)HZ; /* <asm/param.h> */ #else /* If 32-bit or big-endian (not Alpha or ia64), assume HZ is 100. */ Hertz = (sizeof(long)==sizeof(int) || htons(999)==999) ? 100UL : 1024UL; #endif fprintf(stderr, "Unknown HZ value! (%d) Assume %Ld.\n", h, Hertz); } } |
[링크 : http://lkml.iu.edu/hypermail/linux/kernel/0401.2/0065.html]
[링크 : http://forum.buffalo.nas-central.org/viewtopic.php?f=18&t=13451]
[링크 : http://procps.sourceforge.net/]
[링크 : https://bugs.launchpad.net/ubuntu/+source/procps/+bug/364656]
[링크 : https://launchpadlibrarian.net/29934773/procps_3.2.7-11ubuntu3.debdiff.gz]
[링크 : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=460331]
[링크 : https://lkml.org/lkml/2002/2/18/187]
i.mx283 부팅모드 (0) | 2015.01.09 |
---|---|
freescale imx283 boot error code (0) | 2015.01.07 |
크로스 컴파일 옵션 configure --host (0) | 2014.10.13 |
iWMMX / iWMMXt - Intel XScale SIMD instructions (0) | 2014.10.08 |
thumb의 장단점? (0) | 2014.09.29 |
su -c "killall test"
이런식으로 스크립트에서 실행이 되는데
어떠한 이유로 이런 에러가 발생하는지는 미지수.
root 2204 1 0 14:10 ? 00:00:03 /opt/bin/test root 2212 2204 0 14:10 ? 00:00:00 [sh] <defunct> root 2220 2204 0 14:10 ? 00:00:00 [sh] <defunct> root 2228 2204 0 14:10 ? 00:00:00 [sh] <defunct> |
...
알고보니 ps 버전이 busybox와 일반 버전의 출력포맷이 달라서 생긴 문제.. 헐.. -_-
microcom 종료하기 (0) | 2024.12.04 |
---|---|
busybox su가 안될 경우 (0) | 2014.12.05 |
busybox tftp (0) | 2013.06.18 |
busybox - setconsole (0) | 2011.10.21 |
busybox ash "cannot open /dev/ttyAS1: no such device" (0) | 2010.04.20 |
이제 쉬는날이 없어...
으헝헝 설날까지는 이제 죽어라 일하는 날만 남았구나..
회사는 일단 다니고...
천천히 내년을 기약해야지
당장 굶어 죽겠는데 크윽 ㅠㅠ
라즈베리파이2 모델B / 비글본 블랙 (0) | 2015.02.10 |
---|---|
다치고 아프고 정신없고 바쁘고 (0) | 2015.02.04 |
뜬금포 칼 가는 취미! (0) | 2015.01.03 |
멀 해야 하려나... (0) | 2015.01.02 |
2015년 계획 (0) | 2015.01.01 |
이상한 취미를 가지게 될 거 같은 기분? ㅋㅋㅋ
[링크 : http://slds2.tistory.com/1277]
[링크 : http://www.dorco.co.kr/customer/kitchen_guide02]
다치고 아프고 정신없고 바쁘고 (0) | 2015.02.04 |
---|---|
에헤라 디야 좋은날 끝? (2) | 2015.01.04 |
멀 해야 하려나... (0) | 2015.01.02 |
2015년 계획 (0) | 2015.01.01 |
수습기간이 끝나가네.. + 수능전날 (0) | 2014.11.12 |
나이가 나이고
결혼해서 인지
더더욱 겁이 많아지는걸까...
실질 급여 마이너스
이직시 다음 급여의 기대 상승분.. 여러가지 고려했을때
영 아닌거 같긴한데... 이래저래 고민이네...
에헤라 디야 좋은날 끝? (2) | 2015.01.04 |
---|---|
뜬금포 칼 가는 취미! (0) | 2015.01.03 |
2015년 계획 (0) | 2015.01.01 |
수습기간이 끝나가네.. + 수능전날 (0) | 2014.11.12 |
다음주 부터 출근.. (4) | 2014.08.21 |
블로그 내용 위키로 정리하기
이직 준비하기 -_-a
출산 준비하기
이사 준비하기
다이어트 하기!!!!!!!
개인공부 할 시간이 있을지 모르겠지만.. 공부욕심을 늘리고 공부 과목은 줄이고..
- openGL 끝내자 쫌 ㅠㅠ
- cuda 끝내자 ㅠㅠ
뜬금포 칼 가는 취미! (0) | 2015.01.03 |
---|---|
멀 해야 하려나... (0) | 2015.01.02 |
수습기간이 끝나가네.. + 수능전날 (0) | 2014.11.12 |
다음주 부터 출근.. (4) | 2014.08.21 |
아직도 퇴사가 된게 아니었나? (4) | 2014.08.20 |
올해의 잘한 일 : 결혼
올해의 잘못 한 일 : 취업?
아무튼.. 2015년에는 더 나은 한해가 되길!
다이어트 라던가..
돈이라던가? ㅋㅋ
인트로솔루션 무료 홈페이지 서비스 종료 -_- (0) | 2015.02.01 |
---|---|
내 데이타 ㅠㅠ (0) | 2015.01.14 |
티스토리 에디터 강제 개편.. (0) | 2014.12.15 |
2일째.. speeds.kr 먹통.. (0) | 2014.09.25 |
호스팅어 일단.. 가입! (1) | 2014.08.27 |
top을 보다가 cpu 상태 정보의 내용이 궁금해져서 조사..
Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
user / system / low nice / idle / io wait / hard IRQ / soft IRQ / steal
가장 큰 비중을 차지 할 앞의 두개 정도를 더하면 실제 사용량이라고 해야하나
아니면 100% 에서 세번째 idle을 뺀걸 보면 되려나?
그리고 DomU라.. 가상화 쓸 경우에 대해서는 따로 잡히는 건가 보네..
2c. SUMMARY Area Fields The summary area fields describing CPU statistics are abbreviated. They provide information about times spent in: us = user mode sy = system mode ni = low priority user mode (nice) id = idle task wa = I/O waiting hi = servicing IRQs si = servicing soft IRQs st = steal (time given to other DomU instances) |
1을 누르면 top도 cpu별로 점유율을 볼 수 있다!
3b. SUMMARY Area Commands The summary area interactive commands are always available in both full-screen mode and alternate-display mode. They affect the beginning lines of your display and will determine the position of messages and prompts. These commands always impact just the 'current' window/field group. See topic 4. ALTERNATE-DISPLAY Mode and the 'G' interactive command for insight into 'current' windows and field groups. 'l' :Toggle_Load_Average/Uptime -- On/Off This is also the line containing the program name (possibly an alias) when operating in full-screen mode or the 'current' window name when operating in alternate-display mode. 'm' :Toggle_Memory/Swap_Usage -- On/Off This command affects two summary area lines. 't' :Toggle_Task/Cpu_States -- On/Off This command affects from 2 to many summary area lines, depending on the state of the '1' toggle and whether or not top is running under true SMP. '1' :Toggle_Single/Separate_Cpu_States -- On/Off This command affects how the 't' command's Cpu States portion is shown. Although this toggle exists primarily to serve massively-parallel SMP machines, it is not restricted to solely SMP environments. When you see 'Cpu(s):' in the summary area, the '1' toggle is On and all cpu information is gathered in a single line. Otherwise, each cpu is displayed separately as: 'Cpu0, Cpu1, ...' |
[링크 : http://linux.die.net/man/1/top]
2010/09/12 - [Linux] - top (1) - load average ?
cpu 활성화 기능 확인하기 (0) | 2015.02.06 |
---|---|
ntp monlist (0) | 2015.01.22 |
스크립트 상대경로를 절대경로로 변환하기 (0) | 2014.12.30 |
lightdm 실행하지 않도록 하기 (0) | 2014.12.24 |
우분투 Atom Z510 하드웨어 지원 중단 (0) | 2014.12.24 |
lighttpd cgi.assign (0) | 2017.07.28 |
---|---|
lighttpd epoll (0) | 2015.07.28 |