HoppeRx - the cure for your ailing device

本文详细介绍了如何使用AppVerifier工具来监控Windows Mobile设备上开机时加载的进程,包括安装配置步骤、环境变量设置及查找内存泄漏的方法。

How to setup AppVerifier for "Always running" processes

AppVerifier is a very useful tool when it comes to finding memory leaks. It is relatively easy to configure if you have some understanding of how AKU's and PB work. There are pretty comprehensive instructions on MSDN found here. However if you need to use AppVerifier on something that loads during boot time, you need to perform extra steps that are harder to find. The purpose of this article is to explain in a greater detail what you need to do to setup AppVerifier for processes that load at boot time.

Here are simple steps that you need to follow to make AppVerifier work for "Always Running" processes:

1. Install Platform Builder (tools only install is enough because CETK is included with that install), install AKU if you haven't already
2. Open your AKU build window where you build images
3. (Optional) Removed/reset all the security or make sure it's configured properly
4. Copy all the AppVerifier binaries to your %_FLATRELEASEDIR% by running getappverif_cetk.bat from your wcetk directory. 

a. Default is "c:/Program Files/Platform Builder for Windows Mobile/5.00/CEPB/wcetk/DDTK/DESKTOP/getappverif_cetk.bat"
b. Or copy them manually. Here is the list of files needed (AppVerif* shim_*.dll symhlp.dll vlog.dll lmemdebug_autoshim.dll shimeng.dll)
5. Set the environment variables for the modules that need to be shimmed in our case device.exe and the OEM dlls that you want to check
a. Run SET VERIFY_MODULES=device.exe <list the rest of your dlls and exes delimited by spaces>. For example: SET VERIFY_MODULE=device.exe atidrv.dll
6. Set IMGSHIMENABLE=1 if you have set IMGPERSISTENTSTORAGE=1
7. Set VERIFY_OPTIONS=EnableFanOut (read more about options later ion the article)
8. Run makeverifyfile.bat from your WCETK directory (default is at "c:/Program Files/Platform Builder for Windows Mobile/5.00/CEPB/wcetk/DDTK/DESKTOP/makeverifyfile.bat")
9. Run makeimg.exe
10. Make sure that all shim dlls got signed properly
11. Flash the image on to the device
12. Connect the device to KITL and boot it (you don't need KITL but it's much more convenient to have it)
13. To make sure that KITL is connected you should see things like
a. TID:<address> ++Shim autoloader
b. Found shim 'shim_heap.dll'
c. And so on
14. Unfortunately there is no magic bullet that would just show all the memory leaks. The best way to find a leak is to get a snapshot then run user scenarios then get a delta. Here is an example of what can be done:
a. Boot the device
b. Run 'heapverif device.exe chk' (this will create a check point on device.exe)
d. Run 'heapverif device.exe delta' (this will report the potential leaks since the last check point on device.exe)
e. Repeat these steps to find all the leaks

Obtaining the log file

If you are connected with KITL the log file with AppVerifier information can be found in your release directory it should be called something like this
AppVerifier_<ProcessName>_<ProcessIdentifier>.log older versions of AppVerifier might call it VerifierLog_<AppName_<ProcessIdentifier>.log

Published Tuesday, September 26, 2006 12:49 AM by deanmel
可能你想问的是“F1 - confidence curve(F1置信度曲线)” ,以下是查看F1 - confidence curve的一般方法: ### 数据准备 要绘制F1 - confidence curve,需要有模型预测的置信度得分和对应的真实标签。通常在机器学习分类任务中,模型会输出每个样本属于不同类别的概率,这个概率就是置信度得分。同时要准备好这些样本的真实类别标签。 ### 计算不同置信度阈值下的F1分数 根据不同的置信度阈值,将样本划分为正类和负类。对于每个阈值,计算对应的F1分数。F1分数的计算公式为: $$F1 = 2\times\frac{Precision\times Recall}{Precision + Recall}$$ 其中,精确率($Precision$)和召回率($Recall$)的计算公式分别为: $$Precision=\frac{TP}{TP + FP}$$ $$Recall=\frac{TP}{TP+FN}$$ 这里$TP$是真正例的数量,$FP$是假正例的数量,$FN$是假反例的数量。 ### 绘制曲线 使用绘图工具,如Python中的`matplotlib`库,将置信度阈值作为横轴,对应的F1分数作为纵轴,绘制曲线。以下是一个简单的Python示例代码: ```python import numpy as np import matplotlib.pyplot as plt from sklearn.metrics import precision_recall_fscore_support # 假设这是模型预测的置信度得分和真实标签 confidence_scores = np.random.rand(100) true_labels = np.random.randint(0, 2, 100) # 定义一系列置信度阈值 thresholds = np.linspace(0, 1, 100) f1_scores = [] for threshold in thresholds: # 根据阈值将置信度得分转换为预测标签 predicted_labels = (confidence_scores >= threshold).astype(int) # 计算精确率、召回率和F1分数 precision, recall, f1, _ = precision_recall_fscore_support(true_labels, predicted_labels, average='binary') f1_scores.append(f1) # 绘制F1 - confidence curve plt.plot(thresholds, f1_scores) plt.xlabel('Confidence Threshold') plt.ylabel('F1 Score') plt.title('F1 - Confidence Curve') plt.show() ``` ### 解读曲线 通过观察曲线,可以找到使F1分数达到最大值的置信度阈值,这个阈值可以作为模型在实际应用中的最佳决策阈值。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值