Skip to content
  • Daniel P. Berrangé's avatar
    89d0a64f
    log: fix parsing of multiple trace:PATTERN log args · 89d0a64f
    Daniel P. Berrangé authored
    
    
    If giving QEMU a log arg which asks to enable multiple
    different trace event patterns such as
    
      $QEMU -d trace:qio*,trace:qcrypto*
    
    the parser will then invoke
    
      trace_enable_events("qio*,trace:qcrypto*")
      trace_enable_events("qcrypto*")
    
    as when finding a 'trace:' prefix, it is not clever
    enough to strip anything after the next comma. As
    a result only the last 'trace:' match ever works.
    
    Rather than trying to be more clever with parsing the
    command line arg in place, simplify the code by
    using g_strsplit to break it into individual strings
    on ','. These resulting pieces can be directly used
    without worrying about trailing data from the next
    option.
    
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <1473186343-16704-1-git-send-email-berrange@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    89d0a64f
    log: fix parsing of multiple trace:PATTERN log args
    Daniel P. Berrangé authored
    
    
    If giving QEMU a log arg which asks to enable multiple
    different trace event patterns such as
    
      $QEMU -d trace:qio*,trace:qcrypto*
    
    the parser will then invoke
    
      trace_enable_events("qio*,trace:qcrypto*")
      trace_enable_events("qcrypto*")
    
    as when finding a 'trace:' prefix, it is not clever
    enough to strip anything after the next comma. As
    a result only the last 'trace:' match ever works.
    
    Rather than trying to be more clever with parsing the
    command line arg in place, simplify the code by
    using g_strsplit to break it into individual strings
    on ','. These resulting pieces can be directly used
    without worrying about trailing data from the next
    option.
    
    Signed-off-by: default avatarDaniel P. Berrange <berrange@redhat.com>
    Message-Id: <1473186343-16704-1-git-send-email-berrange@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading