Slide 1

Slide 1 text

Why Programs Fail - Observing Facts ߊ಴੗ : ޙഅ҃ ([email protected]) ߊ಴ੌ : 2007֙ 4ਘ 16ੌ

Slide 2

Slide 2 text

Table of contents Observing Facts Log Interactive Debugging Post-mortem Debugging Query Event Visualization

Slide 3

Slide 3 text

Observing Facts ҳ୓੸ੋ प೯ীࢲ ੌযաח ࢎपٜ(Facts)ܳ ҙ଴ (Observing) оࢸҗ ো৉ਸ ా೧ࢲ ঳਷ ௏٘ߧਤ੄ Ѿҗܳ ҙ଴ ҙ଴੄ ਗ஗ рࢼೞ૑ ݈ইঠ ೠ׮. ޖ঺ਸ ঱ઁ ҙ଴ೡ Ѫੋ૑ ঌইঠ ೠ׮ ୓҅੸ਵ۽ ૓೯ೞۄ ҙ଴ ߑߨ Log Interactive Debugging Post-mortem Debugging

Slide 4

Slide 4 text

Log ೐۽Ӓ۔੉ ࢎपਸ ୹۱ೞח ߑߨ ٣ߡӒ ۽Ӓ, printf٣ߡӦ ױ੼ ૑੷࠙ೠ ௏٘ ૑੷࠙ೠ ୹۱ ࣘب ੷ೞ ੗ܐ ࣚप

Slide 5

Slide 5 text

Log (Con’t) ੹ਊ ۽Ӓ ӝߨ ಴ળ ഋधਸ ࢎਊ ݫఋؘ੉ఠ ੹ਊ ࠭য ࢎਊ ௏٘ਤ஖ (౵ੌݺ, ௏٘ۄੋ), ݽٕݺ, दр ੉߮౟ (WARNING, DEBUG, TRACE, FATAL) ৘ઁ “2007-04-02 20:24:13,509 [main] DEBUG TestLogging – Start of main()” 2007-04-02|02:24:13|509|main|DEBUG|TestLogging – Start of main() ۽Ӧਸ ࢶఖ оמೞѱ ݅ٚ׮ C/CPP੄ ۽Ӧ ݒ௼۽ Aspect о߸੸ੋ ࣁ޻ب ೲਊ ޙઁ੼੄ ࢿѺਸ ҳ࠙ ੌҙࢿ ੤ࢎਊೡ ࣻ ੓ח ۽Ӧਸ ࢤࢿ

Slide 6

Slide 6 text

C/CPP Macro Log int _tmain(int argc, _TCHAR* argv[]) { logFunc = (LOG_OUTPUT_FUNC) printf; int size = 10; SetPrintableModule(LOG_MODULE_UI, 1); LOG_DEBUG(LOG_MODULE_UI, ("size = %d", size)); return 1; }

Slide 7

Slide 7 text

Log Library ۽Ӧ੄ ױ੼ਸ ӓࠂ ಴ળ ഋधࢎਊ ੹ਊ ࠭য ૑ਗ ۽Ӓ য়ߡ೻٘ ઴੐ ࠺زӝ ۽Ӓ Windows Service, remote socket ۽Ӓ ۨ߰ ۽Ӓ ২࣌ ૑ਗ ੌҙػ ੋఠಕ੉झ ઙܨ Log4XXX NT Event Log DarkLog

Slide 8

Slide 8 text

