1. 10 Apr, 2018 1 commit
    • Florian Hahn's avatar
      Use cc to drive cpp and assembler (WIP) · 8dfe3904
      Florian Hahn authored
      The advantages of letting the compiler drive preprocessing and
      assemblying are
       * we do not have to look for cpp or the assembler
       * we can use COMPILE_OPTIONS to pass through options to the assembler
       * we can use Clang's assembler
      
      Issues:
      * Clang's preprocessor does not seem to preserve whitespaces as
        required
      * Clang's assembler does not support flags we need (maybe there
        are equivalent flags we have to use)
      * Clang does not show assembler help with -Wa,-help.
      
      Fixes #1675
      
      Change-Id: I8ae45c39f071853cb95744d551993aba38faec1c
      8dfe3904
  2. 09 Apr, 2018 1 commit
  3. 07 Apr, 2018 2 commits
    • Derek Bruening's avatar
      i#511 drreg: do not fail on xax-vs-aflags conflicts (#2915) · 9a9df6b1
      Derek Bruening authored
      Adds support for several conflicts between aflags and xax on x86: failing
      to reserve xax due to lazy aflags still residing in xax; failing to reserve
      aflags if xax is taken; and failing to get the app aflags value if xax is
      taken.  For the first one, we throw away the lazy aflags.  For the other
      two, we reserve a temporary scratch register, xchg it with xax, and restore
      it afterward.  We place aflags in TLS and do not try to keep it in a
      register.
      
      Issue: #511
      9a9df6b1
    • Derek Bruening's avatar
      i#2913: fix drutil regression on far refs (#2914) · ceecf81c
      Derek Bruening authored
      Fixes a regression from f6e8e1c4 where drutil_insert_get_mem_addr() gets
      the wrong address for a far memref that uses the destination register, due
      to improper ordering of operations.
      
      Also optimizes from two steps to one for a far memref that uses the
      destination but not the scratch register and has only one of base or index.
      
      Fixes #2913
      ceecf81c
  4. 06 Apr, 2018 1 commit
    • Derek Bruening's avatar
      i#2910: support drreg use during process init (#2911) · 65550699
      Derek Bruening authored
      Adds static TLS data to support drreg routines being called during process
      init before thread init has happened.
      
      Also adds support for drmgr_current_bb_phase(), which is called by drrreg,
      being called during process init.
      
      Adds a test case to drreg-test.
      
      Fixes #2910
      65550699
  5. 24 Mar, 2018 1 commit
  6. 23 Mar, 2018 2 commits
  7. 22 Mar, 2018 1 commit
  8. 20 Mar, 2018 1 commit
    • Derek Bruening's avatar
      i#2037 re-walk-maps: refactor to share main walk with re-walk (#2887) · 8471d5cc
      Derek Bruening authored
      Refactors find_executable_vm_areas() to share its map entry skipping with
      the re-takeover re-walk from b06a7022, but not its module list or
      executable area updates.  This entry skipping for vmheap turns out to make
      a big performance difference when attaching.
      
      Removes individual updates to memcache for entries inside vmheap which were
      already bulk-added for the find_executable_vm_areas() walk.
      
      Issue: #2037
      8471d5cc
  9. 15 Mar, 2018 2 commits
    • Derek Bruening's avatar
      i#140 pcprof: add client pc sampling support (#2883) · ce3a9f40
      Derek Bruening authored
      Added dr_where_am_i() to better support client self-profiling via
      sampling.  This also provides the fragment tag, by refactoring
      the pcprofile code into a new helper fcache_refine_whereami().
      
      Renamed the whereami types to better avoid name conflicts:
      s/WHERE_xxx/DR_WHERE_xxx/ and s/where_am_i_t/dr_where_am_i_t/.
      Exported the dr_where_am_i_t enum.
      
      Fixed a bug where an uninitialized mcontext was passed to a
      client timer callback: we only filled in the mcontext for a
      DR-internal callback.
      
      Added a test of client sampling to client.timer
      
      Issue: #140
      ce3a9f40
    • John F.X. Galea's avatar
      i#2833 user data: add syscall events with user data (#2879) · 3f2dd1d9
      John F.X. Galea authored
      Adds new versions of drmgr's pre and post syscall events that take in user data parameters.
      Adds tests of the new functions.
      
      Issue: #2833
      3f2dd1d9
  10. 08 Mar, 2018 1 commit
  11. 07 Mar, 2018 5 commits
    • Derek Bruening's avatar
      Fix raw2trace ignoring of error (#2878) · f0a1f282
      Derek Bruening authored
      Adds a missing error capture in raw2trace_t::read_and_map_modules() where
      an error in module parsing was accidentally ignored.
      f0a1f282
    • Derek Bruening's avatar
      i#2092 burst_threads test: reduce flakiness (#2877) · f2d3fa2d
      Derek Bruening authored
      Allows for zero data or instruction refs on a core and thus no printed miss
      rate, to reduce flakiness in the burst_threads test.
      
      Issue: #2092
      f2d3fa2d
    • Derek Bruening's avatar
      i#2037: update memcache on re-takeover and query miss (#2870) · b06a7022
      Derek Bruening authored
      Adds a complete maps file walk to update the memcache on re-taking-over the
      process for dr_api_start.  The memcache is cleared beforehand to avoid both
      false positives and negatives in later queries.  This helps to solve issues
      with a gap between dr_app_setup() and dr_app_start().
      
      Does not update the executable areas or module list: they are more
      difficult to re-walk, and existing lazy updates to those will suffice for
      now, with a low risk of false positives.
      
      Adds updating of the memcache on a query miss.  Previously we would just
      continue to miss and walk the maps file every time.
      
      Tested manually by disabling the i#2114 change so that a signal does a
      query, adding signals to the burst_threads test, and calling dr_app_setup()
      before creating the test's threads, causing queries to miss when delivering
      signals.  It is difficult to create a regression test for this as the
      consequences are performance degradations rather than correctness, and
      these degradations only really show up at scale with hundreds of threads
      whose missing stacks are queried at once with no caching.
      
      Fixes #2037
      b06a7022
    • Derek Bruening's avatar
      Rename exposed LOG_xxx macros to DR_LOG_xxx (#2875) · 5ed02029
      Derek Bruening authored
      Avoids name conflicts by renaming the LOG_xxx macros to have a DR_ prefix,
      so DR_LOG_xxx.  Puts in place a compatibility CMake option
      DynamoRIO_LOG_COMPATIBILITY that requests the old LOG_xxx macros and
      automatically sets it if the client targets DR version 7.0.0 or older.
      
      Updates all non-core uses of LOG_xxx.
      5ed02029
    • Derek Bruening's avatar
      Splits the changelist: 7.0.0-RC1 is the official 7.0.0 (#2874) · 04b1ea67
      Derek Bruening authored
      Given the time since the RC1 we're retroactively considering it to be an
      official release.  The base version was bumped to 7.0 already in ad850c4c.
      Here we split the changelist.  Additionally I added the missing
      page_drltrace page to match page_drstrace.
      04b1ea67
  12. 06 Mar, 2018 2 commits
  13. 05 Mar, 2018 7 commits
  14. 04 Mar, 2018 4 commits
    • Derek Bruening's avatar
      i#1967 cron builds: Appveyor artifacts (#2863) · f21db3fd
      Derek Bruening authored
      Adds the proper path for our package files to be "artifacts" that can then
      be deployed to GitHub Releases.
      
      Issue: #1967
      f21db3fd
    • Derek Bruening's avatar
      i#1967 cron builds: build package in Appveyor builds · 70041d53
      Derek Bruening authored
      Adds package building in each Appveyor build.
      
      Adds force_update for Appveyor deployment to try and get it in the same
      GitHub Release as Travis.
      
      Issue: #1967
      70041d53
    • Derek Bruening's avatar
      i#1967 cron builds: multiple file uploads · 7a37c24c
      Derek Bruening authored
      Fixes an error in ad850c4c where only the 64-bit package was deployed.
      However, it is not clear that Travis supports deployments from multiple
      parallel jobs, and it is also not clear how racy tagging and deploying is
      going to work.  This is an attempt to see what happens: the 2nd tag may
      fail and abort its deploy.
      
      Sets the GitHub Release title and description.
      Fixes a git diff error on Appveyor tagged builds.
      
      Issue: #1967
      7a37c24c
    • Derek Bruening's avatar
      i#1967 cron builds: set up weekly travis builds (#2862) · ad850c4c
      Derek Bruening authored
      Adds support for Travis builds to produce auto-published package files.
      Each job can create its own package file, using existing support in
      runsuite*.cmake and package.cmake with some additions here to enable and
      tweak that code.  Longer-term we may want to use package.cmake instead and
      even make official builds on Travis (i#2861).
      
      Adds Travis deployment to Github Releases of produced packages files.  The
      tag is "cronbuild-${VERSION_NUMBER}": e.g., "cronbuild-7.0.17592".
      
      Adds Appveyor tag-triggered deployment.
      
      Adds better support for 32-bit-only or 64-bit-only x86 package files by
      naming them differently and removing the drrun warnings on incomplete
      packages when missing the opposite bitwidth.
      
      Adds better build order handling to ensure release build is the default
      for tool files.
      
      Issue: #1967
      ad850c4c
  15. 02 Mar, 2018 1 commit
    • Derek Bruening's avatar
      i#2214 signal locks: avoid memquery when copying signal frame (#2858) · 19029b1a
      Derek Bruening authored
      Eliminates the memory query loop in copy_frame_to_stack() which checks
      whether each part of the app stack is writable before copying over the
      signal frame.  This loop grabs the global all_memory_areas lock and if that
      lookup misses it goes to a maps lookup.  This has shown to cause
      noticeable contention.  Instead we perform an overlap check for
      is_executable_area_writable followed by a TRY_EXCEPT safe write.
      
      Adds a new test linux.bad-signal-stack which tests this by setting up an
      unwritable alternate stack.  It also tests checking for SA_ONSTACK, and we
      fix #2017 here to make that work, which is needed for a good test.  The
      existing security-common.decode-bad-stack hits the
      is_executable_area_writable() case.
      
      Issue: #2214
      Fixes #2017
      19029b1a
  16. 01 Mar, 2018 1 commit
  17. 28 Feb, 2018 1 commit
    • Derek Bruening's avatar
      i#975 static DR: add optional checks for mid-run malloc calls (#2855) · 3bc33154
      Derek Bruening authored
      Adds a feature where a client library can request that the private loader
      complain if malloc & co. are called at any time other than process init or
      exit, to help clients that want to support being linked statically with the
      app.  Because it has to be early, the feature is triggered by a variable
      declaration DR_DISALLOW_UNSAFE_STATIC.  It can be overridden
      dynamically by a new API routine dr_allow_unsafe_static_behavior().
      
      Fixes drcachesim to use placement new for its offline custom module data
      allocations.
      
      Issue: #975, #2006
      3bc33154
  18. 27 Feb, 2018 1 commit
  19. 26 Feb, 2018 3 commits
    • Derek Bruening's avatar
      i#2843 trace cpus: simulate according to traced cpu mappings (#2853) · a51325f9
      Derek Bruening authored
      Adds a new option -cpu_scheduling which schedules trace execution on
      simulated cores to match the new recorded cpu mappings.  The cpu's are
      assigned to cores in a round-robin fashion, and each thread region is assigned
      to the core that owns the cpu in the thread region's header markers.
      
      Adds -cpu_scheduling to several tests with multiple threads.
      
      Adds the documentation for the new option.
      
      Fixes #2843
      a51325f9
    • Derek Bruening's avatar
      i#2006 generalize drcachesim: use structs of knobs (#2851) · 1d000e33
      Derek Bruening authored
      For tools that have many options, passing a long list of parameters is
      cumbersome, error-prone, and difficult to extend with newly added options.
      We change cache_simulator, tlb_simulator, and reuse_distance to use a
      struct of knobs instead.  Tools with just a couple of options are left
      using parameters.
      
      Issue: #2006
      1d000e33
    • Derek Bruening's avatar
      Make the burst_threads test less flaky (#2850) · 923e7496
      Derek Bruening authored
      Adds synchronization to avoid fewer than one thread per core in the
      tool.drcacheoff.burst_threads test, to eliminate flakiness in output
      matching.
      923e7496
  20. 24 Feb, 2018 1 commit
    • Derek Bruening's avatar
      i#2843 trace cpus: add cpu and timestamp trace markers (#2849) · aedf9be2
      Derek Bruening authored
      Adds a timestamp marker and a cpu marker to the trace buffer header for
      each thread's buffer unit output.  The timestamp was already in the raw
      offline trace format, but now it is in the final trace for both offline and
      online as a new marker type.  The cpu is completely new and specifies which
      core that thread executed on at the granularity of the buffer unit.
      
      Refactors the initial and per-output buffer headers to fix warts in the
      tracer: now the initial buffer's timestamp is from output time rather than
      thread init time; the initial header is more cleanly skipped for virt2phys;
      header uses are more normalized and easier to understand.
      
      Updates the basic_counts tool to separate these new scheduling marks from
      kernel transfer and other markers.  Updates the corresponding
      documentation.
      
      A forthcoming change will update the cache simulator to schedule threads
      based on executed cores rather than a thread round-robin scheme.
      
      Issue: #2843
      aedf9be2
  21. 22 Feb, 2018 1 commit
    • Derek Bruening's avatar
      i#2820 trace thread subset: reset callbacks at exit (#2844) · ad2614d4
      Derek Bruening authored
      Resets callback functions at exit to better support re-attach.
      
      Adds re-attach testing to the burst_threads and burst_thread*filter tests.
      
      Adds "firstglob" support to runmulti to post-process only one of the 4
      re-attach traces to keep the tests simpler and faster.
      
      Adds testing of the thread filter callback being reset across re-attach by
      passing in a specific user param.
      
      Issue: #2175, #2820
      ad2614d4