Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !5624

i#5505 kernel trace: Add drir2trace to convert DR's IR to trace entries.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open qidongzhao requested to merge i5505-drir2trace into master Aug 23, 2022
  • Overview 29
  • Commits 94
  • Pipelines 0
  • Changes 21

Adds a new module kernel_image to dump kcore's code segments and a new library drir2trace to convert DR's IR to trace entries.

(1) Adds a new module kernel_image to dump kcore's code segments. This module can read '/proc/modules' and '/proc/kallsyms' to get all module's information. Then it bases on the module's information to locate all code segments in '/proc/kcore', dump all code segments to 'kimage', and store all code segment's metadata, such as offset, length, and base, to 'kimage.metadata'.

(2) Updates drpt2ir to support getting raw bits of every instruction from 'kimage' and 'kimage.metadata'. drpt2ir uses two functions to load the kernel code segments. The load_kcore() can get code segments from 'kcore' generated by the Linux perf command. And the load_kernel_image() can get code segments from 'kimage' generated by the kernel_image module.

(3)Updates drpt2trace to support a new working mode: DR Mode. Adds a new option "-mode" to drpt2trace to let the user choose the working mode of drpt2trace. In the current implementation, drpt2trace supports three modes to convert: SIDEBAND Mode(-mode SIDEBAND), ELF Mode(-mode ELF) and DR Mode(-mode DR). And the "DR" mode is used to check whether the syscall PT trace generated by drcachesim is correct.

(4) Adds a new library drir2trace. This library converts DR's IR format to a list of trace_entry_t instances. We only convert DR's IR format to TRACE_TYPE_INSTR type instances in the current implementation.

(5) Updates raw2trace to support PT raw data converting In the current implementation, raw2trace invokes drpt2ir and drir2trace to convert every syscall's PT raw data to a list of trace_entry_t instances. And it writes all these trace_entry_t instances to the trace file.

(6) Updates the test used to check if dr$sim's kernel PT output is correct. In the current implementation, the test executes drcachesim to analyze the output userspace and kernel space trace first, and then it uses drpt2trace to check whether the first syscall's PT raw data is correct.

Issue: #5505

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i5505-drir2trace