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
  • !3510

Adds optional '-logprefix' command line option to drcov

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/gaasedelen/master into master Apr 04, 2019
  • Overview 5
  • Commits 3
  • Pipelines 0
  • Changes 4

Created by: gaasedelen

TL;DR

This PR adds an optional -logprefix command line toggle to the drcov tool.

By default, drcov will prefix log files with 'drcov', eg drcov.ls.57735.0000.proc.log. The addition of this command line option allows users to change the prefix to a string of their choosing. This can be used to build a clear relationship between which invocation produced which log file.

Problem Usecase

A growing number of DynamoRIO users have been integrating drcov into their fuzzing and instrumentation workflows. A common nuisance among these users is that there isn't a great way for a fuzz harness (or anything) that wraps drcov to specify an output filename for the coverage log.

As a result, it can be difficult to correlate which fuzzed input testcase generated which log after the fact with any certainty.

doom@upwn64:~/projects/dynamorio/testing$ ../build/bin64/drrun -t drcov -- /bin/ls /what/the/fuzz
/bin/ls: cannot access '/what/the/fuzz': No such file or directory

doom@upwn64:~/projects/dynamorio/testing$ ../build/bin64/drrun -t drcov -- /bin/ls .
drcov.ls.57735.0000.proc.log  drcov.ls.57736.0000.proc.log

doom@upwn64:~/projects/dynamorio/testing$ ls -al
total 80
drwxrwxr-x  2 doom doom  4096 Apr  4 14:21 .
drwxrwxr-x 14 doom doom  4096 Apr  4 13:57 ..
-rw-rw----  1 doom doom 37465 Apr  4 14:21 drcov.ls.57735.0000.proc.log
-rw-rw----  1 doom doom 32505 Apr  4 14:21 drcov.ls.57736.0000.proc.log

Which log is which? Obviously, this becomes increasingly tedious when there are tens of thousands of executions / logs being generated simultaneously.

Example Usage

The example below demonstrates the usage of the new -logprefix option:

doom@upwn64:~/projects/dynamorio/testing$ ../build/bin64/drrun -t drcov -- /bin/ls
1.txt  2.txt  drcov.ls.57606.0000.proc.log

doom@upwn64:~/projects/dynamorio/testing$ ../build/bin64/drrun -t drcov -logprefix "testcase_123" -- /bin/ls
1.txt  2.txt  drcov.ls.57606.0000.proc.log  testcase_123.ls.57609.0000.proc.log

doom@upwn64:~/projects/dynamorio/testing$ ls -al
total 76
drwxrwxr-x  2 doom doom  4096 Apr  4 13:58 .
drwxrwxr-x 14 doom doom  4096 Apr  4 13:57 ..
-rw-rw-r--  1 doom doom     0 Apr  4 13:57 1.txt
-rw-rw-r--  1 doom doom     7 Apr  4 13:57 2.txt
-rw-rw----  1 doom doom 32041 Apr  4 13:58 drcov.ls.57606.0000.proc.log
-rw-rw----  1 doom doom 32201 Apr  4 13:58 testcase_123.ls.57609.0000.proc.log

Additional Comments

Most users would prefer the ability to specify a static / known log filename. But being able to change the log file prefix seemed like a fair compromise and the path of least resistance for the existing codebase.

I am open to alternative solutions, but would like to see a change like this integrated in one form or another.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/gaasedelen/master