Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux ×Ô¼ìºÍ SystemTap


 
 
SystemTap ÊǼà¿ØºÍ¸ú×ÙÔËÐÐÖÐµÄ Linux Äں˵IJÙ×÷µÄ¶¯Ì¬·½·¨¡£Õâ¾ä»°µÄ¹Ø¼ü´ÊÊǶ¯Ì¬£¬ÒòΪ SystemTap ûÓÐʹÓù¤¾ß¹¹½¨Ò»¸öÌØÊâµÄÄںˣ¬¶øÊÇÔÊÐíÄúÔÚÔËÐÐʱ¶¯Ì¬µØ°²×°¸Ã¹¤¾ß¡£Ëüͨ¹ýÒ»¸öÃûΪKprobes µÄÓ¦Óñà³Ì½Ó¿Ú£¨API£©À´ÊµÏÖ¸ÃÄ¿µÄ£¬±¾ÎĽ«Ì½Ë÷Õâ¸ö API¡£ÎÒÃÇÊ×ÏÈÁ˽âÒÔÇ°µÄһЩÄں˸ú×Ù·½·¨£¬È»ºóÔÚÉîÈë̽ÌÖ SystemTap µÄ¼Ü¹¹¼°ÆäʹÓá£
Äں˸ú×Ù
SystemTap ÓëÒ»ÖÖÃûΪ DTrace µÄÀϼ¼ÊõÏàËÆ£¬¸Ã¼¼ÊõÔ´ÓÚ Sun Solaris ²Ù×÷ϵͳ¡£ÔÚ DTrace ÖУ¬¿ª·¢ÈËÔ±¿ÉÒÔÓà D ±à³ÌÓïÑÔ£¨C ÓïÑÔµÄ×Ó¼¯£¬µ«ÐÞ¸ÄΪ֧³Ö¸ú×ÙÐÐΪ£©±àд½Å±¾¡£DTrace ½Å±¾°üº¬Ðí¶à̽ÕëºÍÏà¹ØÁªµÄ²Ù×÷£¬ÕâЩ²Ù×÷ÔÚ̽Õë “´¥·¢” ʱ·¢Éú¡£ÀýÈ磬̽Õë¿ÉÒÔ±íʾ¼òµ¥µÄϵͳµ÷Óã¬Ò²¿ÉÒÔ±íʾ¸ü¼Ó¸´ÔӵĽ»»¥£¬±ÈÈçÖ´ÐÐÌض¨µÄ´úÂëÐС£Çåµ¥ 1 ÏÔʾÁË DTrace ½Å±¾µÄÒ»¸ö¼òµ¥Àý×Ó£¬Ëü¼ÆËãÿ¸ö½ø³Ì·¢³öµÄϵͳµ÷ÓõÄÊýÁ¿£¨×¢Ò⣬ʹÓÃ×ֵ佫¼ÆÊýºÍ½ø³Ì¹ØÁªÆðÀ´£©¡£¸Ã½Å±¾µÄ¸ñʽ°üº¬Ì½Õ루ÔÚ·¢³öϵͳµ÷ÓÃʱ´¥·¢£©ºÍ²Ù×÷£¨¶ÔÓ¦µÄ²Ù×÷½Å±¾£©¡£
Çåµ¥ 1. ¼ÆËãÿ¸ö½ø³ÌµÄϵͳµ÷Óõļòµ¥ DTrace ½Å±¾
                                  
syscall:::entry
{
 
  @num[pid,execname] = count();
 
}
 
DTrace ÊÇ Solaris ×îÒýÈËעĿµÄ²¿·Ö£¬ËùÒÔÔÚÆäËû²Ù×÷ϵͳÖпª·¢Ëü²¢²»Ææ¹Ö¡£DTrace ÊÇÔÚ Common Development and Distribution License (CDDL) ֮Ϸ¢Ðеģ¬²¢ÇÒ±»ÒÆÖ²µ½ FreeBSD ²Ù×÷ϵͳÖС£
ÁíÒ»¸ö·Ç³£ÓÐÓõÄÄں˸ú×Ù¹¤¾ßÊÇ ProbeVue£¬ËüÊÇ IBM Ϊ IBM® AIX® ²Ù×÷ϵͳ 6.1 ¿ª·¢µÄ¡£Äú¿ÉÒÔʹÓà ProbeVue ̽²éϵͳµÄÐÐΪºÍÐÔÄÜ£¬ÒÔ¼°ÌṩÌض¨½ø³ÌµÄÏêϸÐÅÏ¢¡£Õâ¸ö¹¤¾ßʹÓÃÒ»¸ö±ê×¼µÄÄÚºËÒÔ¶¯Ì¬µÄ·½Ê½½øÐиú×Ù¡£Çåµ¥ 2 ÏÔʾÁË ProbeVue ½Å±¾µÄÒ»¸öÀý×Ó£¬ËüÖ¸³ö·¢³ö sync ϵͳµ÷ÓõÄÌض¨½ø³Ì¡£
Çåµ¥ 2. Ö¸³öÄĸö½ø³Ìµ÷Óà sync µÄ¼òµ¥ ProbeVue ½Å±¾
                                  
