1 / 32

用Windows CE Error Reporting来发现和修正错误

用Windows CE Error Reporting来发现和修正错误. 刘斌 北京数智动力科技有限公司. 议程. Window Error Reporting (WER) 简介 WER 基础架构 在平台中增加 WER 支持 查看 WER 数据 怎样从微软得到 WER 数据 分析与解决崩溃问题. 简介 概念 ?. Windows CE/Mobile Error Reporting a.k.a Watson, Dr. Watson, WER, Error Reporting Windows CE/Mobile 5.0 新特性

hagop
Download Presentation

用Windows CE Error Reporting来发现和修正错误

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 用Windows CE Error Reporting来发现和修正错误 刘斌 北京数智动力科技有限公司

  2. 议程 • Window Error Reporting (WER)简介 • WER 基础架构 • 在平台中增加WER支持 • 查看WER数据 • 怎样从微软得到WER 数据 • 分析与解决崩溃问题

  3. 简介概念? • Windows CE/Mobile Error Reporting a.k.a Watson, Dr. Watson, WER, Error Reporting • Windows CE/Mobile 5.0 新特性 • WER客户端上载crash data到微软服务器 • 捕获System和Application层崩溃 • 微软使用WER数据识别与解决问题 • 与OEMs和ISVs共享WER数据 • 解决问题,提升产品质量

  4. 简介有何益处? • 从用户报告的产品问题中得到有效的数据 • 得到问题的频率和数量 • 根据crash data分析问题 • 根据报告数量决定Bug的优先级 • 为客户提供优秀的产品

  5. 关注关键问题 Unique Problems (Buckets) 简介错误优先级 • 数量 • 严重性

  6. 简介隐私 • 用户决定是否上载 • 用户可以查看上载的内容 • 所有数据将保存在微软管理的安全数据库中 • 符合Federal Trade Commission's Safe Harbor Agreement and EU laws • 目的是修改缺陷,而非跟踪用户

  7. 简介过程

  8. 基础架构设计

  9. 基础架构组件 • 核心组件 • Hd.dll • Osaxst0.dll • 驱动程序组件 • Dwxfer.dll • Dwui.dll • 客户端程序 • Dw.exe • 预估大小 = 110KB (ARM)

  10. 基础架构捕获 • 未处理的异常 • 捕获的三种类型 • Standard MS minidump format • Context (4-64KB) • System (64KB-several MB) • Complete (all physical mem + 64KB) • 使用哪种方法依赖于OEM分配的专有内存 • 推荐300KB RAM

  11. 基础架构界面 – e.g. Pocket PC

  12. 基础架构Headless Devices • 便于配置 • 移除界面组件 • 在注册表中设置NoConsentRequired • Headless 是指没有提示用户的界面 • 隐私问题? • Some devices don’t have privacy issues • If so, opt-in is not an issue • WER要求用户同意隐私条款 • Add the privacy policy to the User license • EULA • Shrink wrap license agreement • On host computer configuration

  13. 基础架构数据上载 • Minidumps为压缩格式 • 使用 HTTPS 连接上载 • 可配置 • 直接使用internet连接 • 通过Active Sync连接 • 如果连接成功 • 文件将被删除 • 如果连接不成功 • 当有建立新的连接时将重试 • Asynchronous – as connections happen

  14. 基础架构Bucketing parameters • Bucketing parameters为 • 应用程序名称, 版本, 时间 • 模块名称, 版本, 时间 • 模块中的偏移 • 所有者应用程序的名称, 版本, 时间 • crash dumps的分组为buckets • 相似的崩溃问题生成相同的bucket • After collecting so many just increment counters

  15. BOOL CaptureDumpFileOnDevice( DWORDdwProcessId, DWORDdwThreadId, LPCWSTRpwzExtraFilesPath ); dwProcessId, dwThreadId 0 = current Otherwise, provide the Id pwzExtraFilesPath Optional Unique folder name (ownership changes) Returns TRUE = successful FALSE = failure, check GetLastError() 为应用程序集成 WER通过程序捕获

  16. 为应用程序集成 WER异常处理 • 处理的异常不引发捕获 • 在异常Filter中生成dump文件 EFaultRepRetVal ReportFault( LPEXCEPTION_POINTERSpep, DWORD dwOpt ); • pep – Pointer to an EXCEPTION_POINTER structure • dwOpt – Reserved and should be zero • Returns • frrvErrNoDW – on error • fvvrOk – successful capture

  17. 为应用程序集成 WER异常处理例程 __try     {         FunctionThatGeneratesAnException();     } __except(ReportFault(GetExceptionInformation(),0), EXCEPTION_EXECUTE_HANDLER)     {         SomeHandlerFunction();     }

  18. 在平台中增加WER功能 • 使用PB建立新平台 • 在平台向导中增加WER功能 • 使用PB修改已有平台 • 从Catalog中增加WER功能 • 使用命令行 • Define the SYSGENs • 分配捕获用专有内存

  19. 在平台中增加WER功能平台向导 • Windows CE Error Reporting(checkbox) • 选择所有组件 • Exception Report Generator • Error Report Transfer Driver • Error Report Control Panel • Report Upload Client • Default is Client Without User Interface • 分配专有内存 • Build 平台

  20. 在平台中增加WER功能Catalog • CoreOS\Windows CE Devices下 • 增加Windows CE Error Reporting组件到平台中 • Exception Report Generator • Error Report Transfer Driver • Error Report Control Panel • Report Upload Client • Report Client User Interface • 分配专有内存 • Build 平台

  21. 在平台中增加WER功能命令行 • 定义环境变量SYSGENs • SYSGEN_WATSON_DMPGEN • SYSGEN_WATSON_XFER • SYSGEN_WATSON_CTPNL • SYSGEN_WATSON_CLIENT • SYSGEN_WATSON_CLIENT_UI • 分配专有内存 • Build 平台

  22. 在平台中增加WER功能专有内存 • 分配专有内存 • 在RAM中 (默认) • Does not persist across cold boots • Set dwNKDrWatsonSize variable in OEMInit() • e.g. for 300 KB dwNKDrWatsonSize = (300 * 1024); • 在 OEM 指定的存储空间中 • Set dwNKDrWatsonSize variable in OEMInit() • OEM must provide the following routines • RAMDrWatsonFlush(void) • RAMDrWatsonClear(void) • RAMDrWatsonRead(DWORD dwOffset, LPVOID pData, DWORD cbSize) • RAMDrWatsonWrite(DWORD dwOffset, LPVOID pData, DWORD cbSize)

  23. 配置设备的注册表 [HKEY_LOCAL_MACHINE\System\ErrorReporting\DumpSettings] "MaxLogFiles"=dword:00000064 "MaxDiskUsage"=dword:000e1000 "UploadClient"="\\windows\\Dw.exe" "ExtraFilesDirectory"="\\windows\\ExtraDumpFiles" "CabDirectory"="\\Windows\\System\\DumpFiles\\CabFiles" "DumpDirectory"="\\Windows\\System\\DumpFiles" "DumpEnabled"=dword:00000001 [HKEY_LOCAL_MACHINE\System\ErrorReporting\UploadSettings] "ManifestConsent"=dword:00000001 "UploadFailedDlg"=dword:00000000 "UploadSucceededDlg"=dword:00000000 "MaxDailyReports"=dword:00000000 "MaxWeeklyReports"=dword:00000000 "DontUpload"=dword:00000000 "NoConsentRequired"=dword:00000000

  24. 分析 WER数据基于设备 • 失去bucketing参数的优势 • Dumps存储在设备上 • 配置为不上载 • 从设备上移出WER数据 • 创建自己的客户程序

  25. 分析 WER数据通过 WinQual • WinQual – Windows Quality Online • http://winqual.microsoft.com • Part of the Windows Logo Program website • You do not have to have a logo • 条件 • Code Signing VerisignID Certificate • Sign Term of Use agreement (TOU) • File mapping • 要求反馈 • Close the loop with customers

  26. 分析 WER数据Debugging • Platform Builder Kernel Debugger • Postmortem debugger missed Windows CE 5.0 • Power tools • UIDumpView.exe • http://download.microsoft.com/download/7/8/4/784bf4d2-2a21-416f-b495-1fd0f2340e3b/UIDumpViewer.exe • Matching binaries and sources are required • WinQual • Microsoft Symbol server

  27. Debugging The crash

  28. 总结 • 容易增加WER • 可以通过WinQual直接存取数据 • 便于发现崩溃问题 • 创造成功产品

  29. Tools & Resources Build Develop Websites msdn.microsoft.com/embedded msdn.microsoft.com/mobility Newsgroups microsoft.public.pocketpc.developer smartphone.developer dotnet.framework.compactframework microsoft.public.windowsxp.embedded windowsce.platbuilder windowsce.embedded.vc Blogs blogs.msdn.com/mikehall blogs.msdn.com/windowsmobilevsdteamnetcfteam Tools Windows CE 5.0 Eval KitWindows XP Embedded Eval Kit Windows Mobile 5.0 Eval Kit

  30. 大会注意事项 请在课程结束后填写课程培训反馈表,参加抽奖。 请填写资料袋内的蓝色大会满意度反馈表,到大会接待台领取 《Windows Mobile手机应用开发》工具书。 您还可以: 参加Windows Mobile动手实验室; 参观微软及合作伙伴展区; 体验基于 Windows Mobile平台开发的最新硬件产品及解决方案。

More Related