DOI QR코드

DOI QR Code

Design and Implementation of a Dynamic Instrumentation Framework based on Light-weight Dynamic Binary Translation

경량 동적 코드 변환 기법을 이용한 동적 인스트루멘테이션 기법 설계 및 구현

  • 김지홍 (성균관대학교 정보통신대학) ;
  • 이동우 (성균관대학교 정보통신대학) ;
  • 김인혁 (성균관대학교 정보통신대학) ;
  • 엄영익 (성균관대학교 정보통신대학)
  • Received : 2014.08.08
  • Accepted : 2014.09.16
  • Published : 2014.11.15

Abstract

Dynamic binary instrumentation is a code insertion technique for debugging a program without scattering its execution flow, while the program is running. Most dynamic instrumentations are implemented using dynamic binary translation techniques. Existing studies translated program codes dynamically by parsing the machine code stream to intermediate representation (IR) and then applying compilation techniques for IRs. However, they have high overhead during translation, which is a major cause of difficulty in applying the dynamic binary translation technique to the program which requires high responsiveness. In this paper, we introduce a light-weight dynamic binary instrumentation framework based on a novel dynamic binary translation technique which has low overhead while translating the program code. In order to reduce the translation overhead, our approach adopts a tabular-based address translation and exploits a translation bypassing scheme, which stores the translated address of a frequently called library function in advance. It then accesses the translated address and executes function codes without code translation when calling the function. Our experiment results demonstrated that the proposed approach outperforms the prior dynamic binary translation techniques from 2% up to 65%.

동적 인스트루멘테이션 기법은 동적 코드 변환 기법을 사용하여 프로그램의 수행 흐름을 흐트러뜨리지 않으면서 분석 코드를 삽입하는 구현 기법으로 사용되고 있다. 기존의 동적 코드 변환 기법은 머신 코드 스트림을 중간 코드 형태로 파싱하고, 이를 일반적인 컴파일러 기법에 적용함으로써 코드를 변환한다. 이러한 방식의 코드 변환 과정에서 수반되는 높은 변환 오버헤드는 응답성이 높은 사용자 프로그램에 적용을 어렵게 한다. 본 논문에서는 변환 과정의 경량화를 통해 변환 오버헤드를 줄임으로써, 높은 동적 코드 변환 성능을 가지는 경량 동적 코드 변환 기법을 제안하고, 이를 기반으로 하는 동적 인스트루멘테이션 프레임워크를 제안한다. 제안 기법은 테이블 기반의 새로운 동적 주소 변환 기법으로 코드를 변환하고, 더불어 자주 실행되는 라이브러리 함수에 대해 변환 과정에 대해서는 주소 변환만을 함으로써 변환 오버헤드를 줄이는 변환 우회 기법을 이용한다. 기존 동적 코드 변환 기법과의 비교를 통해 2%~65%의 성능 향상을 확인하였다.

Keywords

Acknowledgement

Supported by : 한국연구재단

References

  1. M. Probst, "Dynamic Binary Translation," Proc. of UKUUG Linux Developer's Conference, pp. 1-12, 2002.
  2. M. Probst, "Fast Machine-Adaptable Dynamic Binary Translation," Proc. of the Workshop on Binary Translation, pp. 1-7, 2001.
  3. Y. Choi and J. Choi, "Performance-Aware Embedded Linux kernel Analysis Tool," Journal of KIISE: Computing Practices and Letters, Vol. 17, No. 7, pp. 407-412, Mar. 2011. (in Korean)
  4. D. Bruening, "Efficient, Transparent, and Comprehensive Runtime Code Manipulation," PhD thesis, M.I.T, 2004.
  5. D. bruening, T.Garnett, and S. Amarasinghe, "An Infrastructure for Adaptive Dynamic Optimization," Proc. of Code Generation and Optimization, pp. 265-275, 2003.
  6. C. K. Luk, R. Cohn, R. Muth, H.Patil, A. Klauser, G. Lowney, S. Sallace, V. J. Reddi, and K. Hazelwood, "Pin: Building Customized Program Analysis Tools with Dynamic Instrumentation," Proc. of ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 190-200, 2005.
  7. S. Sridhar, J. S. Shapiro, E. Northup, and P. P. Bungale, "HDTrans: An Open Source, Low-Level Dynamic Instrumentation System," Proc. International Conference on Virtual Execution Envirionments, pp. 175-185, 2006.
  8. M. Payer, and T. R. Gross, "Generating Low-Overhead Dynamic Binary Translators," Proc. of the Annual Haifa Experimental Systems Conference, pp. 1-14, 2010.
  9. J. Kim, I. Kim, and Y, I, Eom, "Light-Weight Dynamic Binary Translation Scheme using Indirection Mechanism," Journal of KIISE: Computing Practices and Letters, Vol. 17, No. 3, pp. 170-174, Mar. 2011. (in Korean)
  10. X. Zhang, X. Gao, Q. Guo, J. Huang, H. Liu, and X. Meng, "VBIW: Optimizing Indirect Branch in Dynamic Binary Translation," Proc. of IEEE International Conference on High Performance Computing and Communications & Embedded and Ubiquitous Computing, pp. 1456-1462, 2013.
  11. P. Kedia, and S. Bansal, "Fast Dynamic Binary Translation for the Kernel," Proc. of ACM Symposium on Operating Systems Principles, pp. 101-115, 2013.
  12. N. Jia, C. Yang, J. Wang, D. Tong, and K. Wang, "SPIRE: Improving Dynamic Binary Translation through SPC-Indexed Indirect Branch Redirecting," Proc. of ACM SIGPLAN/SIGOPS international conference on Virtual Execution Environments, pp. 1-12, 2013.
  13. D. Lee, I. Kim, J. Kim, H. Jun, W. Kim, S. Lee, and Y. I. Eom, "Light-Weight Kernel Instrumentation Framework using Dynamic Binary Translation," Journal of Supercomputing, Vol. 66, No. 3, pp. 1613-1628, 2013. https://doi.org/10.1007/s11227-013-0954-3
  14. V. Bala, E. Duesterwald, and S. Banerjia, "Dynamo: A Transparent Runtime Optimization System," Proc. of the ACM SIGPLAN Conference on Programming Lanuage Design and Implementation, pp. 1-12, 2000.
  15. W. Chen. S. Lerner, R. Chaiken, and D. M. Gillies, "Mojo: A Dynamic Optimization System," Proc. of the ACM Workshop on Feedback-Directed and Dynamic Optimization, pp. 81-90, 2000.
  16. C. Cifuentes, B. Lewis, and D. Ung, "Walkabout: A Retargetable Dynamic Binary Translation Framework," Proc. of the Workshop on Binary Translation, pp. 1-13, 2002.
  17. K. Scott, N. Kumar, S. Velusamy, B. Childers, J. Davidson, and M. L. Soffa, "Reconfigurable and Retargetable Software Dynamic Translation," Proc. of the International Symposium on Code Generation and Optimization, pp. 36-47, 2003.
  18. P. Arafa, H, Kashif, and S. Fischmeister, "DIME: Time-Aware Dynamic Binary Instrumentation using Rate-Based Resource Allocation," Proc. of ACM International Conference on Embedded Software, pp. 25:1-25:10, 2013.