@@syscall:*:sync:entry
{
  printf( "sync() syscall invoked


Ïà¹ØÎĵµ£º

redhat enterprise linux5.4 °²×° oracle 11g R2

Ò»£¬Ó²¼þÅäÖÃ×îµÍÒªÇó£º
32루X86£©£º
¸öÈËÈÏΪÖÁÉÙ1GÄڴ棨linux ÉÏ512M ¿ÉÒÔ£¬µ«Ì«¹ýÓÚÃãÇ¿ÁË£¬ÄÇÑùÈÝÒ×ËÀ»ú»ò¿¨×¡²»¶¯£¬»áÈÃÈË×¥¿ñµÄ;
windows 512M µÄ¿Ï¶¨²»ÐУ©

10GµÄ¿ÉÓô ......

Linux °²×°ÖÐÎÄ°ü

Linux °²×°ÖÐÎÄ°ü
Ê×ÏÈ£¬°²×°ÖÐÎÄ°ü£º
#yum groupinstall chinese-support
Æä´Î£¬ÐÞ¸ÄÒ»ÏÂ×Ö·û±àÂëµÄÅäÖá£
# vi /etc/sysconfig/i18n
Ð޸ĺóÄÚÈÝÈçÏ£º  
LANG="zh_CN.GB18030"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030"
SYSFONT="latarcyrheb-sun16"
×îºóÖØÆô·þ ......

һЩ³£ÓõÄLinuxÃüÁî

¡¡¡¡×ܽáһЩ³£ÓõÄLinuxÃüÁî¡£
Ò»¡¢LinuxÄں˺Ͱ汾²éѯÃüÁî
¡¡¡¡ÃüÁ uname -a
¡¡¡¡×÷Ó㺠²é¿´ÏµÍ³Äں˰汾ºÅ¼°ÏµÍ³Ãû³Æ¡£
¡¡¡¡ÃüÁ cat /proc/version
¡¡¡¡×÷Ó㺠²é¿´Ä¿Â¼"/proc"ÏÂversionµÄÐÅÏ¢£¬Ò²¿ÉÒԵõ½µ±Ç°ÏµÍ³µÄÄں˰汾ºÅ¼°ÏµÍ³Ãû³Æ¡£
¡¡¡¡ÃüÁlsb_release -a
¡¡¡¡×÷Ó㺵Ǽµ½·þÎñÆ÷Ö ......

linuxÔ¶³Ì×ÀÃ旗ʹÓÃxmanager2.0

˵Ã÷£ºÏëÔÚwindowsÉÏ´ò¿ªÊ¹ÓÃÔ¶³Ìlinux×ÀÃæ¡£·½·¨Ò²ºÜ¶à¡£
1.vnc¡£Õâ¸öÔÚlinux¶ËÐèÒª°²×°³ÌÐò£¬ÐèÒªÔÚlinuxÉÏÔËÐÐÏàÓ¦µÄ³ÌÐò£¬²ÅÄÜʹwindowsÁ¬½ÓÉÏÈ¥¡£²»Ì«·½±ã¡£
2.xmanager.Ö»ÒªÐÞ¸ÄÒ»ÏÂlinuxÀïµÄ¼¸¸öÎļþÉèÖþͿÉÒÔʹÓᣣ¨ÓëwindowsµÄÔ¶³Ì×ÀÃæÒ»Ñù£¬Ö»ÐèÒª¹´ÉÏÔ¶³Ì×ÀÃæÑ¡Ï
linuxÉÏÉèÖÃÏîÄ¿£º
1¡£ÐÞ¸Ä/etc/X11/xd ......

Linux shell½Å±¾µÄ×Ö·û´®½ØÈ¡

Linux µÄ×Ö·û´®½ØÈ¡ºÜÓÐÓá£ÓаËÖÖ·½·¨¡£
¼ÙÉèÓбäÁ¿ var=http://www.hao.com/123.htm
.
.
Ò» # ºÅ½ØÈ¡£¬É¾³ý×ó±ß×Ö·û£¬±£ÁôÓÒ±ß×Ö·û¡£
echo ${var#*//}
ÆäÖÐ var ÊDZäÁ¿Ãû£¬# ºÅÊÇÔËËã·û£¬*// ±íʾ´Ó×ó±ß¿ªÊ¼É¾³ýµÚÒ»¸ö // ºÅ¼°×ó±ßµÄËùÓÐ×Ö·û
¼´É¾³ý http://
½á¹ûÊÇ £ºwww.hao.com/123.htm
   .
.
¶ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