Skip to content
Snippets Groups Projects
  1. Sep 19, 2017
    • Greg Kurz's avatar
      checkpatch: add hwaddr to @typeList · 825bfa00
      Greg Kurz authored
      
      The script doesn't know about all possible types and learn them as
      it parses the code. If it reaches a line with a type cast but the
      type isn't known yet, it is misinterpreted as an identifier.
      
      For example the following line:
      
          foo = (hwaddr) -1;
      
      results in the following false-positive to be reported:
      
      ERROR: spaces required around that '-' (ctx:VxV)
      
      Let's add this standard QEMU type to the list of pre-known types.
      
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Message-Id: <150538015789.8149.10902725348939486674.stgit@bahia.lan>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      825bfa00
    • Daniel P. Berrangé's avatar
      scripts: let checkpatch.pl process an entire GIT branch · 8e1fe175
      Daniel P. Berrangé authored
      
      Currently before submitting a series, devs should run checkpatch.pl
      across each patch to be submitted. This can be automated using a
      command such as:
      
        git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'
      
      This is rather long winded to type, so this patch introduces a way
      to tell checkpatch.pl to validate a series of GIT revisions.
      
      There are now three modes it can operate in 1) check a patch 2) check a source
      file, or 3) check a git branch.
      
      If no flags are given, the mode is determined by checking the args passed to
      the command. If the args contain a literal ".." it is treated as a GIT revision
      list. If the args end in ".patch" or equal "-" it is treated as a patch file.
      Otherwise it is treated as a source file.
      
      This automatic guessing can be overridden using --[no-]patch --[no-]file or
      --[no-]branch
      
      For example to check a GIT revision list:
      
          $ ./scripts/checkpatch.pl master..
          total: 0 errors, 0 warnings, 297 lines checked
      
          b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 182 lines checked
      
          2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 102 lines checked
      
          11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.
      
      If a genuine patch filename contains the characters '..' it is
      possible to force interpretation of the arg as a patch
      
        $ ./scripts/checkpatch.pl --patch master..
      
      will force it to load a patch file called "master..", or equivalently
      
        $ ./scripts/checkpatch.pl --no-branch master..
      
      will simply turn off guessing of GIT revision lists.
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170913091000.9005-1-berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8e1fe175
    • Roman Kagan's avatar
      update-linux-headers: prepare for hyperv.h removal · 40bf8e9a
      Roman Kagan authored
      
      All definitions related to Hyper-V emulation are now taken from the QEMU
      own header, so the one imported from the kernel is no longer needed.
      
      Unfortunately it's included by kvm_para.h.
      
      So, until this is fixed in the kernel, teach the header harvesting
      script to substitute kernel's hyperv.h with a dummy.
      
      Signed-off-by: default avatarRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-3-rkagan@virtuozzo.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      40bf8e9a
  2. Sep 18, 2017
  3. Sep 15, 2017
  4. Sep 07, 2017
  5. Sep 05, 2017
  6. Sep 04, 2017
  7. Sep 01, 2017
    • Eduardo Habkost's avatar
      qapi: Fix error handling code on alternate conflict · fda72ab4
      Eduardo Habkost authored
      
      The conflict check added by commit c0644771 ("qapi: Reject
      alternates that can't work with keyval_parse()") doesn't work
      with the following declaration:
      
        { 'alternate': 'Alt',
          'data': { 'one': 'bool',
                    'two': 'str' } }
      
      It crashes with:
      
        Traceback (most recent call last):
          File "./scripts/qapi-types.py", line 295, in <module>
            schema = QAPISchema(input_file)
          File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 1468, in __init__
            self.exprs = check_exprs(parser.exprs)
          File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 958, in check_exprs
            check_alternate(expr, info)
          File "/home/ehabkost/rh/proj/virt/qemu/scripts/qapi.py", line 830, in check_alternate
            % (name, key, types_seen[qtype]))
        KeyError: 'QTYPE_QSTRING'
      
      This happens because the previously-seen conflicting member
      ('one') can't be found at types_seen[qtype], but at
      types_seen['QTYPE_BOOL'].
      
      Fix the bug by moving the error check to the same loop that adds
      new items to types_seen, raising an exception if types_seen[qt]
      is already set.
      
      Add two additional test cases that can detect the bug.
      
      Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170717180926.14924-1-ehabkost@redhat.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      fda72ab4
  8. Aug 30, 2017
  9. Aug 15, 2017
    • Stefan Hajnoczi's avatar
      simpletrace: fix flight recorder --no-header option · 840d8351
      Stefan Hajnoczi authored
      
      The simpletrace.py script can pretty-print flight recorder ring buffers.
      These are not full simpletrace binary trace files but just the end of a
      trace file.  There is no header and the event ID mapping information is
      often unavailable since the ring buffer may have filled up and discarded
      event ID mapping records.
      
      The simpletrace.stp script that generates ring buffer traces uses the
      same trace-events-all input file as simpletrace.py.  Therefore both
      scripts have the same global ordering of trace events.  A dynamic event
      ID mapping isn't necessary: just use the trace-events-all file as the
      reference for how event IDs are numbered.
      
      It is now possible to analyze simpletrace.stp ring buffers again using:
      
        $ ./simpletrace.py trace-events-all path/to/ring-buffer
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170815084430.7128-3-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      840d8351
    • Stefan Hajnoczi's avatar
      trace: use static event ID mapping in simpletrace.stp · d6b76d68
      Stefan Hajnoczi authored
      
      This is a partial revert of commit
      7f1b588f ("trace: emit name <-> ID
      mapping in simpletrace header"), which broke the SystemTap flight
      recorder because event mapping records may not be present in the ring
      buffer when the trace is analyzed.  This means simpletrace.py
      --no-header does not know the event ID mapping needed to pretty-print
      the trace.
      
      Instead of numbering events dynamically, use a static event ID mapping
      as dictated by the event order in the trace-events-all file.
      
      The simpletrace.py script also uses trace-events-all so the next patch
      will fix the simpletrace.py --no-header option to take advantage of this
      knowledge.
      
      Cc: Daniel P. Berrange <berrange@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170815084430.7128-2-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      d6b76d68
  10. Aug 01, 2017
    • Vladimir Sementsov-Ogievskiy's avatar
      checkpatch: check trace-events code style · c3e5875a
      Vladimir Sementsov-Ogievskiy authored
      
      According to CODING_STYLE, check that in trace-events:
      1. hex numbers are prefixed with '0x'
      2. '#' flag of printf is not used
      3. The exclusion from 1. are period-separated groups of numbers
      
      Signed-off-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20170731160135.12101-4-vsementsov@virtuozzo.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      c3e5875a
    • Stefan Hajnoczi's avatar
      trace: add TRACE_<event>_BACKEND_DSTATE() · 3932ef3f
      Stefan Hajnoczi authored
      
      QEMU keeps track of trace event enabled/disabled state and provides
      monitor commands to inspect and modify the "dstate".  SystemTap and
      LTTng UST maintain independent enabled/disabled states for each trace
      event, the other backends rely on QEMU dstate.
      
      Introduce a new per-event macro that combines backend-specific dstate
      like this:
      
        #define TRACE_MY_EVENT_BACKEND_DSTATE() ( \
            QEMU_MY_EVENT_ENABLED() || /* SystemTap */ \
            tracepoint_enabled(qemu, my_event) /* LTTng UST */ || \
            false)
      
      This will be used to extend trace_event_get_state() in the next patch.
      
      [Daniel Berrange pointed out that QEMU_MY_EVENT_ENABLED() must be true
      by default, not false.  This way events will fire even if the DTrace
      implementation does not implement the SystemTap semaphores feature.
      
      Ubuntu Precise uses lttng-ust-dev 2.0.2 which does not have
      tracepoint_enabled(), so we need a compatibility wrapper to keep Travis
      builds passing.
      --Stefan]
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-id: 20170731140718.22010-2-stefanha@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      
      fixup! trace: add TRACE_<event>_BACKEND_DSTATE()
      3932ef3f
    • Daniel P. Berrangé's avatar
      trace: ensure unique function / variable names per .stp file · ea1ff54f
      Daniel P. Berrangé authored
      
      The simpletrace compatibility code for systemtap creates a
      function and some global variables for mapping to event ID
      numbers. We generate multiple -simpletrace.stp files though,
      one per target and systemtap considers functions & variables
      to be globally scoped, not per file. So if trying to use the
      simpletrace compat probes, systemtap will complain:
      
       # stap -e 'probe qemu.system.arm.simpletrace.visit_type_str { print( "hello")}'
       semantic error: conflicting global variables: identifier 'event_name_to_id_map' at /usr/share/systemtap/tapset/qemu-aarch64-simpletrace.stp:3:8
              source: global event_name_to_id_map
                             ^
       identifier 'event_name_to_id_map' at /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:3:8
              source: global event_name_to_id_map
                             ^
      
       WARNING: cross-file global variable reference to identifier 'event_name_to_id_map' at /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:3:8 from: identifier 'event_name_to_id_map' at /usr/share/systemtap/tapset/qemu-aarch64-simpletrace.stp:8:21
       source:     if (!([name] in event_name_to_id_map)) {
                                   ^
       WARNING: cross-file global variable reference to identifier 'event_next_id' at /usr/share/systemtap/tapset/qemu-system-arm-simpletrace.stp:4:8 from: identifier 'event_next_id' at :9:38
       source:         event_name_to_id_map[name] = event_next_id
                                                    ^
      
      We already have a string used to prefix probe names, so just
      replace '.' with '_' to get a function / variable name prefix
      
      Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
      Message-id: 20170728133657.5525-1-berrange@redhat.com
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      ea1ff54f
  11. Jul 31, 2017
  12. Jul 24, 2017
  13. Jul 20, 2017
  14. Jul 19, 2017
  15. Jul 17, 2017
Loading