高级检索

    基于已有实例的Linux驱动程序前向移植接口补丁推荐

    Recommending Interface Patches for Forward Porting of Linux Device Drivers Based on Existing Instances

    • 摘要: Linux内核版本频繁升级对驱动程序带来的关联影响程度和影响范围都很大,为了修复这种关联影响带来的驱动程序调用内核接口的不一致性错误,不断修改旧版本驱动代码进行前向移植是一个持续和紧迫的问题.驱动演化辅助理解、驱动移植中间库辅助适配和驱动移植辅助信息等方面的已有研究,通过检索语句级别的辅助信息提高了驱动移植的效率.但是已有方法仅关注了检索辅助信息本身却并没有区分其中包含的有效补丁素材,因此还需要人工分析和手工构造适配性补丁.为了克服上述限制,提出了一种全新的方法旨在推荐驱动前向移植中接口错误的高质量补丁.观察发现,依赖相同内核接口服务的多个不同驱动程序之间存在相同或相似的内核接口调用,内核版本升级后其他驱动的历史开发信息中可能存在这种复用接口及其使用变更的已有实例代码.利用出错接口语句和相似已有实例的共性分析错误问题的特点,通过已有实例的辅助作用抽取针对性的接口修改方式和修改内容等细粒度素材生成待推荐补丁.具体结合分界点识别、相似度计算、细粒度差异比较和频度计算确定有效修改方式.提出了一种基于已有实例差异特征的分类算法,通过区分修改内容的不同类型分别从2种数据源提取.最后使用编辑脚本技术生成推荐补丁列表.在9个不同类型的真实驱动程序上的实验表明,该方法能够推荐驱动移植中7类接口错误补丁,有效补丁占比约67.4%,对现有辅助方法形成了有效补充和拓展.

       

      Abstract: The extent and scope of associated impact of Linux kernel version upgraded frequently on the drivers are very large. In order to repair the inconsistency error of the driver calling the kernel interface caused by this related impact, constantly modifying the old version drivers’ codes for forward porting is a continuing and urgent problem. There are existing researches on assistant understanding of driven evolution, assistant adaptation of driver porting middle lib and assistant information of driver porting. The efficiency of driver porting is improved by retrieving assistant information at the statement level. However, the existing methods only focus on retrieving assistant information itself without distinguishing the effective patch materials. Therefore, manual analysis and manual construction of adaptable patches are required. To overcome the above limitations, in this paper we propose a new method to recommend high quality patches for interface errors in drivers forward porting. We observe that: there are the same or similar kernel interfaces’ calls between multiple different drivers that rely on the same kernel interface services, and there may be existing instance codes in the development history of other drivers, which share the same interfaces reuse and interfaces changes after kernel version is upgraded. This paper uses the commonality of the error interface statements and similar existing instances in historical development information to analyze the characteristics of the error problem, and extracts targeted interface modification modes and contents of fine-grained materials to generate patches to be recommended. Specifically, the effective modification modes are determined by combining boundary point identification, similarity calculation, fine-grained difference comparison and frequency calculation. A classification algorithm based on the different characteristics of existing instances is proposed for the first time, by distinguishing the different types of modification contents, then content materials from two data sources are extracted respectively. Finally we use the editing script technology to generate the recommended patches using above materials. Experiment on 9 different types of real drivers shows that this method can recommend for 7 types of interface errors patches in driver porting, and the effective patches account for about 67.4%. Partly, it effectively supplements and expands existing assistant methods for driver porting.

       

    /

    返回文章
    返回