1. 01 Nov, 2018 1 commit
    • Chris Redpath's avatar
      trappy/cache: Store the csv in utf-8 charset explicitly · f3d6e3db
      Chris Redpath authored
      
      
      When we load the files from trace-cmd output, we explicitly choose
      to load them using utf-8. This means we may have characters in
      our trace which cannot be represented in ascii, which makes pandas
      upset when we try to store the parsed dataframes in the csv cache.
      
      This is not an issue for Python3 versions, as the to_csv method
      defaults to utf-8, whilst the Python2 to_csv method defaults to
      ascii.
      
      Signed-off-by: Chris Redpath's avatarChris Redpath <chris.redpath@arm.com>
      f3d6e3db
  2. 28 Sep, 2018 3 commits
  3. 27 Sep, 2018 3 commits
  4. 20 Sep, 2018 1 commit
    • Douglas Raillard's avatar
      ftrace: fix __getattr__ implementation · 836d6438
      Douglas Raillard authored
      Since __getattr__ can be called on uninitialized instances (i.e. with no
      attributes), it can enter an infinite recursion while trying to access
      some instance attributes.
      
      Fix that by ignoring requests for dunder names (__XXX__), since they are
      resolved without __getattr__ when needed by a builtin, and are mostly
      supposed to be class attributes in other cases. That means __getattr__
      is not supposed to receive requests to such names often, and these will
      (almost) surely not be anything the API can offer since usage of such
      names is reserved for future expansion of the language.
      836d6438
  5. 14 Sep, 2018 1 commit
  6. 07 Sep, 2018 3 commits
  7. 06 Sep, 2018 1 commit
  8. 05 Sep, 2018 17 commits
  9. 04 Sep, 2018 1 commit
  10. 03 Sep, 2018 3 commits
    • Brendan Jackman's avatar
      trappy: Add support for fall-back behaviour for 'print:' event · 2d8e4854
      Brendan Jackman authored and Douglas Raillard's avatar Douglas Raillard committed
      This is just like tracing_mark_write but with a different name. It
      poses a minor difficulty as its name is a Python 2 keyword (so
      'ftrace.print.data_frame' is a syntax error) - this is solved by
      appending an underscore to the name, as suggested by PEP8.
      
      A base class is added which encapsulates the fallback behaviour for
      both tracing_mark_write and print.
      2d8e4854
    • Brendan Jackman's avatar
      GenericFTrace: Fix overwriting of events in 'all' scope · 9b0ee935
      Brendan Jackman authored and Douglas Raillard's avatar Douglas Raillard committed
      Currently if you specify an event in the `events` by the `name` attribute of its
      parser class, __add_events will add that name to the class_definitions dict. For
      events in the 'thermal' and 'sched' scopes, that is then overwritten, but for
      events in the dynamic_classes dict (where scope='all'), this is not the
      case. That means that a specialised event parser class will be replaced with a
      basic dynamic parser. Fix that by checking the 'name' field in known_events.
      9b0ee935
    • Brendan Jackman's avatar
      GenericFTrace: Add warning for accessing wrong attribute · 3dc59c94
      Brendan Jackman authored and Douglas Raillard's avatar Douglas Raillard committed
      We used to have a bug where when you had a known event whose 'name'
      attribute != its 'unique_word', and you specified it explicitly in the
      'events' param, we had two attributes - one for the 'name' and one for
      the 'unique_word', and it was undefined which would be populated.
      Now we just have the attribute from the 'name'. If there is any code
      out there that was relying on this bug (i.e. accessing the
      'unique_word' atribute), this will tell them what they need to do to
      fix their code.
      
      Co-author: Douglas Raillard <douglas.raillard@arm.com>
      3dc59c94
  11. 21 Aug, 2018 2 commits
    • Brendan Jackman's avatar
      GenericFTrace: Add warning for duplicate parser classes · ee56bfc3
      Brendan Jackman authored and Douglas Raillard's avatar Douglas Raillard committed
      If we have a bug like this we should give up and fix the bug before
      trying to do anything else, otherwise things will break in
      desperately confusing ways.
      ee56bfc3
    • Brendan Jackman's avatar
      GenericFTrace: Use event parser 'name' to index class_definitions · 6e370cfe
      Brendan Jackman authored and Douglas Raillard's avatar Douglas Raillard committed
      [1] Event parser objects are stored in the
      per-scope (i.e. sched/thermal/dynamic) dicts at import time via
      register_parser. These dicts are keyed using the 'name' attribute of
      the event parsers.
      
      [2] During trace construction the class_definitions attribute is
      initially created from the per-scope objects created in [1].
      
      [3] Then, for each event requested by the 'events' parameter, the
      event class is added to class_definitions (they may already be
      present, having been added in [2], in which case this _should_ be a
      nop).
      
      Some event classes may have a `name` that is different from the actual
      event name that is printed in the trace (i.e. `unique_word`), for
      example the 'print' event is parsed by a parser class (to be added)
      whose 'name' is 'print_' in order to avoid keyword collisions. Since
      step [1] currently uses `name` to index class_definitions but
      step [3] uses the actual printed event name (i.e. `unique_word`), the
      expected no-op I mentioned above actually results in two instances of
      the same event parser being present in class_definitions.
      
      This leads to missing data, where one instance of the event parser
      has a populated DataFrame and the other does not, and causes great
      angst, woe and distress in developers.
      
      So instead always use `name` to index class_definitions.
      
      This bug was being taken advantage of by the systrace/sched tests -
      the sched_contrib_scale_f event is currently parsed by the
      SchedContribScaleFactor dynamic ftrace class, whose 'name'
      attribute (set via trappy.dynamic._get_name) is currently
      sched_contrib_scale_factor but whose uniqe_word is
      sched_contrib_scale_f. Therefore ftrace objects haave an attribute
      with both names. With this commit, the 'sched_contrib_scale_f'
      attribute is removed, so the test is updated to use
      'sched_contrib_scale_factor'
      6e370cfe
  12. 18 Jun, 2018 4 commits