From patchwork Mon Feb 19 16:19:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 875205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zlTd24DZgz9ryn for ; Tue, 20 Feb 2018 03:25:42 +1100 (AEDT) Received: from localhost ([::1]:51077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoG3-00008T-V2 for incoming@patchwork.ozlabs.org; Mon, 19 Feb 2018 11:25:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoAn-0004XQ-BU for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoAi-0002ua-Q9 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:13 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40406 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enoAi-0002te-Lf for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:08 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 749AFEAE9B; Mon, 19 Feb 2018 16:20:04 +0000 (UTC) Received: from localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F91A1006EA3; Mon, 19 Feb 2018 16:20:03 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 19 Feb 2018 16:19:53 +0000 Message-Id: <20180219161955.29572-2-stefanha@redhat.com> In-Reply-To: <20180219161955.29572-1-stefanha@redhat.com> References: <20180219161955.29572-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:04 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:04 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/3] tracetool: Update argument format regex to non-greedy star X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Jon Emil Jahren Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jon Emil Jahren Using the greedy star matching, arguments like "...%"PRIx64 caused issues for functions with multiple PRI formats. The issue was only seen with the ust backend, as it is the only one using the format regex. The result for many functions was that the arguments coming after the greedy star end was left out of the tracepoint, and in some cases some of the arguments that was traced had the wrong format. Signed-off-by: Jon Emil Jahren Message-id: 20180129041648.30884-2-jonemilj@gmail.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 1a9733da9a..3646c2b9fc 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -261,8 +261,9 @@ class Event(object): self.name, self.args, fmt) - - _FMT = re.compile("(%[\d\.]*\w+|%.*PRI\S+)") + # Star matching on PRI is dangerous as one might have multiple + # arguments with that format, hence the non-greedy version of it. + _FMT = re.compile("(%[\d\.]*\w+|%.*?PRI\S+)") def formats(self): """List conversion specifiers in the argument print format string.""" From patchwork Mon Feb 19 16:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 875201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zlTWl2YBZz9ryn for ; Tue, 20 Feb 2018 03:21:07 +1100 (AEDT) Received: from localhost ([::1]:51058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoBd-0004Yd-C3 for incoming@patchwork.ozlabs.org; Mon, 19 Feb 2018 11:21:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoAm-0004W0-35 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoAi-0002uX-PY for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:12 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46458 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enoAi-0002tf-ME for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:08 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0017D402314E; Mon, 19 Feb 2018 16:20:06 +0000 (UTC) Received: from localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6CFA2166BAE; Mon, 19 Feb 2018 16:20:05 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 19 Feb 2018 16:19:54 +0000 Message-Id: <20180219161955.29572-3-stefanha@redhat.com> In-Reply-To: <20180219161955.29572-1-stefanha@redhat.com> References: <20180219161955.29572-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 19 Feb 2018 16:20:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 19 Feb 2018 16:20:06 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/3] tracetool: For ust trace bool type as ctf_integer X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi , Jon Emil Jahren Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jon Emil Jahren Previously functions having arguments of type bool was not traced properly. The bool arguments were missing from the trace. Signed-off-by: Jon Emil Jahren Message-id: 20180129041648.30884-3-jonemilj@gmail.com Signed-off-by: Stefan Hajnoczi --- scripts/tracetool/format/ust_events_h.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/ust_events_h.py b/scripts/tracetool/format/ust_events_h.py index 514294c2cc..4e95e9b3f9 100644 --- a/scripts/tracetool/format/ust_events_h.py +++ b/scripts/tracetool/format/ust_events_h.py @@ -79,7 +79,8 @@ def generate(events, backend, group): out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')') elif ("ptr" in t) or ("*" in t): out(' ctf_integer_hex('+ t + ', ' + n + ', ' + n + ')') - elif ('int' in t) or ('long' in t) or ('unsigned' in t) or ('size_t' in t): + elif ('int' in t) or ('long' in t) or ('unsigned' in t) \ + or ('size_t' in t) or ('bool' in t): out(' ctf_integer(' + t + ', ' + n + ', ' + n + ')') elif ('double' in t) or ('float' in t): out(' ctf_float(' + t + ', ' + n + ', ' + n + ')') From patchwork Mon Feb 19 16:19:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 875204 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zlTZt4XwBz9ryn for ; Tue, 20 Feb 2018 03:23:50 +1100 (AEDT) Received: from localhost ([::1]:51068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoEG-0006qZ-K4 for incoming@patchwork.ozlabs.org; Mon, 19 Feb 2018 11:23:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enoAm-0004Vg-2b for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enoAk-0002xz-C7 for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:12 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40410 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1enoAk-0002ws-7K for qemu-devel@nongnu.org; Mon, 19 Feb 2018 11:20:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF5EFEAE9B; Mon, 19 Feb 2018 16:20:09 +0000 (UTC) Received: from localhost (unknown [10.36.118.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6291D6401E; Mon, 19 Feb 2018 16:20:07 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 19 Feb 2018 16:19:55 +0000 Message-Id: <20180219161955.29572-4-stefanha@redhat.com> In-Reply-To: <20180219161955.29572-1-stefanha@redhat.com> References: <20180219161955.29572-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 19 Feb 2018 16:20:09 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'stefanha@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/3] trace: avoid SystemTap "char const" warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" SystemTap's dtrace(1) produces the following warning when it encounters "char const" instead of "const char": Warning: /usr/bin/dtrace:trace-dtrace-root.dtrace:66: syntax error near: probe flatview_destroy_rcu Warning: Proceeding as if --no-pyparsing was given. This is a limitation in current SystemTap releases. I have sent a patch upstream to accept "char const" since it is valid C: https://sourceware.org/ml/systemtap/2018-q1/msg00017.html In QEMU we still wish to avoid warnings in the current SystemTap release. It's simple enough to replace "char const" with "const char". I'm not changing the documentation or implementing checks to prevent this from occurring again in the future. The next release of SystemTap will hopefully resolve this issue. Cc: Daniel P. Berrange Signed-off-by: Stefan Hajnoczi Reviewed-by: Daniel P. Berrange Message-id: 20180201162625.4276-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- hw/block/trace-events | 4 ++-- trace-events | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/block/trace-events b/hw/block/trace-events index 5acd495207..6b9e733412 100644 --- a/hw/block/trace-events +++ b/hw/block/trace-events @@ -17,7 +17,7 @@ nvme_irq_msix(uint32_t vector) "raising MSI-X IRQ vector %u" nvme_irq_pin(void) "pulsing IRQ pin" nvme_irq_masked(void) "IRQ is masked" nvme_dma_read(uint64_t prp1, uint64_t prp2) "DMA read, prp1=0x%"PRIx64" prp2=0x%"PRIx64"" -nvme_rw(char const *verb, uint32_t blk_count, uint64_t byte_count, uint64_t lba) "%s %"PRIu32" blocks (%"PRIu64" bytes) from LBA %"PRIu64"" +nvme_rw(const char *verb, uint32_t blk_count, uint64_t byte_count, uint64_t lba) "%s %"PRIu32" blocks (%"PRIu64" bytes) from LBA %"PRIu64"" nvme_create_sq(uint64_t addr, uint16_t sqid, uint16_t cqid, uint16_t qsize, uint16_t qflags) "create submission queue, addr=0x%"PRIx64", sqid=%"PRIu16", cqid=%"PRIu16", qsize=%"PRIu16", qflags=%"PRIu16"" nvme_create_cq(uint64_t addr, uint16_t cqid, uint16_t vector, uint16_t size, uint16_t qflags, int ien) "create completion queue, addr=0x%"PRIx64", cqid=%"PRIu16", vector=%"PRIu16", qsize=%"PRIu16", qflags=%"PRIu16", ien=%d" nvme_del_sq(uint16_t qid) "deleting submission queue sqid=%"PRIu16"" @@ -25,7 +25,7 @@ nvme_del_cq(uint16_t cqid) "deleted completion queue, sqid=%"PRIu16"" nvme_identify_ctrl(void) "identify controller" nvme_identify_ns(uint16_t ns) "identify namespace, nsid=%"PRIu16"" nvme_identify_nslist(uint16_t ns) "identify namespace list, nsid=%"PRIu16"" -nvme_getfeat_vwcache(char const* result) "get feature volatile write cache, result=%s" +nvme_getfeat_vwcache(const char* result) "get feature volatile write cache, result=%s" nvme_getfeat_numq(int result) "get feature number of queues, result=%d" nvme_setfeat_numq(int reqcq, int reqsq, int gotcq, int gotsq) "requested cq_count=%d sq_count=%d, responding with cq_count=%d sq_count=%d" nvme_mmio_intm_set(uint64_t data, uint64_t new_mask) "wrote MMIO, interrupt mask set, data=0x%"PRIx64", new_mask=0x%"PRIx64"" diff --git a/trace-events b/trace-events index ec95e67089..89fcad0fd1 100644 --- a/trace-events +++ b/trace-events @@ -73,13 +73,13 @@ flatview_destroy(FlatView *view, MemoryRegion *root) "%p (root %p)" flatview_destroy_rcu(FlatView *view, MemoryRegion *root) "%p (root %p)" # gdbstub.c -gdbstub_op_start(char const *device) "Starting gdbstub using device %s" +gdbstub_op_start(const char *device) "Starting gdbstub using device %s" gdbstub_op_exiting(uint8_t code) "notifying exit with code=0x%02x" gdbstub_op_continue(void) "Continuing all CPUs" gdbstub_op_continue_cpu(int cpu_index) "Continuing CPU %d" gdbstub_op_stepping(int cpu_index) "Stepping CPU %d" -gdbstub_op_extra_info(char const *info) "Thread extra info: %s" -gdbstub_hit_watchpoint(char const *type, int cpu_gdb_index, uint64_t vaddr) "Watchpoint hit, type=\"%s\" cpu=%d, vaddr=0x%" PRIx64 "" +gdbstub_op_extra_info(const char *info) "Thread extra info: %s" +gdbstub_hit_watchpoint(const char *type, int cpu_gdb_index, uint64_t vaddr) "Watchpoint hit, type=\"%s\" cpu=%d, vaddr=0x%" PRIx64 "" gdbstub_hit_internal_error(void) "RUN_STATE_INTERNAL_ERROR" gdbstub_hit_break(void) "RUN_STATE_DEBUG" gdbstub_hit_paused(void) "RUN_STATE_PAUSED" @@ -87,9 +87,9 @@ gdbstub_hit_shutdown(void) "RUN_STATE_SHUTDOWN" gdbstub_hit_io_error(void) "RUN_STATE_IO_ERROR" gdbstub_hit_watchdog(void) "RUN_STATE_WATCHDOG" gdbstub_hit_unknown(int state) "Unknown run state=0x%x" -gdbstub_io_reply(char const *message) "Sent: %s" -gdbstub_io_binaryreply(size_t ofs, char const *line) "0x%04zx: %s" -gdbstub_io_command(char const *command) "Received: %s" +gdbstub_io_reply(const char *message) "Sent: %s" +gdbstub_io_binaryreply(size_t ofs, const char *line) "0x%04zx: %s" +gdbstub_io_command(const char *command) "Received: %s" gdbstub_io_got_ack(void) "Got ACK" gdbstub_io_got_unexpected(uint8_t ch) "Got 0x%02x when expecting ACK/NACK" gdbstub_err_got_nack(void) "Got NACK, retransmitting"