Log4XXX Apache Logging Service ׮নೠ ঱য, ജ҃ ૑ਗ CPP, JAVA, .NET, Peal, PHP, PLSQL, JDK 1.4’s util.logging.framwork ౠ૚ Logger hierarchy com.fooܳ ࢚ࣘ߉਷ com.foo.Bar log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("com.foo")); log4cxx::LoggerPtr barlogger(Logger::getLogger(("com.foo.Bar")); Log Level Appender console, file, gui component, remote socket, NT event log, syslog Asynchronous log Layout Environment File INI, XML ੹ਊ࠭য ChainSaw TraceTool 8

Slide 9

Slide 9 text

Log4XXX (Con’t)

Slide 10

Slide 10 text

NT Event Log

Slide 11

Slide 11 text

DarkView Concept Server Server Server Server Server log aggregater (windows service) darkview log data remote
 socket i/o query

Slide 12

Slide 12 text

DarkView (Con’t)

Slide 13

Slide 13 text

Aspect पઁ௏٘(ز੘)ܳ ࢸݺ(aspect)ೞח ۽Ӧ (advice)ܳ पઁ ௏٘৬ ܻ࠙ೞৈ ੘ࢿೞৈ ߹ب੄ ஹ౵ੌ۞(ajc)۽ ૞ ֍য (weaving)૓׮. ۽Ӓо प೯ؼ ੢ࣗ, ਤ஖(point cut)ܳ ݺद ೡ ࣻ ੓׮. पઁ ௏٘ী ৔ೱਸ ޷஖૑ ঋਵݴ, ࢶఖ੸ਵ۽ ࢎਊоמೞ Ҋ ੤ࢎਊ੉ ए਍ ࣛܖ࣌

Slide 14

Slide 14 text

Aspect (Con’t) // Shop.java class Article { public void Buy() {// code} } // LogBuy.aj public aspect LogBuy { pointcut buyMethod() : call(public void Article.buy()); before() : buyMethod() { System.out.println(“Entering Article.buy()”);} after() : buyMethod() { System.out.println(“Leaving Article.buy()”);} } // compile $ajc LogBuy.aj Shop.java // Pseudocode class Article { public void Buy() { System.out.println((“Entering Article.buy()”); // Code(); System.out.println((“Leaving Article.buy()”); } }

Slide 15

Slide 15 text

Interactive Debugging Debuggerܳ ࢎਊೞৈ पदрਵ۽ ҙ଴ ੢੼ औѱ द੘ ೡ ࣻ ੓׮. ࣗझ ࣻ੿, ஹ౵ੌ੉ ೙ਃহ੉ ߄۽ ҙ଴ оמ ਬোೠ ҙ଴ ࣻ೯઺ ࣻ੿, ੐੄੄ ؘ੉ఠ ҙ଴ оמ ૊п੸ੋ ࣁ࣌ ૊द ೐۽Ӓ۔ ࢚కܳ द೷೧ ࠁҊ ࡅܰѱ Ѿҗܳ ঳חؘ ੸೤ (gdb੄ command) Debugger੄ ઑѤ ೐۽Ӓ۔ਸ प೯ೞҊ ౠ੿ ઑѤೞী ݥ୶ѱ ೧ঠ ೠ׮. ੿૑ػ ೐۽Ӓ۔੄ ࢚కܳ ҙ଴ оמ೧ঠ ೠ׮. ੿૑ػ ೐۽Ӓ۔੄ ࢚కܳ ߸҃ ೡ ࣻ ੓যঠ ೠ׮.

Slide 16

Slide 16 text

Debugger IDE ӝ߈ Debugger Visual Studio, Eclipse, Ӓ৻ ׮ࣻ ੹ޙ Debugger WinDBG, gdb, Ӓ৻ ׮ࣻ Deugger ӝמ break(breakpoint) and run, watch (watch point), modify variable value, calltrace enc (edit and continue)

Slide 17

Slide 17 text

Visual Studio Debugger Visualization

Slide 18

Slide 18 text

DEMO DDD Visualization

Slide 19

Slide 19 text

Post-mortem Debugging Crashٸ੄ ೐۽Ӓ۔੄ ࢚కܳ ౵ੌ۽ ؒ೐ܳ Debuggerо ׮द ੍য Crash࢚కੌ ٸ੄ ೐۽Ӓ۔ ࢚కܳ ઑࢎ Dumper WinDBG UserDump Dr. Watson Error Reporting Windows Dump API Windows Visual Studio .NET Dump Debugger WinDBG Windows Visual Studio gdb

Slide 20

Slide 20 text

WinDBG

Slide 21

Slide 21 text

Dr. Watson

Slide 22

Slide 22 text

DEMO User Dump

Slide 23

Slide 23 text

Windows Error Reporting

Slide 24

Slide 24 text

Windows Debug Tool ౠ੿ ࢚ടীࢲ ਬਊೞѱ ࢎਊೞח ٣ߡӦ ో GFlag Heap curruption Performance Monitoring hang(dead lock, cpu 100%)

Slide 25

Slide 25 text

DEMO GFlag

Slide 26

Slide 26 text

Performance Monitor

Slide 27

Slide 27 text

FIN