1. 04 Feb, 2018 1 commit
  2. 03 Feb, 2018 1 commit
  3. 02 Feb, 2018 2 commits
  4. 01 Feb, 2018 16 commits
  5. 30 Jan, 2018 1 commit
  6. 29 Jan, 2018 5 commits
  7. 27 Jan, 2018 4 commits
  8. 26 Jan, 2018 2 commits
  9. 25 Jan, 2018 1 commit
  10. 24 Jan, 2018 7 commits
    • Philip Chimento's avatar
      profiler: Reduce API surface · c3a4f694
      Philip Chimento authored
      We actually don't want callers to have control over the lifetime of the
      profiler object. It should be tied entirely to the GjsContext. This makes
      most of the profiler API private.
      Now, to control the profiler, you have two construct-only properties of
      GjsContext: profiler-enabled and profiler-sigusr2. profiler-sigusr2
      implies profiler-enabled, and does the work that
      gjs_profiler_setup_signals() would previously have accomplished. The
      GJS_PROFILER_ENABLED environment variable, if set, overrides the value of
      By default when you call gjs_context_eval(), the profiler will be started
      and stopped automatically around the evaluation of the JS code. If you
      need to call gjs_context_eval() more than once, you probably only want to
      do that within one profiling session. For that case we provide the
      gjs_profiler_start() and gjs_profiler_stop() API, which will prevent the
      auto-starting and stopping.
    • Philip Chimento's avatar
      foreign: Use gjs_eval_with_scope() instead of public API · 43e11fcd
      Philip Chimento authored
      It was probably a bad idea already to use the public gjs_context_eval()
      API to import the foreign cairo module, since it didn't handle the GError
      in the error case.
      Now, since we intend to run the profiler from the public API point, it's
      a bad idea to use it internally. Use gjs_eval_with_scope() instead.
    • Philip Chimento's avatar
      profiler: Always activate profiler if GJS_ENABLE_PROFILER=1 · f8528da4
      Philip Chimento authored
      This checks in gjs_context_eval() to see if the GJS_ENABLE_PROFILER
      environment variable is set but no profiler has been created. In that
      case, we run a profiler for the duration of the JS code evaluation.
      This is to accommodate applications such as Polari that are written in JS
      but ship their own loader that links to libgjs and calls
      gjs_context_eval(). This way, they can be profiled without writing any
      extra code in their loaders (though they will still need it if, for
      example, they want to add a command line argument.)
    • Philip Chimento's avatar
      profiler: Allow configuring with --disable-profiler · 9424ffa2
      Philip Chimento authored
      We check for the existence of timer_settime() with some M4 macros from
      gnulib. These POSIX APIs are required for building the profiler.
      Allow disabling the profiler with a configure switch. This keeps the API
      (and its preconditions as much as possible) but makes it a no-op and
      prints an informational message at runtime on attempted use. We also
      leave out the sysprof writer code and skip the profiler tests if the
      profiler is not being built.
    • Philip Chimento's avatar
      profiler: Suppress cppcheck warning · 12b5a8f9
      Philip Chimento authored
      The cppcheck program will warn about alloca() even though there's no
      equivalent alternative in C++. I don't think there's necessarily a better
      way to do this, so we suppress the warning and add a justification.
    • Philip Chimento's avatar
      profiler: Disable SIGUSR2 start/stop · a824659f
      Philip Chimento authored
      The gjs_profiler_setup_signals() API is still available for code
      embedding GJS that wants this, but we want it disabled by default in the
    • Philip Chimento's avatar
      profiler: Disable profiler in interactive mode · dc7feb11
      Philip Chimento authored
      It doesn't make sense to run the profiler while we're spending most of
      the time waiting for command input anyway.