GithubHelp home page GithubHelp logo

patrikaaberg / dmce Goto Github PK

View Code? Open in Web Editor NEW
15.0 15.0 7.0 886 KB

Did My Code Execute - C/C++ source code level tracer

License: MIT License

Shell 36.32% C 16.54% Python 47.14%
c-trace code cpp-trace debug debugger-visualizer debugging-tool delta-coverage dynamic-analysis git heatmap instrumentation performance performance-analysis performance-monitoring static-analysis test-coverage trace

dmce's People

Contributors

alexdura avatar creichen avatar iiandreasii avatar jesperkristiansson avatar mtempling avatar patrikaaberg avatar rickardevertsson avatar rmpers avatar wolverine2k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dmce's Issues

OS error when probing on many files

When trying to probe an OpenJDK version I got a lot of error messages. These error messages was received when trying to probe using dmce-launcher -aq on a directory with many files in it (about 4000 files). This issue could be worked around by increasing the limit of allowed open files, using ulimit -n . Here is a snippet of the error messages received:

Exception in thread Thread-6813:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(self._args, **self._kwargs)
File "/usr/share/dmce/dmce-copy-headers", line 38, in parse_file
fp = open(f)
OSError: [Errno 24] Too many open files: '/home/samuel/Documents/MasterThesis/openJDKTest/jdk17/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetArgumentsSize/argsize001/argsize001.cpp'

Exception in thread Thread-6812:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(self._args, self._kwargs)
File "/usr/share/dmce/dmce-copy-headers", line 38, in parse_file
fp = open(f)
OSError: [Errno 24] Too many open files: '/home/samuel/Documents/MasterThesis/openJDKTest/jdk17/test/hotspot/jtreg/vmTestbase/nsk/jvmti/SetLocalVariable/setlocal001/setlocal001.cpp'

Exception in thread Thread-6815:
Traceback (most recent call last):
File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, self._kwargs)
File "/usr/share/dmce/dmce-copy-headers", line 38, in parse_file
fp = open(f)
OSError: [Errno 24] Too many open files: '/home/samuel/Documents/MasterThesis/openJDKTest/jdk17/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetArgumentsSize/argsize002/argsize002.cpp'

No feedback when running in non-repository directories

Currently, when running dmce in a directory that does not contain a git repository, the user is not given any information about the execution:

not/a/repo$ dmce
not/a/repo$

Proposed output:

not/a/repo$ dmce
error: current directory does not contain a git repository
not/a/repo$

Probes inserted is always 0

I'm unable to insert any probes, following the below steps.

Why is it reporting 'Probes inserted: 0'?

This looks like some very promising work.

Is there a FAQ or support community behind this project?

Thanks,
ksfasf

  1. git clone https://github.com/nyuwireless-unipd/ns3-mmwave.git
  2. dmce-set-profile -v coverage -i sw/mmwave/examples
  3. dmce-launcher -n 2 --progress
    |. . . . . . . . . . . . . . . >|
    |. . . . . . . . . . . . . . . >|
    ===============================================
    git repository /home/dng/ns3-mmwave
    Old SHA-1 0e8842fa (0e8842fa0538a86296532d46dc73059108534b16)
    New SHA-1 HEAD (a402f10160a84d1901145fbcbffc39123ed23ad7)
    Files examined 11
    Files probed 0
    Files skipped 11
    Probes inserted 0
    DMCE version 1.7-1
    ===============================================
    done: real: 0m9.113s user: 0m27.398s sys: 0m1.470s

Invalid coverage % while running some tests...

I have been using DMCE on our code base for running tests daily. We needed to collect historical data so besides running tests daily, I am also running a script that iterates through our git history and runs the tests in an iterative manner on a day-2-day basis.

DMCE runs fine most of the times but we have a scenario where the number of unique probes traversed was more than the actual number of probes resulting into coverage % of 131.4.

Coverage %: 131.4 %
Total Number of Probes: 35
Unique probes: 46
Revisited Probes: 77

Maybe there is a corner case. More details and logs can be provided on request.

Invalid regex matching

The regex expression used in print_summary.py for checking whether a probe is executed or not can also match output errors from the compiler. A proper regex should check if a probe number is printed instead.

i.e.

.DMCE_PROBE((.)).* should be .DMCE_PROBE((\d+)).

I am providing a PR for the same.

DMCE_PROBE instrumentation not semantics-preserving in logical expression with negated lhs

OpenJDK 11u, 2c47c45f0747e86a3b97384bea48107627ffd040:

Instrumenting the following line 102 in src/hotspot/share/oops/objArrayKlass.cpp:

  if (!element_klass->is_instance_klass() ||
      (name = InstanceKlass::cast(element_klass)->array_name()) == NULL) {

leads to the semantically different code below:

  if (!(DMCE_PROBE(25201), element_klass->is_instance_klass() ||
      (name = InstanceKlass::cast(element_klass)->array_name()) == NULL)) {

Ignoring the DMCE_PROBE(), the code above replaces (!a || b) by (!(a || b)), i.e., it negates the entire disjunction rather than just the left-hand side of the ||.

A semantics-preserving replacement would be:

  if (DMCE_PROBE(25201), !element_klass->is_instance_klass() ||
    (name = InstanceKlass::cast(element_klass)->array_name()) == NULL) {

which works as intended.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.